Skip to content

Commit 312691e

Browse files
committed
OWLS-67479 Rework the 2.0 operator helm chart to never create the domains namespace
1 parent a4ebef0 commit 312691e

File tree

6 files changed

+6
-80
lines changed

6 files changed

+6
-80
lines changed

kubernetes/charts/weblogic-operator/templates/_domains-namespaces.tpl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
{{- range $key, $element := $domainsNamespaces -}}
1212
{{- $args := merge (dict) $element $scope -}}
1313
{{- $ignore := set $args "domainsNamespace" $key -}}
14-
{{- include "operator.domainsNamespace" $args -}}
1514
{{- /* include "operator.domainConfigMap" $args currently the GA operator runtime does this */ -}}
1615
{{- include "operator.operatorRoleBinding" $args -}}
1716
{{- end }}

kubernetes/charts/weblogic-operator/templates/_domains-ns.tpl

Lines changed: 0 additions & 15 deletions
This file was deleted.

kubernetes/charts/weblogic-operator/templates/_validate-inputs.tpl

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,7 @@
5252
{{- if include "operator.verifyObjectInput" (list $scope $scope "domainsNamespaces") -}}
5353
{{- $domainsNamespaces := $scope.domainsNamespaces -}}
5454
{{- range $key, $element := $domainsNamespaces -}}
55-
{{- if include "operator.verifyObjectInput" (list $scope $domainsNamespaces $key) -}}
56-
{{- $s := merge (dict) $element $scope -}}
57-
{{- if include "operator.verifyBooleanInput" (list $scope $s "createDomainsNamespace") -}}
58-
{{- if eq $key "default" -}}
59-
{{- if $s.createDomainsNamespace -}}
60-
{{- $errorMsg := cat "The effective createDomainsNamespace value for the 'default' domainsNamespace must be set to false." -}}
61-
{{- $ignore := include "operator.recordValidationError" (list $scope $errorMsg) -}}
62-
{{- end -}}
63-
{{- end -}}
64-
{{- end -}}
65-
{{- end -}}
55+
{{- $ignore := include "operator.verifyObjectInput" (list $scope $domainsNamespaces $key) -}}
6656
{{- end -}}
6757
{{- end -}}
6858
{{- end -}}

kubernetes/charts/weblogic-operator/values.yaml

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,31 +19,16 @@ operatorNamespace: "weblogic-operator"
1919
# The name must be lowercase
2020
operatorServiceAccount: "weblogic-operator"
2121

22-
# createDomainsNamespace is a global variable that specifies whether or not the helm installation should create the Kubernetes
23-
# namespaces for the domains specified in domainsNamespaces.
24-
createDomainsNamespace: true
25-
26-
# domainsNamespaces specifies a map of WebLogic Domain namespaces which the operator manages (same as targetNamespaces but in map format)
27-
# The names must be lowercase
22+
# domainsNamespaces specifies a dictionary of WebLogic Domain namespaces which the operator manages (same as targetNamespaces but in dictionary format)
23+
# The names must be lowercase. The values must be empty dictionaries.
24+
# The customer is responsible for creating these namespaces.
2825
#
29-
# Example 1: In the configuration below, the helm installation will create the Domain namespace 'namespace2' but not 'namespace1'.
26+
# Example : In the configuration below, the helm installation will manage namespace1 and namespace2.
3027
#
3128
# createDomainsNamespace: true
3229
# domainsNamespaces:
33-
# namespace1:
34-
# createDomainsNamespace: false
35-
# namespace2: {}
36-
#
37-
#-----------------------------------
38-
#
39-
# Example 2: In the configuration below, the helm installation will create the Domain namespace 'namespace2' but not 'namespace1'.
40-
#
41-
# createDomainsNamespace: false
42-
# domainsNamespaces:
4330
# namespace1: {}
44-
# namespace2:
45-
# createDomainsNamespace: true
46-
#
31+
# namespace2: {}
4732
domainsNamespaces: {}
4833

4934
# operatorImage specifies the docker image containing the operator code.

kubernetes/src/test/java/oracle/kubernetes/operator/helm/CreateOperatorInputsValidationIT.java

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import static org.hamcrest.Matchers.containsString;
1111
import static org.hamcrest.Matchers.emptyString;
1212

13-
import com.google.common.collect.ImmutableMap;
1413
import java.util.Map;
1514
import org.hamcrest.Matcher;
1615
import org.junit.Before;
@@ -324,35 +323,4 @@ public void whenDomainsNamespacesPrimitiveType_reportError() throws Exception {
324323

325324
assertThat(getProcessingError(), containsTypeError("domainsNamespaces", "map", "bool"));
326325
}
327-
328-
@Test
329-
public void whenDomainsNamespacesCreateNotBool_reportError() throws Exception {
330-
setProperty(
331-
"domainsNamespaces",
332-
ImmutableMap.of("aaa", ImmutableMap.of("createDomainsNamespace", 123)));
333-
334-
assertThat(
335-
getProcessingError(), containsTypeError("createDomainsNamespace", "bool", "float64"));
336-
}
337-
338-
@Test
339-
public void whenDefaultNamespaceHasCreatedTrue_reportError() throws Exception {
340-
setProperty(
341-
"domainsNamespaces",
342-
ImmutableMap.of("default", ImmutableMap.of("createDomainsNamespace", true)));
343-
344-
assertThat(
345-
getProcessingError(),
346-
containsString(
347-
"The effective createDomainsNamespace value for the 'default' domainsNamespace must be set to false."));
348-
}
349-
350-
@Test
351-
public void whenDefaultNamespaceHasCreatedFalse_doNotReportError() throws Exception {
352-
setProperty(
353-
"domainsNamespaces",
354-
ImmutableMap.of("default", ImmutableMap.of("createDomainsNamespace", false)));
355-
356-
assertThat(getProcessingError(), emptyString());
357-
}
358326
}

src/integration-tests/bash/run.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,6 @@ function deploy_operator {
754754
echo "setupKubernetesCluster: $SETUP_KUBERNETES_CLUSTER" >> $inputs
755755

756756
trace 'customize the inputs yaml file to add test namespace'
757-
echo "createDomainsNamespace: false" >> $inputs
758757
echo "domainsNamespaces:" >> $inputs
759758
for i in $(echo $TARGET_NAMESPACES | sed "s/,/ /g")
760759
do

0 commit comments

Comments
 (0)