Skip to content

Commit 4052f6b

Browse files
committed
refactor naming policy api
1 parent f7808db commit 4052f6b

File tree

3 files changed

+21
-22
lines changed

3 files changed

+21
-22
lines changed

apps/v1alpha1/collaset_types.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ const (
2828
CollaSetUpdate CollaSetConditionType = "Update"
2929
)
3030

31-
// ReplicaNamingPolicy is a string enumeration that determaines how pod name will be generated.
31+
// PodNamingPolicy 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 ReplicaNamingPolicy.
34-
type ReplicaNamingPolicy string
33+
// is name of collaset, and the suffix is determined by PodNamingPolicy.
34+
type PodNamingPolicy string
3535

3636
const (
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.
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.
4040
// This is defaulting value.
41-
ReplicaNamingPolicyDefault ReplicaNamingPolicy = "Default"
41+
PodNamingPolicyDefault PodNamingPolicy = "Default"
4242
)
4343

4444
// PersistentVolumeClaimRetentionPolicyType is a string enumeration of the policies that will determine
@@ -122,7 +122,7 @@ type CollaSetSpec struct {
122122

123123
// NamigPolicy indicates the strategy detail that will be used for replica naming
124124
// +optional
125-
NamingPolicy *NamingPolicy `json:"namimgPolicy,omitempty"`
125+
NamingStrategy *NamingStrategy `json:"namingStrategy,omitempty"`
126126

127127
// Indicate the number of histories to be conserved
128128
// If unspecified, defaults to 20
@@ -161,9 +161,9 @@ type ScaleStrategy struct {
161161
OperationDelaySeconds *int32 `json:"operationDelaySeconds,omitempty"`
162162
}
163163

164-
type NamingPolicy struct {
165-
// ReplicaNamingPolicy indicates how a new pod name is generated.
166-
ReplicaNamingPolicy ReplicaNamingPolicy `json:"replicaNamingPolicy,omitempty"`
164+
type NamingStrategy struct {
165+
// PodNamingPolicy indicates how a new pod name is generated.
166+
PodNamingPolicy PodNamingPolicy `json:"podNamingPolicy,omitempty"`
167167
}
168168

169169
type PersistentVolumeClaimRetentionPolicy struct {

apps/v1alpha1/zz_generated.deepcopy.go

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/apps/apps.kusionstack.io_collasets.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,12 @@ spec:
8383
If unspecified, defaults to 20
8484
format: int32
8585
type: integer
86-
namimgPolicy:
86+
namingStrategy:
8787
description: NamigPolicy indicates the strategy detail that will be
8888
used for replica naming
8989
properties:
90-
replicaNamingPolicy:
91-
description: ReplicaNamingPolicy indicates how a new pod name
92-
is generated.
90+
podNamingPolicy:
91+
description: PodNamingPolicy indicates how a new pod name is generated.
9392
type: string
9493
type: object
9594
paused:

0 commit comments

Comments
 (0)