Skip to content

Squashed commit with all contents from new_stuff branch #141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ ords/*zip
.gitattributes
.vscode
.gitlab-ci.yml

# development
.idea
.local
8 changes: 8 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Code generated by tool. DO NOT EDIT.
# This file is used to track the info used to scaffold your project
# and allow the plugins properly work.
# More info: https://book.kubebuilder.io/reference/project-config.html
domain: oracle.com
layout:
- go.kubebuilder.io/v2
Expand Down Expand Up @@ -67,6 +71,10 @@ resources:
kind: ShardingDatabase
path: github.com/oracle/oracle-database-operator/apis/database/v1alpha1
version: v1alpha1
webhooks:
defaulting: true
validation: true
webhookVersion: v1beta1
- api:
crdVersion: v1
namespaced: true
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ In this v1.1.0 production release, `OraOperator` supports the following database
Oracle will continue to extend `OraOperator` to support additional Oracle Database configurations.

## New in V1.1.0 Release
* Namespace scope deployment option
* Enhanced security with namespace scope deployment option
* Support for Oracle Database 23ai Free (with SIDB)
* Automatic Storage Expansion for SIDB and Sharded DB
Expand Down Expand Up @@ -125,7 +126,7 @@ Oracle strongly recommends that you ensure your system meets the following [Prer
```sh
kubectl apply -f rbac/node-rbac.yaml
```

# Installation
## Install Oracle DB Operator

After you have completed the preceding prerequisite changes, you can install the operator. To install the operator in the cluster quickly, you can apply the modified `oracle-database-operator.yaml` file from the preceding step.
Expand Down
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Reporting security vulnerabilities
# Oracle's instructions for reporting security vulnerabilities

Oracle values the independent security research community and believes that
responsible disclosure of security vulnerabilities helps us ensure the security
Expand Down Expand Up @@ -35,4 +35,4 @@ sufficiently hardened for production use.
[1]: mailto:secalert_us@oracle.com
[2]: https://www.oracle.com/corporate/security-practices/assurance/vulnerability/reporting.html
[3]: https://www.oracle.com/security-alerts/encryptionkey.html
[4]: https://www.oracle.com/security-alerts/
[4]: https://www.oracle.com/security-alerts/
6 changes: 3 additions & 3 deletions apis/database/v1alpha1/adbfamily_common_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ func traverse(lastSpec interface{}, curSpec interface{}) bool {
return changed
}

// 1. If the current field is with a zero value, then the field is unchanged.
// 2. If the current field is NOT with a zero value, then we want to comapre it with the last field.
// In this case if the last field is with a zero value, then the field is changed
// 1. If the current field is with a zero value, then the field is unchanged.
// 2. If the current field is NOT with a zero value, then we want to comapre it with the last field.
// In this case if the last field is with a zero value, then the field is changed
func hasChanged(lastField reflect.Value, curField reflect.Value) bool {
zero := reflect.Zero(lastField.Type()).Interface()
lastFieldIsZero := reflect.DeepEqual(lastField.Interface(), zero)
Expand Down
12 changes: 6 additions & 6 deletions apis/database/v1alpha1/autonomousdatabasebackup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ import (
type AutonomousDatabaseBackupSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
Target TargetSpec `json:"target,omitempty"`
DisplayName *string `json:"displayName,omitempty"`
AutonomousDatabaseBackupOCID *string `json:"autonomousDatabaseBackupOCID,omitempty"`
IsLongTermBackup *bool `json:"isLongTermBackup,omitempty"`
RetentionPeriodInDays *int `json:"retentionPeriodInDays,omitempty"`
OCIConfig OCIConfigSpec `json:"ociConfig,omitempty"`
Target TargetSpec `json:"target,omitempty"`
DisplayName *string `json:"displayName,omitempty"`
AutonomousDatabaseBackupOCID *string `json:"autonomousDatabaseBackupOCID,omitempty"`
IsLongTermBackup *bool `json:"isLongTermBackup,omitempty"`
RetentionPeriodInDays *int `json:"retentionPeriodInDays,omitempty"`
OCIConfig OCIConfigSpec `json:"ociConfig,omitempty"`
}

// AutonomousDatabaseBackupStatus defines the observed state of AutonomousDatabaseBackup
Expand Down
16 changes: 8 additions & 8 deletions apis/database/v1alpha1/dataguardbroker_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ type DataguardBrokerSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file

PrimaryDatabaseRef string `json:"primaryDatabaseRef"`
StandbyDatabaseRefs []string `json:"standbyDatabaseRefs"`
SetAsPrimaryDatabase string `json:"setAsPrimaryDatabase,omitempty"`
LoadBalancer bool `json:"loadBalancer,omitempty"`
ServiceAnnotations map[string]string `json:"serviceAnnotations,omitempty"`
PrimaryDatabaseRef string `json:"primaryDatabaseRef"`
StandbyDatabaseRefs []string `json:"standbyDatabaseRefs"`
SetAsPrimaryDatabase string `json:"setAsPrimaryDatabase,omitempty"`
LoadBalancer bool `json:"loadBalancer,omitempty"`
ServiceAnnotations map[string]string `json:"serviceAnnotations,omitempty"`
// +kubebuilder:validation:Enum=MaxPerformance;MaxAvailability
ProtectionMode string `json:"protectionMode"`
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
FastStartFailOver DataguardBrokerFastStartFailOver `json:"fastStartFailOver,omitempty"`
ProtectionMode string `json:"protectionMode"`
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
FastStartFailOver DataguardBrokerFastStartFailOver `json:"fastStartFailOver,omitempty"`
}

type DataguardBrokerFastStartFailOver struct {
Expand Down
4 changes: 2 additions & 2 deletions apis/database/v1alpha1/groupversion_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
*/

// Package v1alpha1 contains API Schema definitions for the database v1alpha1 API group
//+kubebuilder:object:generate=true
//+groupName=database.oracle.com
// +kubebuilder:object:generate=true
// +groupName=database.oracle.com
package v1alpha1

import (
Expand Down
4 changes: 4 additions & 0 deletions apis/database/v1alpha1/pdb_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ type PDBSpec struct {
// The target state of the PDB
// +kubebuilder:validation:Enum=OPEN;CLOSE
PDBState string `json:"pdbState,omitempty"`
// turn on the assertive approach to delete pdb resource
// kubectl delete pdb ..... automatically triggers the pluggable database
// deletion
AssertivePdbDeletion bool `json:"assertivePdbDeletion,omitempty"`
}

// PDBAdminName defines the secret containing Sys Admin User mapped to key 'adminName' for PDB
Expand Down
105 changes: 55 additions & 50 deletions apis/database/v1alpha1/shardingdatabase_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,39 +58,43 @@ import (
type ShardingDatabaseSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
Shard []ShardSpec `json:"shard"`
Catalog []CatalogSpec `json:"catalog"` // The catalogSpes accept all the catalog parameters
Gsm []GsmSpec `json:"gsm"` // The GsmSpec will accept all the Gsm parameter
StorageClass string `json:"storageClass,omitempty"` // Optional Accept storage class name
DbImage string `json:"dbImage"` // Accept DB Image name
DbImagePullSecret string `json:"dbImagePullSecret,omitempty"` // Optional The name of an image pull secret in case of a private docker repository.
GsmImage string `json:"gsmImage"` // Acccept the GSM image name
GsmImagePullSecret string `json:"gsmImagePullSecret,omitempty"` // Optional The name of an image pull secret in case of a private docker repository.
StagePvcName string `json:"stagePvcName,omitempty"` // the Stagepvc for the backup of cluster
PortMappings []PortMapping `json:"portMappings,omitempty"` // Port mappings for the service that is created. The service is created if there is at least
Namespace string `json:"namespace,omitempty"` // Target namespace of the application.
IsDebug bool `json:"isDebug,omitempty"` // Optional parameter to enable logining
IsExternalSvc bool `json:"isExternalSvc,omitempty"`
IsClone bool `json:"isClone,omitempty"`
IsDataGuard bool `json:"isDataGuard,omitempty"`
ScriptsLocation string `json:"scriptsLocation,omitempty"`
IsDeleteOraPvc bool `json:"isDeleteOraPvc,omitempty"`
ReadinessCheckPeriod int `json:"readinessCheckPeriod,omitempty"`
LivenessCheckPeriod int `json:"liveinessCheckPeriod,omitempty"`
ReplicationType string `json:"replicationType,omitempty"`
IsDownloadScripts bool `json:"isDownloadScripts,omitempty"`
InvitedNodeSubnetFlag string `json:"invitedNodeSubnetFlag,omitempty"`
InvitedNodeSubnet string `json:"InvitedNodeSubnet,omitempty"`
ShardingType string `json:"shardingType,omitempty"`
GsmShardSpace []GsmShardSpaceSpec `json:"gsmShardSpace,omitempty"`
GsmShardGroup []GsmShardGroupSpec `json:"gsmShardGroup,omitempty"`
ShardRegion []string `json:"shardRegion,omitempty"`
ShardBuddyRegion string `json:"shardBuddyRegion,omitempty"`
GsmService []GsmServiceSpec `json:"gsmService,omitempty"`
ShardConfigName string `json:"shardConfigName,omitempty"`
GsmDevMode string `json:"gsmDevMode,omitempty"`
DbSecret *SecretDetails `json:"dbSecret,omitempty"` // Secret Name to be used with Shard
IsTdeWallet bool `json:"isTdeWallet,omitempty"`
Shard []ShardSpec `json:"shard"`
Catalog []CatalogSpec `json:"catalog"` // The catalogSpes accept all the catalog parameters
Gsm []GsmSpec `json:"gsm"` // The GsmSpec will accept all the Gsm parameter
StorageClass string `json:"storageClass,omitempty"` // Optional Accept storage class name
DbImage string `json:"dbImage"` // Accept DB Image name
DbImagePullSecret string `json:"dbImagePullSecret,omitempty"` // Optional The name of an image pull secret in case of a private docker repository.
GsmImage string `json:"gsmImage"` // Acccept the GSM image name
GsmImagePullSecret string `json:"gsmImagePullSecret,omitempty"` // Optional The name of an image pull secret in case of a private docker repository.
StagePvcName string `json:"stagePvcName,omitempty"` // the Stagepvc for the backup of cluster
PortMappings []PortMapping `json:"portMappings,omitempty"` // Port mappings for the service that is created. The service is created if there is at least
Namespace string `json:"namespace,omitempty"` // Target namespace of the application.
IsDebug bool `json:"isDebug,omitempty"` // Optional parameter to enable logining
IsExternalSvc bool `json:"isExternalSvc,omitempty"`
IsClone bool `json:"isClone,omitempty"`
IsDataGuard bool `json:"isDataGuard,omitempty"`
ScriptsLocation string `json:"scriptsLocation,omitempty"`
IsDeleteOraPvc bool `json:"isDeleteOraPvc,omitempty"`
ReadinessCheckPeriod int `json:"readinessCheckPeriod,omitempty"`
LivenessCheckPeriod int `json:"liveinessCheckPeriod,omitempty"`
ReplicationType string `json:"replicationType,omitempty"`
IsDownloadScripts bool `json:"isDownloadScripts,omitempty"`
InvitedNodeSubnetFlag string `json:"invitedNodeSubnetFlag,omitempty"`
InvitedNodeSubnet string `json:"InvitedNodeSubnet,omitempty"`
ShardingType string `json:"shardingType,omitempty"`
GsmShardSpace []GsmShardSpaceSpec `json:"gsmShardSpace,omitempty"`
GsmShardGroup []GsmShardGroupSpec `json:"gsmShardGroup,omitempty"`
ShardRegion []string `json:"shardRegion,omitempty"`
ShardBuddyRegion string `json:"shardBuddyRegion,omitempty"`
GsmService []GsmServiceSpec `json:"gsmService,omitempty"`
ShardConfigName string `json:"shardConfigName,omitempty"`
GsmDevMode string `json:"gsmDevMode,omitempty"`
DbSecret *SecretDetails `json:"dbSecret,omitempty"` // Secret Name to be used with Shard
IsTdeWallet string `json:"isTdeWallet,omitempty"`
TdeWalletPvc string `json:"tdeWalletPvc,omitempty"`
FssStorageClass string `json:"fssStorageClass,omitempty"`
TdeWalletPvcMountLocation string `json:"tdeWalletPvcMountLocation,omitempty"`
DbEdition string `json:"dbEdition,omitempty"`
}

// To understand Metav1.Condition, please refer the link https://pkg.go.dev/k8s.io/apimachinery/pkg/apis/meta/v1
Expand Down Expand Up @@ -164,21 +168,22 @@ type ShardingDatabaseList struct {
// ShardSpec is a specification of Shards for an application deployment.
// +k8s:openapi-gen=true
type ShardSpec struct {
Name string `json:"name"` // Shard name that will be used deploy StatefulSet
StorageSizeInGb int32 `json:"storageSizeInGb,omitempty"` // Optional Shard Storage Size
EnvVars []EnvironmentVariable `json:"envVars,omitempty"` //Optional Env variables for Shards
Resources *corev1.ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,1,opt,name=resources"` //Optional resource requirement for the container.
PvcName string `json:"pvcName,omitempty"`
Label string `json:"label,omitempty"`
IsDelete bool `json:"isDelete,omitempty"`
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
PvAnnotations map[string]string `json:"pvAnnotations,omitempty"`
PvMatchLabels map[string]string `json:"pvMatchLabels,omitempty"`
ImagePulllPolicy *corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
ShardSpace string `json:"shardSpace,omitempty"`
ShardGroup string `json:"shardGroup,omitempty"`
ShardRegion string `json:"shardRegion,omitempty"`
DeployAs string `json:"deployAs,omitempty"`
Name string `json:"name"` // Shard name that will be used deploy StatefulSet
StorageSizeInGb int32 `json:"storageSizeInGb,omitempty"` // Optional Shard Storage Size
EnvVars []EnvironmentVariable `json:"envVars,omitempty"` //Optional Env variables for Shards
Resources *corev1.ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,1,opt,name=resources"` //Optional resource requirement for the container.
PvcName string `json:"pvcName,omitempty"`
Label string `json:"label,omitempty"`
// +kubebuilder:validation:Enum=enable;disable;failed;force
IsDelete string `json:"isDelete,omitempty"`
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
PvAnnotations map[string]string `json:"pvAnnotations,omitempty"`
PvMatchLabels map[string]string `json:"pvMatchLabels,omitempty"`
ImagePulllPolicy *corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
ShardSpace string `json:"shardSpace,omitempty"`
ShardGroup string `json:"shardGroup,omitempty"`
ShardRegion string `json:"shardRegion,omitempty"`
DeployAs string `json:"deployAs,omitempty"`
}

// CatalogSpec defines the desired state of CatalogSpec
Expand All @@ -190,7 +195,7 @@ type CatalogSpec struct {
Resources *corev1.ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,1,opt,name=resources"` // Optional resource requirement for the container.
PvcName string `json:"pvcName,omitempty"`
Label string `json:"label,omitempty"`
IsDelete bool `json:"isDelete,omitempty"`
IsDelete string `json:"isDelete,omitempty"`
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
PvAnnotations map[string]string `json:"pvAnnotations,omitempty"`
PvMatchLabels map[string]string `json:"pvMatchLabels,omitempty"`
Expand All @@ -208,7 +213,7 @@ type GsmSpec struct {
Resources *corev1.ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,1,opt,name=resources"` // Optional resource requirement for the container.
PvcName string `json:"pvcName,omitempty"`
Label string `json:"label,omitempty"` // Optional GSM Label
IsDelete bool `json:"isDelete,omitempty"`
IsDelete string `json:"isDelete,omitempty"`
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
PvMatchLabels map[string]string `json:"pvMatchLabels,omitempty"`
ImagePulllPolicy *corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
Expand Down
Loading