Skip to content

Commit 12aad7b

Browse files
committed
Rename setupKubernetesCluster to createSharedOperatorResources, fix list input validation, fix a domainsNamespaces that was still expecting it to be a map, instead of a string array
1 parent 8509c6c commit 12aad7b

File tree

7 files changed

+18
-20
lines changed

7 files changed

+18
-20
lines changed

kubernetes/charts/weblogic-operator/templates/_inputs-utils.tpl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ Verify that a list input value has been specified
6464
{{- if not (hasKey $status "error") -}}
6565
true
6666
{{- end -}}
67-
{{- else -}}
68-
{{- $errorMsg := cat "The" $requiredKind "property" $name "must be specified." -}}
69-
{{- include "operator.recordValidationError" (list $scope $errorMsg) -}}
7067
{{- end -}}
7168
{{- end -}}
7269

kubernetes/charts/weblogic-operator/templates/_kubernetes-cluster.tpl renamed to kubernetes/charts/weblogic-operator/templates/_shared-operator-resources.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright 2018 Oracle Corporation and/or its affiliates. All rights reserved.
22
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
33

4-
{{- define "operator.kubernetesCluster" -}}
4+
{{- define "operator.sharedOperatorResources" -}}
55
{{- include "operator.elasticSearchDeployment" . }}
66
{{- include "operator.elasticSearchService" . }}
77
{{- include "operator.kibanaDeployment" . }}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
{{- define "operator.validateInputs" -}}
55
{{- $scope := . -}}
6-
{{- if include "operator.verifyBooleanInput" (list $scope $scope "setupKubernetesCluster") -}}
7-
{{- if $scope.setupKubernetesCluster }}
6+
{{- if include "operator.verifyBooleanInput" (list $scope $scope "createSharedOperatorResources") -}}
7+
{{- if $scope.createSharedOperatorResources }}
88
{{- $ignore := include "operator.verifyBooleanInput" (list $scope $scope "elkIntegrationEnabled") -}}
99
{{- end }}
1010
{{- end }}

kubernetes/charts/weblogic-operator/templates/main.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
{{- $ignore := set $scope "Files" .Files -}}
88
{{- $ignore := set $scope "Chart" .Chart -}}
99

10-
{{- if .Values.setupKubernetesCluster }}
11-
{{ include "operator.kubernetesCluster" $scope }}
10+
{{- if .Values.createSharedOperatorResources }}
11+
{{ include "operator.sharedOperatorResources" $scope }}
1212
{{- end }}
1313

1414
{{- if .Values.createOperator }}

kubernetes/charts/weblogic-operator/values.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# Copyright 2018 Oracle Corporation and/or its affiliates. All rights reserved.
22
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
33

4-
# setupKubernetesCluster specifies whether or not the installation should deploy Kubernetes components
5-
# such as elasticsearch, kibana, operator RBAC roles, etc.
6-
setupKubernetesCluster: true
4+
# createSharedOperatorResources specifies whether or not the installation should create the
5+
# Kubernetes resources that are shared by all operators in this Kubernetes cluster such as
6+
# elasticsearch, kibana, operator RBAC roles, etc.
7+
createSharedOperatorResources: true
78

89
# createOperator specifies whether or not the installation should create the operator and its resources.
910
createOperator: true
@@ -29,7 +30,7 @@ operatorServiceAccount: "weblogic-operator"
2930
# domainsNamespaces:
3031
# - namespace1
3132
# - namespace2
32-
domainsNamespaces: {}
33+
domainsNamespaces: []
3334

3435
# operatorImage specifies the docker image containing the operator code.
3536
operatorImage: "weblogic-kubernetes-operator:1.0"

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class CreateOperatorInputsValidationIT extends ChartITBase {
2121
private static final String WRONG_TYPE = "The %s property %s must be a %s instead";
2222

2323
private static final String[] TOP_LEVEL_BOOLEAN_PROPERTIES = {
24-
"setupKubernetesCluster", "createOperator" // , "elkIntegrationEnabled"
24+
"createSharedOperatorResources", "createOperator" // , "elkIntegrationEnabled"
2525
};
2626

2727
private static final String[] OPERATOR_LEVEL_BOOLEAN_PROPERTIES = {"elkIntegrationEnabled"};
@@ -321,6 +321,6 @@ public void whenRemoteDebugNodePortDisabled_reportNonNumericPortNumbers() throws
321321
public void whenDomainsNamespacesPrimitiveType_reportError() throws Exception {
322322
setProperty("domainsNamespaces", true);
323323

324-
assertThat(getProcessingError(), containsTypeError("domainsNamespaces", "map", "bool"));
324+
assertThat(getProcessingError(), containsTypeError("domainsNamespaces", "slice", "bool"));
325325
}
326326
}

src/integration-tests/bash/run.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ function create_image_pull_secret_wercker {
653653

654654
}
655655

656-
# op_define OP_KEY NAMESPACE TARGET_NAMESPACES EXTERNAL_REST_HTTPSPORT SETUP_KUBERNETES_CLUSTER
656+
# op_define OP_KEY NAMESPACE TARGET_NAMESPACES EXTERNAL_REST_HTTPSPORT CREATE_SHARED_OPERATOR_RESOURCES
657657
# sets up table of operator values.
658658
#
659659
# op_get OP_KEY
@@ -671,13 +671,13 @@ function create_image_pull_secret_wercker {
671671

672672
function op_define {
673673
if [ "$#" != 5 ] ; then
674-
fail "requires 5 parameters: OP_KEY NAMESPACE TARGET_NAMESPACES EXTERNAL_REST_HTTPSPORT SETUP_KUBERNETES_CLUSTER"
674+
fail "requires 5 parameters: OP_KEY NAMESPACE TARGET_NAMESPACES EXTERNAL_REST_HTTPSPORT CREATE_SHARED_OPERATOR_RESOURCES"
675675
fi
676676
local opkey="`echo \"${1?}\" | sed 's/-/_/g'`"
677677
eval export OP_${opkey}_NAMESPACE="$2"
678678
eval export OP_${opkey}_TARGET_NAMESPACES="$3"
679679
eval export OP_${opkey}_EXTERNAL_REST_HTTPSPORT="$4"
680-
eval export OP_${opkey}_SETUP_KUBERNETES_CLUSTER="$5"
680+
eval export OP_${opkey}_CREATE_SHARED_OPERATOR_RESOURCES="$5"
681681

682682
# generated TMP_DIR for operator = $USER_PROJECTS_DIR/weblogic-operators/$NAMESPACE :
683683
eval export OP_${opkey}_TMP_DIR="$USER_PROJECTS_DIR/weblogic-operators/$2"
@@ -745,13 +745,13 @@ function deploy_operator {
745745
mkdir -p $TMP_DIR
746746
if [ "$USE_HELM" = "true" ]; then
747747
local inputs="$TMP_DIR/weblogic-operator-values.yaml"
748-
local SETUP_KUBERNETES_CLUSTER="`op_get $opkey SETUP_KUBERNETES_CLUSTER`"
748+
local CREATE_SHARED_OPERATOR_RESOURCES="`op_get $opkey CREATE_SHARED_OPERATOR_RESOURCES`"
749749

750750
# generate certificates
751751
$PROJECT_ROOT/kubernetes/generate-internal-weblogic-operator-certificate.sh > $inputs
752752
$PROJECT_ROOT/kubernetes/generate-external-weblogic-operator-certificate.sh DNS:${NODEPORT_HOST} >> $inputs
753753

754-
echo "setupKubernetesCluster: $SETUP_KUBERNETES_CLUSTER" >> $inputs
754+
echo "createSharedOperatorResources: $CREATE_SHARED_OPERATOR_RESOURCES" >> $inputs
755755

756756
trace 'customize the inputs yaml file to add test namespace'
757757
echo "domainsNamespaces:" >> $inputs
@@ -2998,7 +2998,7 @@ function test_suite {
29982998

29992999
declare_new_test 1 define_operators_and_domains
30003000

3001-
# OP_KEY NAMESPACE TARGET_NAMESPACES EXTERNAL_REST_HTTPSPORT SETUP_KUBERNETES_CLUSTER
3001+
# OP_KEY NAMESPACE TARGET_NAMESPACES EXTERNAL_REST_HTTPSPORT CREATE_SHARED_OPERATOR_RESOURCES
30023002
op_define oper1 weblogic-operator-1 "default,test1" 31001 true
30033003
op_define oper2 weblogic-operator-2 test2 32001 false
30043004

0 commit comments

Comments
 (0)