Skip to content

Commit fa6f938

Browse files
authored
OWLS-103643 - Changes to the quick start sample cluster resource name to follow the best practice and cluster-name validation. (#3562)
1 parent 5965990 commit fa6f938

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

documentation/domains/Cluster.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,10 @@
200200
"description": "Changes to this field cause the operator to restart WebLogic Server instances. More info: https://oracle.github.io/weblogic-kubernetes-operator/userguide/managing-domains/domain-lifecycle/startup/#restarting-servers.",
201201
"type": "string"
202202
}
203-
}
203+
},
204+
"required": [
205+
"clusterName"
206+
]
204207
},
205208
"ClusterStatus": {
206209
"type": "object",

kubernetes/crd/cluster-crd.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ apiVersion: apiextensions.k8s.io/v1
55
kind: CustomResourceDefinition
66
metadata:
77
annotations:
8-
weblogic.sha256: 70bafec24ec0f378000f5916e91ad27c6aa400bdff77526f4dee9be54898eea2
8+
weblogic.sha256: 3c1dd670396edaa66773c2de84ea6d50a05f4618c2515d1005dc2c4029790d17
99
name: clusters.weblogic.oracle
1010
spec:
1111
group: weblogic.oracle
@@ -2913,6 +2913,8 @@ spec:
29132913
description: 'Changes to this field cause the operator to restart
29142914
WebLogic Server instances. More info: https://oracle.github.io/weblogic-kubernetes-operator/userguide/managing-domains/domain-lifecycle/startup/#restarting-servers.'
29152915
type: string
2916+
required:
2917+
- clusterName
29162918
type: object
29172919
status:
29182920
properties:

kubernetes/samples/quick-start/domain-resource.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ spec:
114114

115115
# The desired behavior for starting a specific cluster's member servers
116116
clusters:
117-
- name: cluster-1
117+
- name: sample-domain1-cluster-1
118118

119119
# Change the restartVersion to force the introspector job to rerun
120120
# and apply any new model configuration, to also force a subsequent
@@ -135,7 +135,7 @@ spec:
135135
apiVersion: "weblogic.oracle/v1"
136136
kind: Cluster
137137
metadata:
138-
name: cluster-1
138+
name: sample-domain1-cluster-1
139139
# Update this with the namespace your domain will run in:
140140
namespace: sample-domain1-ns
141141
labels:
@@ -144,3 +144,4 @@ metadata:
144144

145145
spec:
146146
replicas: 2
147+
clusterName: cluster-1

operator/src/main/java/oracle/kubernetes/weblogic/domain/model/ClusterSpec.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import org.apache.commons.lang3.builder.EqualsBuilder;
1717
import org.apache.commons.lang3.builder.HashCodeBuilder;
1818
import org.apache.commons.lang3.builder.ToStringBuilder;
19-
import org.jetbrains.annotations.NotNull;
2019

2120
/**
2221
* An element representing a cluster in the domain configuration.
@@ -28,7 +27,7 @@ public class ClusterSpec extends BaseConfiguration implements Comparable<Cluster
2827
/** The name of the cluster. Required. */
2928
@Description("The name of the cluster. This value must match the name of a WebLogic cluster already defined "
3029
+ "in the WebLogic domain configuration. Required.")
31-
@NotNull
30+
@Nonnull
3231
private String clusterName;
3332

3433
/** The number of replicas to run in the cluster, if specified. */

0 commit comments

Comments
 (0)