Skip to content

Commit b565a4e

Browse files
committed
Merge remote-tracking branch 'origin/develop' into domain-sample-cleanup
2 parents a4ea565 + 94694d9 commit b565a4e

File tree

79 files changed

+740
-1326
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+740
-1326
lines changed

integration-tests/src/test/java/oracle/kubernetes/operator/utils/Operator.java

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -209,30 +209,7 @@ private void callHelmInstall() throws Exception {
209209
}
210210

211211
private void reportHelmInstallFailure(String cmd, ExecResult result) throws Exception {
212-
String cause = getExecFailure(cmd, result);
213-
if (result.stderr().contains("Error: Job failed: BackoffLimitExceeded")) {
214-
// The operator helm chart pre-install hook probably failed.
215-
// This is probably because there is a problem with the values passed in,
216-
// for example a listed domain namespace does not exist.
217-
// Fetch the pre-install hook's results and return it too.
218-
String hookResults = getOperatorHelmChartHookResults("pre-install");
219-
cause = cause + "\n pre-install-hook returned\n" + hookResults;
220-
}
221-
throw new RuntimeException(cause);
222-
}
223-
224-
private String getOperatorHelmChartHookResults(String hookType) throws Exception {
225-
String cmd =
226-
"kubectl logs job/"
227-
+ operatorMap.get("releaseName")
228-
+ "-weblogic-operator-"
229-
+ hookType
230-
+ "-hook -n kube-system";
231-
ExecResult result = ExecCommand.exec(cmd);
232-
if (result.exitValue() != 0) {
233-
return getExecFailure(cmd, result);
234-
}
235-
return result.stdout();
212+
throw new RuntimeException(getExecFailure(cmd, result));
236213
}
237214

238215
private String getExecFailure(String cmd, ExecResult result) throws Exception {

kubernetes/charts/weblogic-operator/templates/_operator-verification-hook.tpl

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

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@
3333
{{- $ignore := include "utils.verifyInteger" (list $scope "elasticSearchPort") -}}
3434
{{- end -}}
3535
{{- end -}}
36-
{{- $ignore := include "utils.verifyString" (list $scope "tillerNamespace") -}}
37-
{{- $ignore := include "utils.verifyString" (list $scope "tillerServiceAccount") -}}
3836
{{- $ignore := include "utils.verifyOptionalBoolean" (list $scope "mockWLS") -}}
3937
{{- $ignore:= include "utils.endValidation" $scope -}}
40-
{{- include "operator.operatorVerificationHook" (list $scope "pre-upgrade") }}
41-
{{- include "operator.operatorVerificationHook" (list $scope "pre-install") }}
4238
{{- end -}}

kubernetes/charts/weblogic-operator/values.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,3 @@ elasticSearchHost: "elasticsearch.default.svc.cluster.local"
9696

9797
# elasticSearchPort specifies the port number of where elasticsearch is running
9898
elasticSearchPort: 9200
99-
100-
# tillerNamespace is the name of the namespace that tiller is configured to use.
101-
tillerNamespace: "kube-system"
102-
103-
# tillerServiceAccount is the name of the service account that tiller is configured to use.
104-
tillerServiceAccount: "default"

kubernetes/samples/scripts/create-weblogic-domain/domain-home-in-image/create-domain.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -301,11 +301,6 @@ function createFiles {
301301
echo Generating ${domainPropertiesOutput}
302302

303303
cp ${domainPropertiesInput} ${domainPropertiesOutput}
304-
sed -i -e "s:%DOMAIN_NAME%:${domainName}:g" ${domainPropertiesOutput}
305-
sed -i -e "s:%ADMIN_PORT%:${adminPort}:g" ${domainPropertiesOutput}
306-
sed -i -e "s:%ADMIN_SERVER_NAME%:${adminServerName}:g" ${domainPropertiesOutput}
307-
sed -i -e "s:%MANAGED_SERVER_PORT%:${managedServerPort}:g" ${domainPropertiesOutput}
308-
sed -i -e "s:%MANAGED_SERVER_NAME_BASE%:${managedServerNameBase}:g" ${domainPropertiesOutput}
309304
sed -i -e "s:%CONFIGURED_MANAGED_SERVER_COUNT%:${configuredManagedServerCount}:g" ${domainPropertiesOutput}
310305
sed -i -e "s:%CLUSTER_NAME%:${clusterName}:g" ${domainPropertiesOutput}
311306
sed -i -e "s:%PRODUCTION_MODE_ENABLED%:${productionModeEnabled}:g" ${domainPropertiesOutput}

kubernetes/samples/scripts/create-weblogic-domain/domain-home-in-image/domain-template.yaml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,7 @@ metadata:
1111
labels:
1212
weblogic.resourceVersion: domain-v2
1313
weblogic.domainUID: %DOMAIN_UID%
14-
weblogic.domainName: %DOMAIN_NAME%
1514
spec:
16-
# The domainUID must be unique across the entire Kubernetes Cluster. Each WebLogic Domain must
17-
# have its own unique domainUID. This does not have to be the same as the Domain Name. It is allowed
18-
# to have multiple Domains with the same Domain Name, but they MUST have different domainUID's.
19-
# The domainUID is also used to identify the Persistent Volume that belongs to/with this Domain.
20-
domainUID: %DOMAIN_UID%
21-
# The WebLogic Domain Name
22-
domainName: %DOMAIN_NAME%
2315
# The WebLogic Domain Home
2416
domainHome: %DOMAIN_HOME%
2517
# If the domain home is in the image
@@ -32,10 +24,6 @@ spec:
3224
# how to create that Secret at the end of this file)
3325
adminSecret:
3426
name: %WEBLOGIC_CREDENTIALS_SECRET_NAME%
35-
# The name of the Admin Server
36-
asName: "%ADMIN_SERVER_NAME%"
37-
# The Admin Server's ListenPort
38-
asPort: %ADMIN_PORT%
3927
# Whether to include the server out file into the pod's stdout, default is true
4028
includeServerOutInPodLog: %INCLUDE_SERVER_OUT_IN_POD_LOG%
4129
# serverStartPolicy legal values are "NEVER", "ALWAYS", "IF_NEEDED", or "ADMIN_ONLY"
@@ -52,9 +40,9 @@ spec:
5240
value: "-Xms64m -Xmx256m "
5341
# adminServer is used to configure the desired behavior for starting the administration server.
5442
adminServer:
55-
# serverStartState legal values are "RUNNING" or "ADMIN"
56-
# "RUNNING" means the listed server will be started up to "RUNNING" mode
57-
# "ADMIN" means the listed server will be start up to "ADMIN" mode
43+
# serverStartState legal values are "RUNNING" or "ADMIN"
44+
# "RUNNING" means the listed server will be started up to "RUNNING" mode
45+
# "ADMIN" means the listed server will be start up to "ADMIN" mode
5846
serverStartState: "RUNNING"
5947
# The Admin Server's NodePort
6048
%EXPOSE_ADMIN_PORT_PREFIX%nodePort: %ADMIN_NODE_PORT%

kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/create-domain.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -390,13 +390,10 @@ function createYamlFiles {
390390
sed -i -e "s:%WEBLOGIC_CREDENTIALS_SECRET_NAME%:${weblogicCredentialsSecretName}:g" ${dcrOutput}
391391
sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%:${imagePullSecretPrefix}:g" ${dcrOutput}
392392
sed -i -e "s:%DOMAIN_UID%:${domainUID}:g" ${dcrOutput}
393-
sed -i -e "s:%DOMAIN_NAME%:${domainName}:g" ${dcrOutput}
394393
sed -i -e "s:%DOMAIN_HOME%:${domainHome}:g" ${dcrOutput}
395-
sed -i -e "s:%ADMIN_SERVER_NAME%:${adminServerName}:g" ${dcrOutput}
396394
sed -i -e "s:%WEBLOGIC_IMAGE%:${image}:g" ${dcrOutput}
397395
sed -i -e "s:%WEBLOGIC_IMAGE_PULL_POLICY%:${imagePullPolicy}:g" ${dcrOutput}
398396
sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_NAME%:${imagePullSecretName}:g" ${dcrOutput}
399-
sed -i -e "s:%ADMIN_PORT%:${adminPort}:g" ${dcrOutput}
400397
sed -i -e "s:%INITIAL_MANAGED_SERVER_REPLICAS%:${initialManagedServerReplicas}:g" ${dcrOutput}
401398
sed -i -e "s:%EXPOSE_T3_CHANNEL_PREFIX%:${exposeAdminT3ChannelPrefix}:g" ${dcrOutput}
402399
sed -i -e "s:%CLUSTER_NAME%:${clusterName}:g" ${dcrOutput}

kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/domain-template.yaml

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,7 @@ metadata:
1212
labels:
1313
weblogic.resourceVersion: domain-v2
1414
weblogic.domainUID: %DOMAIN_UID%
15-
weblogic.domainName: %DOMAIN_NAME%
1615
spec:
17-
# The domainUID must be unique across the entire Kubernetes Cluster. Each WebLogic Domain must
18-
# have its own unique domainUID. This does not have to be the same as the Domain Name. It is allowed
19-
# to have multiple Domains with the same Domain Name, but they MUST have different domainUID's.
20-
# The domainUID is also used to identify the Persistent Volume that belongs to/with this Domain.
21-
domainUID: %DOMAIN_UID%
22-
# The WebLogic Domain Name
23-
domainName: %DOMAIN_NAME%
2416
# The WebLogic Domain Home
2517
domainHome: %DOMAIN_HOME%
2618
# If the domain home is in the image
@@ -36,10 +28,6 @@ spec:
3628
# how to create that Secret at the end of this file)
3729
adminSecret:
3830
name: %WEBLOGIC_CREDENTIALS_SECRET_NAME%
39-
# The name of the Admin Server
40-
asName: "%ADMIN_SERVER_NAME%"
41-
# The Admin Server's ListenPort
42-
asPort: %ADMIN_PORT%
4331
# Whether to include the server out file into the pod's stdout, default is true
4432
includeServerOutInPodLog: %INCLUDE_SERVER_OUT_IN_POD_LOG%
4533
# The in-pod name of the directory to store the domain, node manager, server logs, and server .out
@@ -61,9 +49,10 @@ spec:
6149
value: "-Xms64m -Xmx256m "
6250
# adminServer is used to configure the desired behavior for starting the administration server.
6351
adminServer:
64-
# serverStartState legal values are "RUNNING" or "ADMIN"
65-
# "RUNNING" means the listed server will be started up to "RUNNING" mode
66-
# "ADMIN" means the listed server will be start up to "ADMIN" mode
52+
# serverStartState legal values are "RUNNING" or "ADMIN"
53+
# "RUNNING" means the listed server will be started up to "RUNNING" mode
54+
# "ADMIN" means the listed server will be start up to "ADMIN" mode
55+
serverStartState: "RUNNING"
6756
# The Admin Server's NodePort
6857
%EXPOSE_ADMIN_PORT_PREFIX%nodePort: %ADMIN_NODE_PORT%
6958
# Uncomment to export the T3Channel as a service

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

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
import io.kubernetes.client.models.ExtensionsV1beta1Deployment;
1515
import io.kubernetes.client.models.V1Container;
16-
import io.kubernetes.client.models.V1Job;
1716
import io.kubernetes.client.models.V1Service;
1817
import oracle.kubernetes.operator.utils.OperatorYamlFactory;
1918

@@ -51,18 +50,6 @@ protected V1Service getExpectedExternalWeblogicOperatorService() {
5150
return getExpectedExternalWeblogicOperatorService(true, true);
5251
}
5352

54-
@Override
55-
protected V1Job getExpectedWeblogicOperatorHookJob(String hookType) {
56-
V1Job expected = super.getExpectedWeblogicOperatorHookJob(hookType);
57-
expected
58-
.getSpec()
59-
.getTemplate()
60-
.getSpec()
61-
.addImagePullSecretsItem(
62-
newLocalObjectReference().name(getInputs().getWeblogicOperatorImagePullSecretName()));
63-
return expected;
64-
}
65-
6653
@Override
6754
public ExtensionsV1beta1Deployment getExpectedWeblogicOperatorDeployment() {
6855
ExtensionsV1beta1Deployment expected = super.getExpectedWeblogicOperatorDeployment();

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

Lines changed: 0 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
import static oracle.kubernetes.operator.utils.KubernetesArtifactUtils.newEnvVar;
2222
import static oracle.kubernetes.operator.utils.KubernetesArtifactUtils.newEnvVarSource;
2323
import static oracle.kubernetes.operator.utils.KubernetesArtifactUtils.newExecAction;
24-
import static oracle.kubernetes.operator.utils.KubernetesArtifactUtils.newJob;
25-
import static oracle.kubernetes.operator.utils.KubernetesArtifactUtils.newJobSpec;
2624
import static oracle.kubernetes.operator.utils.KubernetesArtifactUtils.newNamespace;
2725
import static oracle.kubernetes.operator.utils.KubernetesArtifactUtils.newObjectFieldSelector;
2826
import static oracle.kubernetes.operator.utils.KubernetesArtifactUtils.newObjectMeta;
@@ -50,8 +48,6 @@
5048
import io.kubernetes.client.models.V1ClusterRole;
5149
import io.kubernetes.client.models.V1ClusterRoleBinding;
5250
import io.kubernetes.client.models.V1ConfigMap;
53-
import io.kubernetes.client.models.V1Container;
54-
import io.kubernetes.client.models.V1Job;
5551
import io.kubernetes.client.models.V1Namespace;
5652
import io.kubernetes.client.models.V1Role;
5753
import io.kubernetes.client.models.V1RoleBinding;
@@ -92,79 +88,6 @@ protected static void setup(OperatorYamlFactory factory, OperatorValues val) thr
9288
generatedFiles = factory.generate(val);
9389
}
9490

95-
@Test
96-
public void generatesCorrect_operatorPreInstallHookJob() {
97-
assertThat(
98-
getActualWeblogicOperatorPreInstallHookJob(),
99-
yamlEqualTo(getExpectedWeblogicOperatorPreInstallHookJob()));
100-
}
101-
102-
private V1Job getActualWeblogicOperatorPreInstallHookJob() {
103-
return getGeneratedFiles().getOperatorPreInstallHookJob();
104-
}
105-
106-
protected V1Job getExpectedWeblogicOperatorPreInstallHookJob() {
107-
return getExpectedWeblogicOperatorHookJob("pre-install");
108-
}
109-
110-
@Test
111-
public void generatesCorrect_operatorPreUpgradeHookJob() {
112-
assertThat(
113-
getActualWeblogicOperatorPreUpgradeHookJob(),
114-
yamlEqualTo(getExpectedWeblogicOperatorPreUpgradeHookJob()));
115-
}
116-
117-
private V1Job getActualWeblogicOperatorPreUpgradeHookJob() {
118-
return getGeneratedFiles().getOperatorPreUpgradeHookJob();
119-
}
120-
121-
protected V1Job getExpectedWeblogicOperatorPreUpgradeHookJob() {
122-
return getExpectedWeblogicOperatorHookJob("pre-upgrade");
123-
}
124-
125-
protected V1Job getExpectedWeblogicOperatorHookJob(String hookType) {
126-
V1Job job =
127-
newJob()
128-
.metadata(
129-
newObjectMeta()
130-
.name(OPERATOR_RELEASE + "-weblogic-operator-" + hookType + "-hook")
131-
.namespace(getInputs().getTillerNamespace())
132-
.putLabelsItem(RESOURCE_VERSION_LABEL, OPERATOR_V2)
133-
.putLabelsItem(OPERATORNAME_LABEL, getInputs().getNamespace())
134-
.putAnnotationsItem("helm.sh/hook", hookType)
135-
.putAnnotationsItem(
136-
"helm.sh/hook-delete-policy", "before-hook-creation,hook-succeeded"))
137-
.spec(
138-
newJobSpec()
139-
.backoffLimit(0)
140-
.template(
141-
newPodTemplateSpec()
142-
.metadata(
143-
newObjectMeta()
144-
.putLabelsItem(RESOURCE_VERSION_LABEL, OPERATOR_V2)
145-
.putLabelsItem(OPERATORNAME_LABEL, getInputs().getNamespace()))
146-
.spec(
147-
newPodSpec()
148-
.restartPolicy("Never")
149-
.serviceAccount(getInputs().getTillerServiceAccount())
150-
.addContainersItem(
151-
newContainer()
152-
.name("weblogic-operator")
153-
.image(getInputs().getWeblogicOperatorImage())
154-
.imagePullPolicy(
155-
getInputs().getWeblogicOperatorImagePullPolicy())
156-
.addCommandItem(
157-
"/operator/operator-helm-verification-hook.sh")
158-
.addCommandItem(hookType)
159-
.addCommandItem(getInputs().getNamespace())
160-
.addCommandItem(getInputs().getServiceAccount())))));
161-
V1Container container = job.getSpec().getTemplate().getSpec().getContainers().get(0);
162-
for (String targetNamespace : getInputs().getTargetNamespaces().split(",")) {
163-
container.addCommandItem(targetNamespace);
164-
}
165-
return job;
166-
}
167-
16891
@Test
16992
public void generatesCorrect_operatorConfigMap() {
17093
assertThat(

0 commit comments

Comments
 (0)