File tree Expand file tree Collapse file tree 5 files changed +52
-1
lines changed
java/oracle/kubernetes/weblogic/domain/v2
resources/oracle/kubernetes/weblogic/domain/v2 Expand file tree Collapse file tree 5 files changed +52
-1
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ public void whenExportedAccessPointsAreTheSame_objectsAreEqual() {
33
33
.addAnnotation ("annotation1" , "value2" )
34
34
.addLabel ("label1" , "value1" );
35
35
36
- assertThat (server1 , equalTo (server1 ));
36
+ assertThat (server1 , equalTo (server2 ));
37
37
}
38
38
39
39
@ Test
@@ -59,4 +59,16 @@ public void whenExportedAccessPointsDifferByAnnotation_objectsAreNotEqual() {
59
59
60
60
assertThat (server1 , not (equalTo (server2 )));
61
61
}
62
+
63
+ @ Test
64
+ public void nodePortTests () {
65
+ server1 .addNodePortAnnotations ("key" , "value" );
66
+ assertThat (server1 , not (equalTo (server2 )));
67
+ server2 .addNodePortAnnotations ("key" , "value" );
68
+ assertThat (server1 , equalTo (server2 ));
69
+ server1 .addNodePortLabels ("key" , "value" );
70
+ assertThat (server1 .hashCode (), not (equalTo (server2 .hashCode ())));
71
+ server2 .addNodePortLabels ("key" , "value" );
72
+ assertThat (server1 .hashCode (), equalTo (server2 .hashCode ()));
73
+ }
62
74
}
Original file line number Diff line number Diff line change @@ -84,4 +84,16 @@ public void whenServerStartPoliciesDiffer_objectsAreNotEqual() {
84
84
private V1EnvVar env (String name , String value ) {
85
85
return new V1EnvVar ().name (name ).value (value );
86
86
}
87
+
88
+ @ Test
89
+ public void serviceLabelAndAnnotation () {
90
+ instance1 .addServiceLabels ("key" , "value" );
91
+ assertThat (instance1 , not (equalTo (instance2 )));
92
+ instance2 .addServiceLabels ("key" , "value" );
93
+ assertThat (instance1 , equalTo (instance2 ));
94
+ instance1 .addServiceAnnotations ("key" , "value" );
95
+ assertThat (instance1 .hashCode (), not (equalTo (instance2 .hashCode ())));
96
+ instance2 .addServiceAnnotations ("key" , "value" );
97
+ assertThat (instance1 .hashCode (), equalTo (instance2 .hashCode ()));
98
+ }
87
99
}
Original file line number Diff line number Diff line change @@ -1104,6 +1104,13 @@ public void whenDomain2ReadFromYaml_AdminServerInheritPodSecurityContextFromDoma
1104
1104
assertThat (asPodSecCtx .getRunAsUser (), nullValue ());
1105
1105
}
1106
1106
1107
+ @ Test
1108
+ public void whenDomain2ReadFromYaml_serviceLabelsAndAnnotations () throws IOException {
1109
+ Domain domain = readDomain (DOMAIN_V2_SAMPLE_YAML_2 );
1110
+ ServerSpec serverSpec = domain .getServer ("server2" , "cluster1" );
1111
+ assertThat (serverSpec .getServiceAnnotations (), hasEntry ("e" , "f" ));
1112
+ }
1113
+
1107
1114
@ Test
1108
1115
public void whenDomain3ReadFromYaml_PredefinedStorageDefinesClaimName () throws IOException {
1109
1116
Domain domain = readDomain (DOMAIN_V2_SAMPLE_YAML_3 );
@@ -1139,6 +1146,14 @@ public void whenDomain3ReadFromYaml_adminServerHasNodeSelector() throws IOExcept
1139
1146
assertThat (domain .getAdminServerSpec ().getNodeSelectors (), hasEntry ("os" , "linux" ));
1140
1147
}
1141
1148
1149
+ @ Test
1150
+ public void whenDomain3ReadFromYaml_adminServerHasAnnotationsAndLabels () throws IOException {
1151
+ Domain domain = readDomain (DOMAIN_V2_SAMPLE_YAML_3 );
1152
+ assertThat (domain .getAdminServerSpec ().getServiceAnnotations (), hasEntry ("e" , "f" ));
1153
+ assertThat (domain .getAdminServerSpec ().getServiceLabels (), hasEntry ("a" , "b" ));
1154
+ assertThat (domain .getAdminServerSpec ().getServiceLabels (), hasEntry ("c" , "d" ));
1155
+ }
1156
+
1142
1157
@ Test
1143
1158
public void whenVolumesConfiguredOnMultipleLevels_useCombination () {
1144
1159
configureDomain (domain )
Original file line number Diff line number Diff line change 77
77
periodSeconds : 20
78
78
nodeSelector :
79
79
os : linux
80
+ serviceLabels :
81
+ a : b
82
+ c : d
80
83
podSecurityContext :
81
84
runAsGroup : 421
82
85
runAsNonRoot : true
@@ -107,6 +110,9 @@ spec:
107
110
periodSeconds : 18
108
111
nodeSelector :
109
112
os_type : oel7
113
+ serviceAnnotations :
114
+ a : b
115
+ e : f
110
116
podSecurityContext :
111
117
runAsGroup : 422
112
118
seLinuxOptions :
Original file line number Diff line number Diff line change 32
32
serverPod :
33
33
nodeSelector :
34
34
os : linux
35
+ serviceLabels :
36
+ a : b
37
+ c : d
38
+ serviceAnnotations :
39
+ e : f
40
+ longer : shorter
35
41
36
42
domainName : base_domain
37
43
# The domainUID must be unique across the entire Kubernetes Cluster. Each WebLogic Domain must
You can’t perform that action at this time.
0 commit comments