Skip to content

Commit 5a9adf3

Browse files
committed
Catch up to standarized-names
2 parents e6c5c9e + 6dfd67c commit 5a9adf3

9 files changed

+95
-101
lines changed

kubernetes/create-weblogic-operator-inputs.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,57 +17,57 @@ namespace: weblogic-operator
1717
targetNamespaces: default
1818

1919
# The docker image containing the operator code.
20-
image: container-registry.oracle.com/middleware/weblogic-kubernetes-operator:latest
20+
weblogicOperatorImage: container-registry.oracle.com/middleware/weblogic-kubernetes-operator:latest
2121

2222
# The image pull policy for the operator docker image.
23-
imagePullPolicy: IfNotPresent
23+
weblogicOperatorImagePullPolicy: IfNotPresent
2424

2525
# Name of the Kubernetes secret to access the registry containing the operator Docker image
2626
# The presence of the secret will be validated when this parameter is enabled.
27-
#imagePullSecretName:
27+
#weblogicOperatorImagePullSecretName:
2828

2929
# Options for externally exposing the operator REST https interface
3030
# (i.e. outside of the Kubernetes cluster). Valid values are:
3131
#
32-
# "none"
32+
# "NONE"
3333
# The REST interface is not exposed outside the Kubernetes cluster.
3434
#
35-
# "self-signed-cert"
35+
# "SELF_SIGNED_CERT"
3636
# The REST interface is exposed outside of the Kubernetes cluster on the
3737
# port specified by the 'externalRestHttpsPort' property.
3838
# A self-signed certificate and private key are generated for the REST interface.
3939
# The certificate's subject alternative names are specified by the 'externalSans'
4040
# property.
4141
#
42-
# "custom-cert"
42+
# "CUSTOM_CERT"
4343
# The REST interface is exposed outside of the Kubernetes cluster on the
4444
# port specified by the 'externalRestHttpsPort' property.
4545
# The customer supplied certificate and private key are used for the REST
4646
# interface. They are specified by the 'externalOperatorCert' and
4747
# 'eternalOperatorKey' properties.
48-
externalRestOption: none
48+
externalRestOption: NONE
4949

5050
# The node port that should be allocated for the external operator REST https interface.
51-
# This parameter is required if 'externalRestOption' is not 'none'.
51+
# This parameter is required if 'externalRestOption' is not 'NONE'.
5252
# Otherwise, it is ignored.
5353
externalRestHttpsPort: 31001
5454

5555
# The subject alternative names to put into the generated self-signed certificate
5656
# for the external WebLogic Operator REST https interface, for example:
5757
# DNS:myhost,DNS:localhost,IP:127.0.0.1
58-
# This parameter is required if 'externalRestOption' is 'self-signed-cert'.
58+
# This parameter is required if 'externalRestOption' is 'SELF_SIGNED_CERT'.
5959
# Otherwise, it is ignored.
6060
externalSans:
6161

6262
# The customer supplied certificate to use for the external operator REST
6363
# https interface. The value must be a string containing a base64 encoded PEM certificate.
64-
# This parameter is required if 'externalRestOption' is 'custom-cert'.
64+
# This parameter is required if 'externalRestOption' is 'CUSTOM_CERT'.
6565
# Otherwise, it is ignored.
6666
externalOperatorCert:
6767

6868
# The customer supplied private key to use for the external operator REST
6969
# https interface. The value must be a string containing a base64 encoded PEM key.
70-
# This parameter is required if 'externalRestOption' is 'custom-cert'.
70+
# This parameter is required if 'externalRestOption' is 'CUSTOM_CERT'.
7171
# Otherwise, it is ignored.
7272
externalOperatorKey:
7373

kubernetes/internal/create-weblogic-operator.sh

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ function initialize {
117117
# Parse the common inputs file
118118
parseCommonInputs
119119

120-
validateInputParamsSpecified serviceAccount namespace targetNamespaces image
120+
validateInputParamsSpecified serviceAccount namespace targetNamespaces weblogicOperatorImage
121121

122122
validateBooleanInputParamsSpecified elkIntegrationEnabled
123123

@@ -161,13 +161,13 @@ function initAndValidateOutputDir {
161161
# Function to validate the image pull secret name
162162
#
163163
function validateImagePullSecretName {
164-
if [ ! -z "${imagePullSecretName}" ]; then
165-
validateLowerCase imagePullSecretName ${imagePullSecretName}
164+
if [ ! -z "${weblogicOperatorImagePullSecretName}" ]; then
165+
validateLowerCase weblogicOperatorImagePullSecretName ${weblogicOperatorImagePullSecretName}
166166
imagePullSecretPrefix=""
167167
validateImagePullSecret
168168
else
169169
# Set name blank when not specified, and comment out the yaml
170-
imagePullSecretName=""
170+
weblogicOperatorImagePullSecretName=""
171171
imagePullSecretPrefix="#"
172172
fi
173173
}
@@ -178,7 +178,7 @@ function validateImagePullSecretName {
178178
function validateImagePullSecret {
179179
# The kubernetes secret for pulling images from the docker store is optional.
180180
# If it was specified, make sure it exists.
181-
validateSecretExists ${imagePullSecretName} ${namespace}
181+
validateSecretExists ${weblogicOperatorImagePullSecretName} ${namespace}
182182
failIfValidationErrors
183183
}
184184

@@ -188,17 +188,17 @@ function validateImagePullSecret {
188188
function validateImagePullPolicy {
189189

190190
# Validate that imagePullPolicy was specified
191-
validateInputParamsSpecified imagePullPolicy
191+
validateInputParamsSpecified weblogicOperatorImagePullPolicy
192192

193193
# And validate that it's one of the allowed logging levels
194-
if [ ! -z "${imagePullPolicy}" ]; then
194+
if [ ! -z "${weblogicOperatorImagePullPolicy}" ]; then
195195
IF_NOT_PRESENT="IfNotPresent"
196196
ALWAYS="Always"
197197
NEVER="Never"
198-
if [ $imagePullPolicy != $IF_NOT_PRESENT ] && \
199-
[ $imagePullPolicy != $ALWAYS ] && \
200-
[ $imagePullPolicy != $NEVER ]; then
201-
validationError "Invalid imagePullPolicy: \"${imagePullPolicy}\". Valid values are $IF_NOT_PRESENT, $ALWAYS and $NEVER."
198+
if [ $weblogicOperatorImagePullPolicy != $IF_NOT_PRESENT ] && \
199+
[ $weblogicOperatorImagePullPolicy != $ALWAYS ] && \
200+
[ $weblogicOperatorImagePullPolicy != $NEVER ]; then
201+
validationError "Invalid weblogicOperatorImagePullPolicy: \"${weblogicOperatorImagePullPolicy}\". Valid values are $IF_NOT_PRESENT, $ALWAYS and $NEVER."
202202
fi
203203
fi
204204
}
@@ -270,9 +270,9 @@ function validateExternalRest {
270270

271271
if [ ! -z ${externalRestOption} ]; then
272272
# Validate the specified externalRestOption value and any sub options that it requires
273-
EXT_REST_OPT_NONE="none"
274-
EXT_REST_OPT_SELF_SIGNED="self-signed-cert"
275-
EXT_REST_OPT_CUSTOM="custom-cert"
273+
EXT_REST_OPT_NONE="NONE"
274+
EXT_REST_OPT_SELF_SIGNED="SELF_SIGNED_CERT"
275+
EXT_REST_OPT_CUSTOM="CUSTOM_CERT"
276276
case ${externalRestOption} in
277277
${EXT_REST_OPT_NONE})
278278
echo The WebLogic Operator REST interface will not be externally exposed
@@ -389,9 +389,9 @@ function createYamlFiles {
389389
sed -i -e "s|%NAMESPACE%|$namespace|g" ${oprOutput}
390390
sed -i -e "s|%TARGET_NAMESPACES%|$targetNamespaces|g" ${oprOutput}
391391
sed -i -e "s|%ACCOUNT_NAME%|$serviceAccount|g" ${oprOutput}
392-
sed -i -e "s|%IMAGE%|$image|g" ${oprOutput}
393-
sed -i -e "s|%IMAGE_PULL_POLICY%|$imagePullPolicy|g" ${oprOutput}
394-
sed -i -e "s|%DOCKER_REGISTRY_SECRET%|${imagePullSecretName}|g" ${oprOutput}
392+
sed -i -e "s|%IMAGE%|$weblogicOperatorImage|g" ${oprOutput}
393+
sed -i -e "s|%IMAGE_PULL_POLICY%|$weblogicOperatorImagePullPolicy|g" ${oprOutput}
394+
sed -i -e "s|%DOCKER_REGISTRY_SECRET%|${weblogicOperatorImagePullSecretName}|g" ${oprOutput}
395395
sed -i -e "s|%IMAGE_PULL_SECRET_PREFIX%|${imagePullSecretPrefix}|g" ${oprOutput}
396396
sed -i -e "s|%EXTERNAL_OPERATOR_SERVICE_PREFIX%|$externalOperatorServicePrefix|g" ${oprOutput}
397397
sed -i -e "s|%EXTERNAL_REST_HTTPS_PORT%|$externalRestHttpsPort|g" ${oprOutput}

site/installation.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ The following parameters must be provided in the input file:
7070

7171
| Parameter | Definition | Default |
7272
| --- | --- | --- |
73-
| externalOperatorCert | A base64 encoded string containing the X.509 certificate that the operator will present to clients accessing its REST endpoints. This value is only used when `externalRestOption` is set to `custom-cert`. | |
74-
| externalOperatorKey | A base64 encoded string containing the private key **ask tom** This value is only used when externalRestOption is set to `custom-cert`. | |
75-
| externalRestOption | Which of the available REST options is desired. Allowed values: <br/>- `none` Disable the REST interface. <br/>- `self-signed-cert` The operator will use a self-signed certificate for its REST server. If this value is specified, then the `externalSans` parameter must also be set. <br/>- `custom-cert` Provide custom certificates, for example from an external certification authority. If this value is specified, then the `externalOperatorCert` and `externalOperatorKey` must also be provided. | none |
73+
| externalOperatorCert | A base64 encoded string containing the X.509 certificate that the operator will present to clients accessing its REST endpoints. This value is only used when `externalRestOption` is set to `CUSTOM_CERT`. | |
74+
| externalOperatorKey | A base64 encoded string containing the private key **ask tom** This value is only used when externalRestOption is set to `CUSTOM_CERT`. | |
75+
| externalRestOption | Which of the available REST options is desired. Allowed values: <br/>- `NONE` Disable the REST interface. <br/>- `SELF_SIGNED_CERT` The operator will use a self-signed certificate for its REST server. If this value is specified, then the `externalSans` parameter must also be set. <br/>- `CUSTOM_CERT` Provide custom certificates, for example from an external certification authority. If this value is specified, then the `externalOperatorCert` and `externalOperatorKey` must also be provided. | none |
7676
| externalSans | A comma-separated list of Subject Alternative Names that should be included in the X.509 Certificate. This list should include ... <br/>Example: `DNS:myhost,DNS:localhost,IP:127.0.0.1` | |
7777
| namespace | The Kubernetes namespace that the operator will be deployed in. It is recommended that a namespace be created for the operator rather than using the `default` namespace. | weblogic-operator |
7878
| targetNamespaces | A list of the Kubernetes namespaces that may contain WebLogic domains that the operator will manage. The operator will not take any action against a domain that is in a namespace not listed here. | default |
@@ -88,9 +88,9 @@ The following parameters must be provided in the input file:
8888

8989
The operator provides three REST certificate options:
9090

91-
* `none` will disable the REST server.
92-
* `self-signed-cert` will generate self-signed certificates.
93-
* `custom-cert` provides a mechanism to provide certificates that were created and signed by some other means.
91+
* `NONE` will disable the REST server.
92+
* `SELF_SIGNED_CERT` will generate self-signed certificates.
93+
* `CUSTOM_CERT` provides a mechanism to provide certificates that were created and signed by some other means.
9494

9595
## Decide which options to enable
9696

src/integration-tests/bash/run.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -557,13 +557,13 @@ function deploy_operator {
557557
cp $PROJECT_ROOT/kubernetes/create-weblogic-operator-inputs.yaml $inputs
558558

559559
trace 'customize the inputs yaml file to use our pre-built docker image'
560-
sed -i -e "s|\(imagePullPolicy:\).*|\1${IMAGE_PULL_POLICY_OPERATOR}|g" $inputs
561-
sed -i -e "s|\(image:\).*|\1${IMAGE_NAME_OPERATOR}:${IMAGE_TAG_OPERATOR}|g" $inputs
560+
sed -i -e "s|\(weblogicOperatorImagePullPolicy:\).*|\1${IMAGE_PULL_POLICY_OPERATOR}|g" $inputs
561+
sed -i -e "s|\(weblogicOperatorImage:\).*|\1${IMAGE_NAME_OPERATOR}:${IMAGE_TAG_OPERATOR}|g" $inputs
562562
if [ -n "${IMAGE_PULL_SECRET_OPERATOR}" ]; then
563-
sed -i -e "s|#imagePullSecretName:.*|imagePullSecretName: ${IMAGE_PULL_SECRET_OPERATOR}|g" $inputs
563+
sed -i -e "s|#weblogicOperatorImagePullSecretName:.*|weblogicOperatorImagePullSecretName: ${IMAGE_PULL_SECRET_OPERATOR}|g" $inputs
564564
fi
565565
trace 'customize the inputs yaml file to generate a self-signed cert for the external Operator REST https port'
566-
sed -i -e "s|\(externalRestOption:\).*|\1self-signed-cert|g" $inputs
566+
sed -i -e "s|\(externalRestOption:\).*|\1SELF_SIGNED_CERT|g" $inputs
567567
sed -i -e "s|\(externalSans:\).*|\1DNS:${NODEPORT_HOST}|g" $inputs
568568
trace 'customize the inputs yaml file to set the java logging level to FINER'
569569
sed -i -e "s|\(javaLoggingLevel:\).*|\1FINER|g" $inputs
@@ -2307,10 +2307,10 @@ function test_create_domain_on_exist_dir {
23072307
trace "check domain directory exists"
23082308
local tmp_dir="$TMP_DIR"
23092309
local inputs="$tmp_dir/create-weblogic-domain-inputs.yaml"
2310-
local persistence_path=`egrep 'persistencePath' $inputs | awk '{print $2}'`
2310+
local domain_storage_path=`egrep 'weblogicDomainStoragePath' $inputs | awk '{print $2}'`
23112311
local domain_name=`egrep 'domainName' $inputs | awk '{print $2}'`
23122312

2313-
local domain_dir=${persistence_path}"/domain/"${domain_name}
2313+
local domain_dir=${domain_storage_path}"/domain/"${domain_name}
23142314
if [ ! -d ${domain_dir} ] ; then
23152315
fail "ERROR: the domain directory ${domain_dir} does not exist, exiting!"
23162316
fi

src/test/java/oracle/kubernetes/operator/create/CreateOperatorGeneratedFilesBaseTest.java

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,18 @@
11
// Copyright 2018, Oracle Corporation and/or its affiliates. All rights reserved.
22
package oracle.kubernetes.operator.create;
33

4-
import static java.util.Arrays.asList;
4+
import io.kubernetes.client.models.*;
5+
import org.apache.commons.codec.binary.Base64;
6+
import org.junit.AfterClass;
7+
import org.junit.Test;
58

6-
import io.kubernetes.client.models.ExtensionsV1beta1Deployment;
7-
import io.kubernetes.client.models.V1beta1ClusterRole;
8-
import io.kubernetes.client.models.V1beta1ClusterRoleBinding;
9-
import io.kubernetes.client.models.V1beta1RoleBinding;
10-
import io.kubernetes.client.models.V1ConfigMap;
11-
import io.kubernetes.client.models.V1Namespace;
12-
import io.kubernetes.client.models.V1Secret;
13-
import io.kubernetes.client.models.V1Service;
14-
import io.kubernetes.client.models.V1ServiceAccount;
15-
import io.kubernetes.client.models.V1ServiceSpec;
9+
import static java.util.Arrays.asList;
1610
import static oracle.kubernetes.operator.create.CreateOperatorInputs.readInputsYamlFile;
1711
import static oracle.kubernetes.operator.create.KubernetesArtifactUtils.*;
1812
import static oracle.kubernetes.operator.create.YamlUtils.yamlEqualTo;
19-
import org.apache.commons.codec.binary.Base64;
2013
import static org.hamcrest.MatcherAssert.assertThat;
21-
import static org.hamcrest.Matchers.*;
22-
import org.junit.AfterClass;
23-
import org.junit.Test;
14+
import static org.hamcrest.Matchers.is;
15+
import static org.hamcrest.Matchers.nullValue;
2416

2517
/**
2618
* Base class for testing that the all artifacts in the yaml files that
@@ -155,8 +147,8 @@ protected ExtensionsV1beta1Deployment getExpectedWeblogicOperatorDeployment() {
155147
.serviceAccountName(getInputs().getServiceAccount())
156148
.addContainersItem(newContainer()
157149
.name("weblogic-operator")
158-
.image(getInputs().getImage())
159-
.imagePullPolicy(getInputs().getImagePullPolicy())
150+
.image(getInputs().getWeblogicOperatorImage())
151+
.imagePullPolicy(getInputs().getWeblogicOperatorImagePullPolicy())
160152
.addCommandItem("bash")
161153
.addArgsItem("/operator/operator.sh")
162154
.addEnvItem(newEnvVar()

src/test/java/oracle/kubernetes/operator/create/CreateOperatorGeneratedFilesOptionalFeaturesEnabledTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public static void setup() throws Exception {
2424
.setupExternalRestSelfSignedCert()
2525
.enableDebugging()
2626
.elkIntegrationEnabled("true")
27-
.imagePullSecretName("test-operator-image-pull-secret-name")
27+
.weblogicOperatorImagePullSecretName("test-operator-image-pull-secret-name")
2828
);
2929
}
3030

@@ -75,7 +75,7 @@ public ExtensionsV1beta1Deployment getExpectedWeblogicOperatorDeployment() {
7575
.emptyDir(newEmptyDirVolumeSource()
7676
.medium("Memory")))
7777
.addImagePullSecretsItem(newLocalObjectReference()
78-
.name(getInputs().getImagePullSecretName()));
78+
.name(getInputs().getWeblogicOperatorImagePullSecretName()));
7979
return expected;
8080
}
8181
}

src/test/java/oracle/kubernetes/operator/create/CreateOperatorInputs.java

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
// Copyright 2018, Oracle Corporation and/or its affiliates. All rights reserved.
22
package oracle.kubernetes.operator.create;
33

4-
import java.io.*;
4+
import org.apache.commons.codec.binary.Base64;
5+
6+
import java.io.Reader;
57
import java.nio.charset.Charset;
6-
import java.nio.file.Files;
78
import java.nio.file.FileSystems;
9+
import java.nio.file.Files;
810
import java.nio.file.Path;
911
import java.util.Objects;
1012

1113
import static oracle.kubernetes.operator.create.YamlUtils.newYaml;
12-
import org.apache.commons.codec.binary.Base64;
1314

1415
/**
1516
* Class that mirrors create-weblogic-operator-inputs.yaml
@@ -28,9 +29,9 @@ public class CreateOperatorInputs {
2829

2930
private static final String DEFAULT_INPUTS = "kubernetes/create-weblogic-operator-inputs.yaml";
3031

31-
public static final String EXTERNAL_REST_OPTION_NONE = "none";
32-
public static final String EXTERNAL_REST_OPTION_CUSTOM_CERT = "custom-cert";
33-
public static final String EXTERNAL_REST_OPTION_SELF_SIGNED_CERT = "self-signed-cert";
32+
public static final String EXTERNAL_REST_OPTION_NONE = "NONE";
33+
public static final String EXTERNAL_REST_OPTION_CUSTOM_CERT = "CUSTOM_CERT";
34+
public static final String EXTERNAL_REST_OPTION_SELF_SIGNED_CERT = "SELF_SIGNED_CERT";
3435

3536
public static final String JAVA_LOGGING_LEVEL_SEVERE = "SEVERE";
3637
public static final String JAVA_LOGGING_LEVEL_WARNING = "WARNING";
@@ -50,8 +51,8 @@ public static CreateOperatorInputs newInputs() throws Exception {
5051
.namespace("test-operator-namespace")
5152
.serviceAccount("test-operator-service-account")
5253
.targetNamespaces("test-target-namespace1,test-target-namespace2")
53-
.image("test-operator-image")
54-
.imagePullPolicy("Never")
54+
.weblogicOperatorImage("test-operator-image")
55+
.weblogicOperatorImagePullPolicy("Never")
5556
.javaLoggingLevel("FINEST");
5657
}
5758

@@ -160,20 +161,20 @@ private String internalSans() {
160161
public void setTargetNamespaces(String val) { targetNamespaces = convertNullToEmptyString(val); }
161162
public CreateOperatorInputs targetNamespaces(String val) { setTargetNamespaces(val); return this; }
162163

163-
private String image = "";
164-
public String getImage() { return image; }
165-
public void setImage(String val) { image = convertNullToEmptyString(val); }
166-
public CreateOperatorInputs image(String val) { setImage(val); return this; }
164+
private String weblogicOperatorImage = "";
165+
public String getWeblogicOperatorImage() { return weblogicOperatorImage; }
166+
public void setWeblogicOperatorImage(String val) { weblogicOperatorImage = convertNullToEmptyString(val); }
167+
public CreateOperatorInputs weblogicOperatorImage(String val) { setWeblogicOperatorImage(val); return this; }
167168

168-
private String imagePullPolicy = "";
169-
public String getImagePullPolicy() { return imagePullPolicy; }
170-
public void setImagePullPolicy(String val) { imagePullPolicy = convertNullToEmptyString(val); }
171-
public CreateOperatorInputs imagePullPolicy(String val) { setImagePullPolicy(val); return this; }
169+
private String weblogicOperatorImagePullPolicy = "";
170+
public String getWeblogicOperatorImagePullPolicy() { return weblogicOperatorImagePullPolicy; }
171+
public void setWeblogicOperatorImagePullPolicy(String val) { weblogicOperatorImagePullPolicy = convertNullToEmptyString(val); }
172+
public CreateOperatorInputs weblogicOperatorImagePullPolicy(String val) { setWeblogicOperatorImagePullPolicy(val); return this; }
172173

173-
private String imagePullSecretName = "";
174-
public String getImagePullSecretName() { return imagePullSecretName; }
175-
public void setImagePullSecretName(String val) { imagePullSecretName = convertNullToEmptyString(val); }
176-
public CreateOperatorInputs imagePullSecretName(String val) { setImagePullSecretName(val); return this; }
174+
private String weblogicOperatorImagePullSecretName = "";
175+
public String getWeblogicOperatorImagePullSecretName() { return weblogicOperatorImagePullSecretName; }
176+
public void setWeblogicOperatorImagePullSecretName(String val) { weblogicOperatorImagePullSecretName = convertNullToEmptyString(val); }
177+
public CreateOperatorInputs weblogicOperatorImagePullSecretName(String val) { setWeblogicOperatorImagePullSecretName(val); return this; }
177178

178179
private String externalRestOption = "";
179180
public String getExternalRestOption() { return externalRestOption; }

0 commit comments

Comments
 (0)