Skip to content

Commit 548a6a7

Browse files
committed
Merge branch 'backport-mr4416-41' into 'release/4.1'
Backport MR 4416 to release/4.1 See merge request weblogic-cloud/weblogic-kubernetes-operator!4426
2 parents c86a65c + 322ce50 commit 548a6a7

File tree

4 files changed

+273
-11
lines changed

4 files changed

+273
-11
lines changed

integration-tests/src/test/java/oracle/weblogic/kubernetes/ItSystemResOverrides.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,13 @@
5353
import static oracle.weblogic.kubernetes.actions.TestActions.getNextIntrospectVersion;
5454
import static oracle.weblogic.kubernetes.actions.TestActions.getServiceNodePort;
5555
import static oracle.weblogic.kubernetes.actions.TestActions.getServicePort;
56+
import static oracle.weblogic.kubernetes.actions.TestActions.shutdownDomain;
57+
import static oracle.weblogic.kubernetes.actions.TestActions.startDomain;
5658
import static oracle.weblogic.kubernetes.actions.impl.Domain.patchDomainCustomResource;
5759
import static oracle.weblogic.kubernetes.assertions.TestAssertions.podStateNotChanged;
5860
import static oracle.weblogic.kubernetes.utils.BuildApplication.buildApplication;
5961
import static oracle.weblogic.kubernetes.utils.ClusterUtils.createClusterResourceAndAddReferenceToDomain;
62+
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.checkPodReadyAndServiceExists;
6063
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.checkServiceExists;
6164
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.getHostAndPort;
6265
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.getNextFreePort;
@@ -501,5 +504,27 @@ private void createDomainOnPVUsingWlst(Path wlstScriptFile, Path domainPropertie
501504
createDomainJob(WEBLOGIC_IMAGE_TO_USE_IN_SPEC, pvName, pvcName, domainScriptConfigMapName,
502505
namespace, jobCreationContainer);
503506
}
507+
508+
//restart pods by manipulating the serverStartPolicy to Never and IfNeeded
509+
private void restartDomain() {
510+
logger.info("Restarting domain {0}", domainNamespace);
511+
shutdownDomain(domainUid, domainNamespace);
512+
513+
logger.info("Checking for admin server pod shutdown");
514+
checkPodDoesNotExist(adminServerPodName, domainUid, domainNamespace);
515+
logger.info("Checking managed server pods were shutdown");
516+
for (int i = 1; i <= replicaCount; i++) {
517+
checkPodDoesNotExist(managedServerPodNamePrefix + i, domainUid, domainNamespace);
518+
}
519+
520+
startDomain(domainUid, domainNamespace);
521+
checkPodReadyAndServiceExists(adminServerPodName, domainUid, domainNamespace);
522+
// verify managed server services and pods are created
523+
for (int i = 1; i <= replicaCount; i++) {
524+
logger.info("Wait for managed pod {0} to be ready in namespace {1}",
525+
managedServerPodNamePrefix + i, domainNamespace);
526+
checkPodReadyAndServiceExists(managedServerPodNamePrefix + i, domainUid, domainNamespace);
527+
}
528+
}
504529

505530
}

integration-tests/src/test/java/oracle/weblogic/kubernetes/utils/DbUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ public static void installDBOperator(String namespace) throws IOException {
775775
replaceStringInFile(operatorYamlDestFile.toString(), "oracle-database-operator-system", namespace);
776776
replaceStringInFile(operatorYamlDestFile.toString(), "container-registry-secret", TEST_IMAGES_REPO_SECRET_NAME);
777777
replaceStringInFile(operatorYamlDestFile.toString(),
778-
"container-registry.oracle.com/database/operator:0.2.1", DB_OPERATOR_IMAGE);
778+
"container-registry.oracle.com/database/operator:1.0.0", DB_OPERATOR_IMAGE);
779779
replaceStringInFile(operatorYamlDestFile.toString(), "imagePullPolicy: Always", "imagePullPolicy: IfNotPresent");
780780
createTestRepoSecret(namespace);
781781
createBaseRepoSecret(namespace);
@@ -876,7 +876,7 @@ public static String createOracleDBUsingOperator(String dbName, String sysPasswo
876876

877877
ConditionFactory withLongRetryPolicy = with().pollDelay(2, SECONDS)
878878
.and().with().pollInterval(10, SECONDS)
879-
.atMost(25, MINUTES).await();
879+
.atMost(40, MINUTES).await();
880880

881881
// wait for the pod to be ready
882882
logger.info("Wait for the database {0} pod to be ready in namespace {1}", dbName, namespace);

integration-tests/src/test/resources/dboperator/oracle-database-operator.yaml

Lines changed: 219 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -853,6 +853,135 @@ status:
853853
---
854854
apiVersion: apiextensions.k8s.io/v1
855855
kind: CustomResourceDefinition
856+
metadata:
857+
annotations:
858+
controller-gen.kubebuilder.io/version: v0.6.1
859+
creationTimestamp: null
860+
name: dataguardbrokers.database.oracle.com
861+
spec:
862+
group: database.oracle.com
863+
names:
864+
kind: DataguardBroker
865+
listKind: DataguardBrokerList
866+
plural: dataguardbrokers
867+
singular: dataguardbroker
868+
scope: Namespaced
869+
versions:
870+
- additionalPrinterColumns:
871+
- jsonPath: .status.primaryDatabase
872+
name: Primary
873+
type: string
874+
- jsonPath: .status.standbyDatabases
875+
name: Standbys
876+
type: string
877+
- jsonPath: .spec.protectionMode
878+
name: Protection Mode
879+
type: string
880+
- jsonPath: .status.clusterConnectString
881+
name: Cluster Connect Str
882+
priority: 1
883+
type: string
884+
- jsonPath: .status.externalConnectString
885+
name: Connect Str
886+
type: string
887+
- jsonPath: .spec.primaryDatabaseRef
888+
name: Primary Database
889+
priority: 1
890+
type: string
891+
- jsonPath: .status.status
892+
name: Status
893+
type: string
894+
name: v1alpha1
895+
schema:
896+
openAPIV3Schema:
897+
description: DataguardBroker is the Schema for the dataguardbrokers API
898+
properties:
899+
apiVersion:
900+
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
901+
type: string
902+
kind:
903+
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
904+
type: string
905+
metadata:
906+
type: object
907+
spec:
908+
description: DataguardBrokerSpec defines the desired state of DataguardBroker
909+
properties:
910+
fastStartFailOver:
911+
properties:
912+
enable:
913+
type: boolean
914+
strategy:
915+
items:
916+
description: FSFO strategy
917+
properties:
918+
sourceDatabaseRef:
919+
type: string
920+
targetDatabaseRefs:
921+
type: string
922+
type: object
923+
type: array
924+
type: object
925+
loadBalancer:
926+
type: boolean
927+
nodeSelector:
928+
additionalProperties:
929+
type: string
930+
type: object
931+
primaryDatabaseRef:
932+
type: string
933+
protectionMode:
934+
enum:
935+
- MaxPerformance
936+
- MaxAvailability
937+
type: string
938+
serviceAnnotations:
939+
additionalProperties:
940+
type: string
941+
type: object
942+
setAsPrimaryDatabase:
943+
type: string
944+
standbyDatabaseRefs:
945+
items:
946+
type: string
947+
type: array
948+
required:
949+
- primaryDatabaseRef
950+
- protectionMode
951+
- standbyDatabaseRefs
952+
type: object
953+
status:
954+
description: DataguardBrokerStatus defines the observed state of DataguardBroker
955+
properties:
956+
clusterConnectString:
957+
type: string
958+
externalConnectString:
959+
type: string
960+
primaryDatabase:
961+
type: string
962+
primaryDatabaseRef:
963+
type: string
964+
protectionMode:
965+
type: string
966+
standbyDatabases:
967+
type: string
968+
status:
969+
type: string
970+
type: object
971+
type: object
972+
served: true
973+
storage: true
974+
subresources:
975+
status: {}
976+
status:
977+
acceptedNames:
978+
kind: ""
979+
plural: ""
980+
conditions: []
981+
storedVersions: []
982+
---
983+
apiVersion: apiextensions.k8s.io/v1
984+
kind: CustomResourceDefinition
856985
metadata:
857986
annotations:
858987
controller-gen.kubebuilder.io/version: v0.6.1
@@ -1915,7 +2044,7 @@ spec:
19152044
type: object
19162045
conditions:
19172046
items:
1918-
description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
2047+
description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, \n \ttype FooStatus struct{ \t // Represents the observations of a foo's current state. \t // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" \t // +patchMergeKey=type \t // +patchStrategy=merge \t // +listType=map \t // +listMapKey=type \t Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n \t // other fields \t}"
19192048
properties:
19202049
lastTransitionTime:
19212050
description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
@@ -2015,26 +2144,29 @@ spec:
20152144
- jsonPath: .status.edition
20162145
name: Edition
20172146
type: string
2147+
- jsonPath: .status.sid
2148+
name: Sid
2149+
priority: 1
2150+
type: string
20182151
- jsonPath: .status.status
20192152
name: Status
20202153
type: string
20212154
- jsonPath: .status.role
20222155
name: Role
2023-
priority: 1
20242156
type: string
20252157
- jsonPath: .status.releaseUpdate
20262158
name: Version
20272159
type: string
20282160
- jsonPath: .status.connectString
20292161
name: Connect Str
20302162
type: string
2031-
- jsonPath: .status.tcpsConnectString
2032-
name: TCPS Connect Str
2033-
type: string
20342163
- jsonPath: .status.pdbConnectString
20352164
name: Pdb Connect Str
20362165
priority: 1
20372166
type: string
2167+
- jsonPath: .status.tcpsConnectString
2168+
name: TCPS Connect Str
2169+
type: string
20382170
- jsonPath: .status.tcpsPdbConnectString
20392171
name: TCPS Pdb Connect Str
20402172
priority: 1
@@ -2077,11 +2209,16 @@ spec:
20772209
type: string
20782210
cloneFrom:
20792211
type: string
2212+
createAsStandby:
2213+
type: boolean
2214+
dgBrokerConfigured:
2215+
type: boolean
20802216
edition:
20812217
enum:
20822218
- standard
20832219
- enterprise
20842220
- express
2221+
- free
20852222
type: string
20862223
enableTCPS:
20872224
type: boolean
@@ -2142,6 +2279,8 @@ spec:
21422279
volumeName:
21432280
type: string
21442281
type: object
2282+
primaryDatabaseRef:
2283+
type: string
21452284
readinessCheckPeriod:
21462285
type: integer
21472286
replicas:
@@ -2185,7 +2324,7 @@ spec:
21852324
type: string
21862325
conditions:
21872326
items:
2188-
description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
2327+
description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, \n \ttype FooStatus struct{ \t // Represents the observations of a foo's current state. \t // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" \t // +patchMergeKey=type \t // +patchStrategy=merge \t // +listType=map \t // +listMapKey=type \t Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n \t // other fields \t}"
21892328
properties:
21902329
lastTransitionTime:
21912330
description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
@@ -2237,6 +2376,8 @@ spec:
22372376
datafilesPatched:
22382377
default: "false"
22392378
type: string
2379+
dgBrokerConfigured:
2380+
type: boolean
22402381
edition:
22412382
type: string
22422383
flashBack:
@@ -2293,6 +2434,8 @@ spec:
22932434
type: object
22942435
prebuiltDB:
22952436
type: boolean
2437+
primaryDatabase:
2438+
type: string
22962439
releaseUpdate:
22972440
type: string
22982441
replicas:
@@ -2636,6 +2779,32 @@ rules:
26362779
- get
26372780
- patch
26382781
- update
2782+
- apiGroups:
2783+
- database.oracle.com
2784+
resources:
2785+
- dataguardbrokers
2786+
verbs:
2787+
- create
2788+
- delete
2789+
- get
2790+
- list
2791+
- patch
2792+
- update
2793+
- watch
2794+
- apiGroups:
2795+
- database.oracle.com
2796+
resources:
2797+
- dataguardbrokers/finalizers
2798+
verbs:
2799+
- update
2800+
- apiGroups:
2801+
- database.oracle.com
2802+
resources:
2803+
- dataguardbrokers/status
2804+
verbs:
2805+
- get
2806+
- patch
2807+
- update
26392808
- apiGroups:
26402809
- database.oracle.com
26412810
resources:
@@ -2965,6 +3134,27 @@ webhooks:
29653134
resources:
29663135
- cdbs
29673136
sideEffects: None
3137+
- admissionReviewVersions:
3138+
- v1
3139+
- v1beta1
3140+
clientConfig:
3141+
service:
3142+
name: oracle-database-operator-webhook-service
3143+
namespace: oracle-database-operator-system
3144+
path: /mutate-database-oracle-com-v1alpha1-dataguardbroker
3145+
failurePolicy: Fail
3146+
name: mdataguardbroker.kb.io
3147+
rules:
3148+
- apiGroups:
3149+
- database.oracle.com
3150+
apiVersions:
3151+
- v1alpha1
3152+
operations:
3153+
- CREATE
3154+
- UPDATE
3155+
resources:
3156+
- dataguardbrokers
3157+
sideEffects: None
29683158
- admissionReviewVersions:
29693159
- v1
29703160
- v1beta1
@@ -3137,6 +3327,27 @@ webhooks:
31373327
resources:
31383328
- cdbs
31393329
sideEffects: None
3330+
- admissionReviewVersions:
3331+
- v1
3332+
- v1beta1
3333+
clientConfig:
3334+
service:
3335+
name: oracle-database-operator-webhook-service
3336+
namespace: oracle-database-operator-system
3337+
path: /validate-database-oracle-com-v1alpha1-dataguardbroker
3338+
failurePolicy: Fail
3339+
name: vdataguardbroker.kb.io
3340+
rules:
3341+
- apiGroups:
3342+
- database.oracle.com
3343+
apiVersions:
3344+
- v1alpha1
3345+
operations:
3346+
- CREATE
3347+
- UPDATE
3348+
resources:
3349+
- dataguardbrokers
3350+
sideEffects: None
31403351
- admissionReviewVersions:
31413352
- v1
31423353
- v1beta1
@@ -3224,7 +3435,7 @@ spec:
32243435
- --enable-leader-election
32253436
command:
32263437
- /manager
3227-
image: container-registry.oracle.com/database/operator:0.2.1
3438+
image: container-registry.oracle.com/database/operator:1.0.0
32283439
imagePullPolicy: Always
32293440
name: manager
32303441
ports:
@@ -3248,4 +3459,4 @@ spec:
32483459
secret:
32493460
defaultMode: 420
32503461
secretName: webhook-server-cert
3251-
---
3462+
---

0 commit comments

Comments
 (0)