You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// ImageSelectorTerms is a list of or image selector terms. The terms are ORed.
48
-
// +kubebuilder:validation:XValidation:message="expected at least one, got none, ['tags', 'id', 'name', 'alias']",rule="self.all(x, has(x.tags) || has(x.id) || has(x.name) || has(x.alias))"
49
-
// +kubebuilder:validation:XValidation:message="'id' is mutually exclusive, cannot be set with a combination of other fields in imageSelectorTerms",rule="!self.exists(x, has(x.id) && (has(x.alias) || has(x.tags) || has(x.name) || has(x.owner)))"
50
-
// +kubebuilder:validation:XValidation:message="'alias' is mutually exclusive, cannot be set with a combination of other fields in imageSelectorTerms",rule="!self.exists(x, has(x.alias) && (has(x.id) || has(x.tags) || has(x.name) || has(x.owner)))"
46
+
// +kubebuilder:validation:XValidation:message="expected at least one, got none, ['id', 'alias']",rule="self.all(x, has(x.id) || has(x.alias))"
47
+
// +kubebuilder:validation:XValidation:message="'id' is mutually exclusive, cannot be set with a combination of other fields in imageSelectorTerms",rule="!self.exists(x, has(x.id) && (has(x.alias)))"
48
+
// +kubebuilder:validation:XValidation:message="'alias' is mutually exclusive, cannot be set with a combination of other fields in imageSelectorTerms",rule="!self.exists(x, has(x.alias) && (has(x.id)))"
51
49
// +kubebuilder:validation:XValidation:message="'alias' is mutually exclusive, cannot be set with a combination of other imageSelectorTerms",rule="!(self.exists(x, has(x.alias)) && self.size() != 1)"
52
50
// +kubebuilder:validation:MinItems:=1
53
51
// +kubebuilder:validation:MaxItems:=30
@@ -117,31 +115,17 @@ type SecurityGroupSelectorTerm struct {
117
115
typeImageSelectorTermstruct {
118
116
// Alias specifies which ACK image to select.
119
117
// Each alias consists of a family and an image version, specified as "family@version".
// Currently only supports version pinning to the latest image release, with that images version format (ex: "aliyun3@latest").
122
120
// Setting the version to latest will result in drift when a new Image is released. This is **not** recommended for production environments.
123
-
// +kubebuilder:validation:XValidation:message="'alias' is improperly formatted, must match the format 'family@version'",rule="self.matches('^[a-zA-Z0-9]*@.*$')"
124
-
// +kubebuilder:validation:XValidation:message="family is not supported, must be one of the following: 'aliyun3'",rule="self.find('^[^@]+') in ['aliyun3']"
121
+
// +kubebuilder:validation:XValidation:message="'alias' is improperly formatted, must match the format 'family'",rule="self.matches('^[a-zA-Z0-9]*$')"
122
+
// +kubebuilder:validation:XValidation:message="family is not supported, must be one of the following: 'AlibabaCloudLinux3,AlibabaCloudLinux2'",rule="self.find('^[^@]+') in ['AlibabaCloudLinux3', 'AlibabaCloudLinux2']"
125
123
// +kubebuilder:validation:MaxLength=30
126
124
// +optional
127
125
Aliasstring`json:"alias,omitempty"`
128
-
// Tags is a map of key/value tags used to select vswitches
129
-
// Specifying '*' for a value selects all values for a given tag key.
130
-
// +kubebuilder:validation:XValidation:message="empty tag keys aren't supported",rule="self.all(k, k != '')"
131
-
// +kubebuilder:validation:MaxProperties:=20
132
-
// +optional
133
-
Tagsmap[string]string`json:"tags,omitempty"`
134
126
// ID is the image id in ECS
135
127
// +optional
136
128
IDstring`json:"id,omitempty"`
137
-
// Name is the image name in ECS.
138
-
// This value is the name field, which is different from the name tag.
139
-
// +optional
140
-
Namestring`json:"name,omitempty"`
141
-
// Owner is the image source.
142
-
// Default is system | self | public. If specified, only one of the following: "self", "system", "share", "public", and "marketplace"
143
-
// +optional
144
-
Ownerstring`json:"owner,omitempty"`
145
129
}
146
130
147
131
// KubeletConfiguration defines args to be used when configuring kubelet on provisioned nodes.
@@ -298,25 +282,5 @@ type ECSNodeClassList struct {
298
282
}
299
283
300
284
funcImageFamilyFromAlias(aliasstring) string {
301
-
components:=strings.Split(alias, "@")
302
-
iflen(components) !=2 {
303
-
log.Fatalf("failed to parse image alias %q, invalid format", alias)
304
-
}
305
-
family, ok:=lo.Find([]string{
306
-
ImageFamilyAliyun3,
307
-
}, func(familystring) bool {
308
-
returnstrings.ToLower(family) ==components[0]
309
-
})
310
-
if!ok {
311
-
log.Fatalf("%q is an invalid alias family", components[0])
312
-
}
313
-
returnfamily
314
-
}
315
-
316
-
funcImageVersionFromAlias(aliasstring) string {
317
-
components:=strings.Split(alias, "@")
318
-
iflen(components) !=2 {
319
-
log.Fatalf("failed to parse image alias %q, invalid format", alias)
0 commit comments