Skip to content

Commit fc51187

Browse files
authored
Squashed commit with all contents from new_stuff branch (#141)
* Squashed commit with all contents from new_stuff branch * fixed missed conflict * Oracle's instructions for reporting security vulnerabilities * Installation added
1 parent 577a467 commit fc51187

File tree

173 files changed

+8888
-3613
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+8888
-3613
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@ ords/*zip
77
.gitattributes
88
.vscode
99
.gitlab-ci.yml
10+
11+
# development
12+
.idea
13+
.local

PROJECT

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Code generated by tool. DO NOT EDIT.
2+
# This file is used to track the info used to scaffold your project
3+
# and allow the plugins properly work.
4+
# More info: https://book.kubebuilder.io/reference/project-config.html
15
domain: oracle.com
26
layout:
37
- go.kubebuilder.io/v2
@@ -67,6 +71,10 @@ resources:
6771
kind: ShardingDatabase
6872
path: github.com/oracle/oracle-database-operator/apis/database/v1alpha1
6973
version: v1alpha1
74+
webhooks:
75+
defaulting: true
76+
validation: true
77+
webhookVersion: v1beta1
7078
- api:
7179
crdVersion: v1
7280
namespaced: true

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ In this v1.1.0 production release, `OraOperator` supports the following database
2020
Oracle will continue to extend `OraOperator` to support additional Oracle Database configurations.
2121

2222
## New in V1.1.0 Release
23+
* Namespace scope deployment option
2324
* Enhanced security with namespace scope deployment option
2425
* Support for Oracle Database 23ai Free (with SIDB)
2526
* Automatic Storage Expansion for SIDB and Sharded DB
@@ -125,7 +126,7 @@ Oracle strongly recommends that you ensure your system meets the following [Prer
125126
```sh
126127
kubectl apply -f rbac/node-rbac.yaml
127128
```
128-
129+
# Installation
129130
## Install Oracle DB Operator
130131
131132
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.

SECURITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Reporting security vulnerabilities
1+
# Oracle's instructions for reporting security vulnerabilities
22

33
Oracle values the independent security research community and believes that
44
responsible disclosure of security vulnerabilities helps us ensure the security
@@ -35,4 +35,4 @@ sufficiently hardened for production use.
3535
[1]: mailto:secalert_us@oracle.com
3636
[2]: https://www.oracle.com/corporate/security-practices/assurance/vulnerability/reporting.html
3737
[3]: https://www.oracle.com/security-alerts/encryptionkey.html
38-
[4]: https://www.oracle.com/security-alerts/
38+
[4]: https://www.oracle.com/security-alerts/

apis/database/v1alpha1/adbfamily_common_utils.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@ func traverse(lastSpec interface{}, curSpec interface{}) bool {
173173
return changed
174174
}
175175

176-
// 1. If the current field is with a zero value, then the field is unchanged.
177-
// 2. If the current field is NOT with a zero value, then we want to comapre it with the last field.
178-
// In this case if the last field is with a zero value, then the field is changed
176+
// 1. If the current field is with a zero value, then the field is unchanged.
177+
// 2. If the current field is NOT with a zero value, then we want to comapre it with the last field.
178+
// In this case if the last field is with a zero value, then the field is changed
179179
func hasChanged(lastField reflect.Value, curField reflect.Value) bool {
180180
zero := reflect.Zero(lastField.Type()).Interface()
181181
lastFieldIsZero := reflect.DeepEqual(lastField.Interface(), zero)

apis/database/v1alpha1/autonomousdatabasebackup_types.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ import (
5252
type AutonomousDatabaseBackupSpec struct {
5353
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
5454
// Important: Run "make" to regenerate code after modifying this file
55-
Target TargetSpec `json:"target,omitempty"`
56-
DisplayName *string `json:"displayName,omitempty"`
57-
AutonomousDatabaseBackupOCID *string `json:"autonomousDatabaseBackupOCID,omitempty"`
58-
IsLongTermBackup *bool `json:"isLongTermBackup,omitempty"`
59-
RetentionPeriodInDays *int `json:"retentionPeriodInDays,omitempty"`
60-
OCIConfig OCIConfigSpec `json:"ociConfig,omitempty"`
55+
Target TargetSpec `json:"target,omitempty"`
56+
DisplayName *string `json:"displayName,omitempty"`
57+
AutonomousDatabaseBackupOCID *string `json:"autonomousDatabaseBackupOCID,omitempty"`
58+
IsLongTermBackup *bool `json:"isLongTermBackup,omitempty"`
59+
RetentionPeriodInDays *int `json:"retentionPeriodInDays,omitempty"`
60+
OCIConfig OCIConfigSpec `json:"ociConfig,omitempty"`
6161
}
6262

6363
// AutonomousDatabaseBackupStatus defines the observed state of AutonomousDatabaseBackup

apis/database/v1alpha1/dataguardbroker_types.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ type DataguardBrokerSpec struct {
5050
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
5151
// Important: Run "make" to regenerate code after modifying this file
5252

53-
PrimaryDatabaseRef string `json:"primaryDatabaseRef"`
54-
StandbyDatabaseRefs []string `json:"standbyDatabaseRefs"`
55-
SetAsPrimaryDatabase string `json:"setAsPrimaryDatabase,omitempty"`
56-
LoadBalancer bool `json:"loadBalancer,omitempty"`
57-
ServiceAnnotations map[string]string `json:"serviceAnnotations,omitempty"`
53+
PrimaryDatabaseRef string `json:"primaryDatabaseRef"`
54+
StandbyDatabaseRefs []string `json:"standbyDatabaseRefs"`
55+
SetAsPrimaryDatabase string `json:"setAsPrimaryDatabase,omitempty"`
56+
LoadBalancer bool `json:"loadBalancer,omitempty"`
57+
ServiceAnnotations map[string]string `json:"serviceAnnotations,omitempty"`
5858
// +kubebuilder:validation:Enum=MaxPerformance;MaxAvailability
59-
ProtectionMode string `json:"protectionMode"`
60-
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
61-
FastStartFailOver DataguardBrokerFastStartFailOver `json:"fastStartFailOver,omitempty"`
59+
ProtectionMode string `json:"protectionMode"`
60+
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
61+
FastStartFailOver DataguardBrokerFastStartFailOver `json:"fastStartFailOver,omitempty"`
6262
}
6363

6464
type DataguardBrokerFastStartFailOver struct {

apis/database/v1alpha1/groupversion_info.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
*/
3838

3939
// Package v1alpha1 contains API Schema definitions for the database v1alpha1 API group
40-
//+kubebuilder:object:generate=true
41-
//+groupName=database.oracle.com
40+
// +kubebuilder:object:generate=true
41+
// +groupName=database.oracle.com
4242
package v1alpha1
4343

4444
import (

apis/database/v1alpha1/pdb_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ type PDBSpec struct {
114114
// The target state of the PDB
115115
// +kubebuilder:validation:Enum=OPEN;CLOSE
116116
PDBState string `json:"pdbState,omitempty"`
117+
// turn on the assertive approach to delete pdb resource
118+
// kubectl delete pdb ..... automatically triggers the pluggable database
119+
// deletion
120+
AssertivePdbDeletion bool `json:"assertivePdbDeletion,omitempty"`
117121
}
118122

119123
// PDBAdminName defines the secret containing Sys Admin User mapped to key 'adminName' for PDB

apis/database/v1alpha1/shardingdatabase_types.go

Lines changed: 55 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -58,39 +58,43 @@ import (
5858
type ShardingDatabaseSpec struct {
5959
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
6060
// Important: Run "make" to regenerate code after modifying this file
61-
Shard []ShardSpec `json:"shard"`
62-
Catalog []CatalogSpec `json:"catalog"` // The catalogSpes accept all the catalog parameters
63-
Gsm []GsmSpec `json:"gsm"` // The GsmSpec will accept all the Gsm parameter
64-
StorageClass string `json:"storageClass,omitempty"` // Optional Accept storage class name
65-
DbImage string `json:"dbImage"` // Accept DB Image name
66-
DbImagePullSecret string `json:"dbImagePullSecret,omitempty"` // Optional The name of an image pull secret in case of a private docker repository.
67-
GsmImage string `json:"gsmImage"` // Acccept the GSM image name
68-
GsmImagePullSecret string `json:"gsmImagePullSecret,omitempty"` // Optional The name of an image pull secret in case of a private docker repository.
69-
StagePvcName string `json:"stagePvcName,omitempty"` // the Stagepvc for the backup of cluster
70-
PortMappings []PortMapping `json:"portMappings,omitempty"` // Port mappings for the service that is created. The service is created if there is at least
71-
Namespace string `json:"namespace,omitempty"` // Target namespace of the application.
72-
IsDebug bool `json:"isDebug,omitempty"` // Optional parameter to enable logining
73-
IsExternalSvc bool `json:"isExternalSvc,omitempty"`
74-
IsClone bool `json:"isClone,omitempty"`
75-
IsDataGuard bool `json:"isDataGuard,omitempty"`
76-
ScriptsLocation string `json:"scriptsLocation,omitempty"`
77-
IsDeleteOraPvc bool `json:"isDeleteOraPvc,omitempty"`
78-
ReadinessCheckPeriod int `json:"readinessCheckPeriod,omitempty"`
79-
LivenessCheckPeriod int `json:"liveinessCheckPeriod,omitempty"`
80-
ReplicationType string `json:"replicationType,omitempty"`
81-
IsDownloadScripts bool `json:"isDownloadScripts,omitempty"`
82-
InvitedNodeSubnetFlag string `json:"invitedNodeSubnetFlag,omitempty"`
83-
InvitedNodeSubnet string `json:"InvitedNodeSubnet,omitempty"`
84-
ShardingType string `json:"shardingType,omitempty"`
85-
GsmShardSpace []GsmShardSpaceSpec `json:"gsmShardSpace,omitempty"`
86-
GsmShardGroup []GsmShardGroupSpec `json:"gsmShardGroup,omitempty"`
87-
ShardRegion []string `json:"shardRegion,omitempty"`
88-
ShardBuddyRegion string `json:"shardBuddyRegion,omitempty"`
89-
GsmService []GsmServiceSpec `json:"gsmService,omitempty"`
90-
ShardConfigName string `json:"shardConfigName,omitempty"`
91-
GsmDevMode string `json:"gsmDevMode,omitempty"`
92-
DbSecret *SecretDetails `json:"dbSecret,omitempty"` // Secret Name to be used with Shard
93-
IsTdeWallet bool `json:"isTdeWallet,omitempty"`
61+
Shard []ShardSpec `json:"shard"`
62+
Catalog []CatalogSpec `json:"catalog"` // The catalogSpes accept all the catalog parameters
63+
Gsm []GsmSpec `json:"gsm"` // The GsmSpec will accept all the Gsm parameter
64+
StorageClass string `json:"storageClass,omitempty"` // Optional Accept storage class name
65+
DbImage string `json:"dbImage"` // Accept DB Image name
66+
DbImagePullSecret string `json:"dbImagePullSecret,omitempty"` // Optional The name of an image pull secret in case of a private docker repository.
67+
GsmImage string `json:"gsmImage"` // Acccept the GSM image name
68+
GsmImagePullSecret string `json:"gsmImagePullSecret,omitempty"` // Optional The name of an image pull secret in case of a private docker repository.
69+
StagePvcName string `json:"stagePvcName,omitempty"` // the Stagepvc for the backup of cluster
70+
PortMappings []PortMapping `json:"portMappings,omitempty"` // Port mappings for the service that is created. The service is created if there is at least
71+
Namespace string `json:"namespace,omitempty"` // Target namespace of the application.
72+
IsDebug bool `json:"isDebug,omitempty"` // Optional parameter to enable logining
73+
IsExternalSvc bool `json:"isExternalSvc,omitempty"`
74+
IsClone bool `json:"isClone,omitempty"`
75+
IsDataGuard bool `json:"isDataGuard,omitempty"`
76+
ScriptsLocation string `json:"scriptsLocation,omitempty"`
77+
IsDeleteOraPvc bool `json:"isDeleteOraPvc,omitempty"`
78+
ReadinessCheckPeriod int `json:"readinessCheckPeriod,omitempty"`
79+
LivenessCheckPeriod int `json:"liveinessCheckPeriod,omitempty"`
80+
ReplicationType string `json:"replicationType,omitempty"`
81+
IsDownloadScripts bool `json:"isDownloadScripts,omitempty"`
82+
InvitedNodeSubnetFlag string `json:"invitedNodeSubnetFlag,omitempty"`
83+
InvitedNodeSubnet string `json:"InvitedNodeSubnet,omitempty"`
84+
ShardingType string `json:"shardingType,omitempty"`
85+
GsmShardSpace []GsmShardSpaceSpec `json:"gsmShardSpace,omitempty"`
86+
GsmShardGroup []GsmShardGroupSpec `json:"gsmShardGroup,omitempty"`
87+
ShardRegion []string `json:"shardRegion,omitempty"`
88+
ShardBuddyRegion string `json:"shardBuddyRegion,omitempty"`
89+
GsmService []GsmServiceSpec `json:"gsmService,omitempty"`
90+
ShardConfigName string `json:"shardConfigName,omitempty"`
91+
GsmDevMode string `json:"gsmDevMode,omitempty"`
92+
DbSecret *SecretDetails `json:"dbSecret,omitempty"` // Secret Name to be used with Shard
93+
IsTdeWallet string `json:"isTdeWallet,omitempty"`
94+
TdeWalletPvc string `json:"tdeWalletPvc,omitempty"`
95+
FssStorageClass string `json:"fssStorageClass,omitempty"`
96+
TdeWalletPvcMountLocation string `json:"tdeWalletPvcMountLocation,omitempty"`
97+
DbEdition string `json:"dbEdition,omitempty"`
9498
}
9599

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

184189
// CatalogSpec defines the desired state of CatalogSpec
@@ -190,7 +195,7 @@ type CatalogSpec struct {
190195
Resources *corev1.ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,1,opt,name=resources"` // Optional resource requirement for the container.
191196
PvcName string `json:"pvcName,omitempty"`
192197
Label string `json:"label,omitempty"`
193-
IsDelete bool `json:"isDelete,omitempty"`
198+
IsDelete string `json:"isDelete,omitempty"`
194199
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
195200
PvAnnotations map[string]string `json:"pvAnnotations,omitempty"`
196201
PvMatchLabels map[string]string `json:"pvMatchLabels,omitempty"`
@@ -208,7 +213,7 @@ type GsmSpec struct {
208213
Resources *corev1.ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,1,opt,name=resources"` // Optional resource requirement for the container.
209214
PvcName string `json:"pvcName,omitempty"`
210215
Label string `json:"label,omitempty"` // Optional GSM Label
211-
IsDelete bool `json:"isDelete,omitempty"`
216+
IsDelete string `json:"isDelete,omitempty"`
212217
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
213218
PvMatchLabels map[string]string `json:"pvMatchLabels,omitempty"`
214219
ImagePulllPolicy *corev1.PullPolicy `json:"imagePullPolicy,omitempty"`

0 commit comments

Comments
 (0)