@@ -28,17 +28,17 @@ const (
2828 CollaSetUpdate CollaSetConditionType = "Update"
2929)
3030
31- // PodNamingPolicy is a string enumeration that determaines how pod name will be generated.
31+ // ReplicaNamingPolicy is a string enumeration that determaines how pod name will be generated.
3232// A collaset pod name contains two parts to be placed in a string formation %s-%s; the prefix
33- // is name of collaset, and the suffix is determined by PodNamingPolicy .
34- type PodNamingPolicy string
33+ // is name of collaset, and the suffix is determined by ReplicaNamingPolicy .
34+ type ReplicaNamingPolicy string
3535
3636const (
37- // PodNamingPolicyPersistentSequence uses persistent sequential numbers as pod name suffix.
38- PodNamingPolicyPersistentSequence PodNamingPolicy = "PersistentSequence"
39- // PodNamingPolicyDefault uses random strings which are provided by Kubernetes as pod name suffix.
37+ // ReplicaNamingPolicyPersistentSequence uses persistent sequential numbers as pod name suffix.
38+ ReplicaNamingPolicyPersistentSequence ReplicaNamingPolicy = "PersistentSequence"
39+ // ReplicaNamingPolicyDefault uses random strings which are provided by Kubernetes as pod name suffix.
4040 // This is defaulting value.
41- PodNamingPolicyDefault PodNamingPolicy = "Default"
41+ ReplicaNamingPolicyDefault ReplicaNamingPolicy = "Default"
4242)
4343
4444// PersistentVolumeClaimRetentionPolicyType is a string enumeration of the policies that will determine
@@ -120,6 +120,10 @@ type CollaSetSpec struct {
120120 // +optional
121121 ScaleStrategy ScaleStrategy `json:"scaleStrategy,omitempty"`
122122
123+ // NamigPolicy indicates the strategy detail that will be used for replica naming
124+ // +optional
125+ NamingPolicy NamingPolicy `json:"namimgPolicy,omitempty"`
126+
123127 // Indicate the number of histories to be conserved
124128 // If unspecified, defaults to 20
125129 // +optional
@@ -133,9 +137,6 @@ type ScaleStrategy struct {
133137 // +optional
134138 Context string `json:"context,omitempty"`
135139
136- // PodNamingPolicy indicates how a new pod name is generated.
137- PodNamingPolicy PodNamingPolicy `json:"podNamingPolicy,omitempty"`
138-
139140 // PodToExclude indicates the pods which will be orphaned by CollaSet.
140141 // +optional
141142 PodToExclude []string `json:"podToExclude,omitempty"`
@@ -160,6 +161,11 @@ type ScaleStrategy struct {
160161 OperationDelaySeconds * int32 `json:"operationDelaySeconds,omitempty"`
161162}
162163
164+ type NamingPolicy struct {
165+ // ReplicaNamingPolicy indicates how a new pod name is generated.
166+ ReplicaNamingPolicy ReplicaNamingPolicy `json:"replicaNamingPolicy,omitempty"`
167+ }
168+
163169type PersistentVolumeClaimRetentionPolicy struct {
164170 // WhenDeleted specifies what happens to PVCs created from CollaSet
165171 // VolumeClaimTemplates when the CollaSet is deleted. The default policy
0 commit comments