mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-18 13:57:38 +00:00
Use sets.List() instead of UnsortedList()
This commit is contained in:
@@ -131,7 +131,7 @@ func (mtv *discriminatorTagValidator) Docs() TagDoc {
|
||||
return TagDoc{
|
||||
Tag: mtv.TagName(),
|
||||
StabilityLevel: TagStabilityLevelAlpha,
|
||||
Scopes: mtv.ValidScopes().UnsortedList(),
|
||||
Scopes: sets.List(mtv.ValidScopes()),
|
||||
Description: "Indicates that this field is a discriminator for state-based validation.",
|
||||
Args: []TagArgDoc{{
|
||||
Name: "name",
|
||||
@@ -215,7 +215,7 @@ func (mtv *memberTagValidator) Docs() TagDoc {
|
||||
return TagDoc{
|
||||
Tag: mtv.TagName(),
|
||||
StabilityLevel: TagStabilityLevelAlpha,
|
||||
Scopes: mtv.ValidScopes().UnsortedList(),
|
||||
Scopes: sets.List(mtv.ValidScopes()),
|
||||
Description: "Indicates that this field's validation depends on a discriminator.",
|
||||
Args: []TagArgDoc{{
|
||||
Name: "", // positional
|
||||
|
||||
@@ -228,7 +228,7 @@ func (evtv eachValTagValidator) Docs() TagDoc {
|
||||
doc := TagDoc{
|
||||
Tag: evtv.TagName(),
|
||||
StabilityLevel: TagStabilityLevelAlpha,
|
||||
Scopes: evtv.ValidScopes().UnsortedList(),
|
||||
Scopes: sets.List(evtv.ValidScopes()),
|
||||
Description: "Declares a validation for each value in a map or list.",
|
||||
Payloads: []TagPayloadDoc{{
|
||||
Description: "<validation-tag>",
|
||||
@@ -310,7 +310,7 @@ func ForEachKey(_ *field.Path, t *types.Type, fn FunctionGen) (Validations, erro
|
||||
func (ektv eachKeyTagValidator) Docs() TagDoc {
|
||||
doc := TagDoc{
|
||||
Tag: ektv.TagName(),
|
||||
Scopes: ektv.ValidScopes().UnsortedList(),
|
||||
Scopes: sets.List(ektv.ValidScopes()),
|
||||
StabilityLevel: TagStabilityLevelBeta,
|
||||
Description: "Declares a validation for each value in a map or list.",
|
||||
Payloads: []TagPayloadDoc{{
|
||||
|
||||
@@ -63,7 +63,7 @@ func (eetv *enumExcludeTagValidator) Docs() TagDoc {
|
||||
return TagDoc{
|
||||
Tag: eetv.TagName(),
|
||||
StabilityLevel: TagStabilityLevelAlpha,
|
||||
Scopes: eetv.ValidScopes().UnsortedList(),
|
||||
Scopes: sets.List(eetv.ValidScopes()),
|
||||
Description: `Indicates that an constant value is not part of an enum, even if the constant's type is tagged with k8s:enum.
|
||||
May be conditionally excluded via +k8s:ifEnabled(Option)=+k8s:enumExclude or +k8s:ifDisabled(Option)=+k8s:enumExclude.
|
||||
If multiple +k8s:ifEnabled/+k8s:ifDisabled tags are used, the value is excluded if any of the exclude conditions are met.`,
|
||||
@@ -195,7 +195,7 @@ func (etv *enumTagValidator) Docs() TagDoc {
|
||||
return TagDoc{
|
||||
Tag: etv.TagName(),
|
||||
StabilityLevel: TagStabilityLevelStable,
|
||||
Scopes: etv.ValidScopes().UnsortedList(),
|
||||
Scopes: sets.List(etv.ValidScopes()),
|
||||
Description: "Indicates that a string type is an enum. All constant values of this type are considered values in the enum unless excluded using +k8s:enumExclude.",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ func (v neqTagValidator) Docs() TagDoc {
|
||||
return TagDoc{
|
||||
Tag: v.TagName(),
|
||||
StabilityLevel: TagStabilityLevelAlpha,
|
||||
Scopes: v.ValidScopes().UnsortedList(),
|
||||
Scopes: sets.List(v.ValidScopes()),
|
||||
Description: "Verifies the field's value is not equal to a specific disallowed value. Supports string, integer, and boolean types.",
|
||||
PayloadsRequired: true,
|
||||
PayloadsType: codetags.ValueTypeRaw,
|
||||
|
||||
@@ -124,7 +124,7 @@ func (ftv formatTagValidator) Docs() TagDoc {
|
||||
return TagDoc{
|
||||
Tag: ftv.TagName(),
|
||||
StabilityLevel: TagStabilityLevelStable,
|
||||
Scopes: ftv.ValidScopes().UnsortedList(),
|
||||
Scopes: sets.List(ftv.ValidScopes()),
|
||||
Description: "Indicates that a string field has a particular format.",
|
||||
Payloads: []TagPayloadDoc{{ // Keep this list alphabetized.
|
||||
Description: "k8s-extended-resource-name",
|
||||
|
||||
@@ -60,7 +60,7 @@ func (itv immutableTagValidator) Docs() TagDoc {
|
||||
return TagDoc{
|
||||
Tag: itv.TagName(),
|
||||
StabilityLevel: TagStabilityLevelBeta,
|
||||
Scopes: itv.ValidScopes().UnsortedList(),
|
||||
Scopes: sets.List(itv.ValidScopes()),
|
||||
Description: "Indicates that a field may not be updated.",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,7 +250,7 @@ func (itv itemTagValidator) Docs() TagDoc {
|
||||
doc := TagDoc{
|
||||
Tag: itv.TagName(),
|
||||
StabilityLevel: TagStabilityLevelStable,
|
||||
Scopes: itv.ValidScopes().UnsortedList(),
|
||||
Scopes: sets.List(itv.ValidScopes()),
|
||||
Description: "Declares a validation for an item of a slice declared as a +k8s:listType=map. " +
|
||||
"The item to match is declared by providing field-value pair arguments. All key fields must be specified.",
|
||||
Usage: "+k8s:item(stringKey: \"value\", intKey: 42, boolKey: true)=<validation-tag>",
|
||||
|
||||
@@ -99,7 +99,7 @@ func (ltv *levelTagValidator) Docs() TagDoc {
|
||||
doc := TagDoc{
|
||||
Tag: ltv.TagName(),
|
||||
StabilityLevel: TagStabilityLevelBeta,
|
||||
Scopes: ltv.ValidScopes().UnsortedList(),
|
||||
Scopes: sets.List(ltv.ValidScopes()),
|
||||
Description: fmt.Sprintf("Marks the given payload validation as a %s validation of the handwritten validation code. An optional Kubernetes version can be specified.", ltv.level),
|
||||
Args: []TagArgDoc{{
|
||||
Description: "The Kubernetes version (e.g. `1.34`) at which this validation was added.",
|
||||
|
||||
@@ -195,7 +195,7 @@ func (mitv minItemsTagValidator) Docs() TagDoc {
|
||||
return TagDoc{
|
||||
Tag: mitv.TagName(),
|
||||
StabilityLevel: TagStabilityLevelBeta,
|
||||
Scopes: mitv.ValidScopes().UnsortedList(),
|
||||
Scopes: sets.List(mitv.ValidScopes()),
|
||||
Description: "Indicates that a list has a minimum size.",
|
||||
Payloads: []TagPayloadDoc{{
|
||||
Description: "<non-negative integer>",
|
||||
@@ -251,7 +251,7 @@ func (mitv maxItemsTagValidator) Docs() TagDoc {
|
||||
return TagDoc{
|
||||
Tag: mitv.TagName(),
|
||||
StabilityLevel: TagStabilityLevelStable,
|
||||
Scopes: mitv.ValidScopes().UnsortedList(),
|
||||
Scopes: sets.List(mitv.ValidScopes()),
|
||||
Description: "Indicates that a list has a limit on its size.",
|
||||
Payloads: []TagPayloadDoc{{
|
||||
Description: "<non-negative integer>",
|
||||
@@ -303,7 +303,7 @@ func (mtv minimumTagValidator) Docs() TagDoc {
|
||||
return TagDoc{
|
||||
Tag: mtv.TagName(),
|
||||
StabilityLevel: TagStabilityLevelStable,
|
||||
Scopes: mtv.ValidScopes().UnsortedList(),
|
||||
Scopes: sets.List(mtv.ValidScopes()),
|
||||
Description: "Indicates that a numeric field has a minimum value.",
|
||||
Payloads: []TagPayloadDoc{{
|
||||
Description: "<integer>",
|
||||
@@ -355,7 +355,7 @@ func (mtv maximumTagValidator) Docs() TagDoc {
|
||||
return TagDoc{
|
||||
Tag: mtv.TagName(),
|
||||
StabilityLevel: TagStabilityLevelBeta,
|
||||
Scopes: mtv.ValidScopes().UnsortedList(),
|
||||
Scopes: sets.List(mtv.ValidScopes()),
|
||||
Description: "Indicates that a numeric field has a maximum value.",
|
||||
Payloads: []TagPayloadDoc{{
|
||||
Description: "<integer>",
|
||||
|
||||
@@ -185,7 +185,7 @@ func (lttv listTypeTagValidator) Docs() TagDoc {
|
||||
doc := TagDoc{
|
||||
Tag: lttv.TagName(),
|
||||
StabilityLevel: TagStabilityLevelStable,
|
||||
Scopes: lttv.ValidScopes().UnsortedList(),
|
||||
Scopes: sets.List(lttv.ValidScopes()),
|
||||
Description: "Declares a list field's semantic type and ownership behavior. atomic: single ownership, set: shared ownership with uniqueness, map: shared ownership with key-based uniqueness.",
|
||||
Payloads: []TagPayloadDoc{{
|
||||
Description: "<type>",
|
||||
@@ -253,7 +253,7 @@ func (lmktv listMapKeyTagValidator) Docs() TagDoc {
|
||||
doc := TagDoc{
|
||||
Tag: lmktv.TagName(),
|
||||
StabilityLevel: TagStabilityLevelStable,
|
||||
Scopes: lmktv.ValidScopes().UnsortedList(),
|
||||
Scopes: sets.List(lmktv.ValidScopes()),
|
||||
Description: "Declares a named sub-field of a list's value-type to be part of the list-map key.",
|
||||
Payloads: []TagPayloadDoc{{
|
||||
Description: "<field-json-name>",
|
||||
@@ -324,7 +324,7 @@ func (utv uniqueTagValidator) Docs() TagDoc {
|
||||
doc := TagDoc{
|
||||
Tag: utv.TagName(),
|
||||
StabilityLevel: TagStabilityLevelBeta,
|
||||
Scopes: utv.ValidScopes().UnsortedList(),
|
||||
Scopes: sets.List(utv.ValidScopes()),
|
||||
Description: "Declares that a list field's elements are unique. This tag can be used with listType=atomic to add uniqueness constraints, or independently to specify uniqueness semantics.",
|
||||
Payloads: []TagPayloadDoc{{
|
||||
Description: "<type>",
|
||||
@@ -374,7 +374,7 @@ func (cutv customUniqueTagValidator) Docs() TagDoc {
|
||||
doc := TagDoc{
|
||||
Tag: cutv.TagName(),
|
||||
StabilityLevel: TagStabilityLevelBeta,
|
||||
Scopes: cutv.ValidScopes().UnsortedList(),
|
||||
Scopes: sets.List(cutv.ValidScopes()),
|
||||
Description: "Indicates that uniqueness validation for this list is implemented via custom, handwritten validation. This disables generation of uniqueness validation for this list.",
|
||||
Payloads: nil,
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ func (itv ifTagValidator) Docs() TagDoc {
|
||||
Type: codetags.ArgTypeString,
|
||||
Required: true,
|
||||
}},
|
||||
Scopes: itv.ValidScopes().UnsortedList(),
|
||||
Scopes: sets.List(itv.ValidScopes()),
|
||||
}
|
||||
|
||||
doc.PayloadsType = codetags.ValueTypeTag
|
||||
|
||||
@@ -304,7 +304,7 @@ func (requirednessTagValidator) doForbidden(context Context) (Validations, error
|
||||
func (rtv requirednessTagValidator) Docs() TagDoc {
|
||||
doc := TagDoc{
|
||||
Tag: rtv.TagName(),
|
||||
Scopes: rtv.ValidScopes().UnsortedList(),
|
||||
Scopes: sets.List(rtv.ValidScopes()),
|
||||
}
|
||||
|
||||
switch rtv.mode {
|
||||
|
||||
@@ -136,7 +136,7 @@ func (stv subfieldTagValidator) Docs() TagDoc {
|
||||
return TagDoc{
|
||||
Tag: stv.TagName(),
|
||||
StabilityLevel: TagStabilityLevelStable,
|
||||
Scopes: stv.ValidScopes().UnsortedList(),
|
||||
Scopes: sets.List(stv.ValidScopes()),
|
||||
Description: "Declares a validation for a subfield of a struct.",
|
||||
Args: []TagArgDoc{{
|
||||
Description: "<field-json-name>",
|
||||
|
||||
@@ -128,7 +128,7 @@ func (frtv fixedResultTagValidator) Docs() TagDoc {
|
||||
doc := TagDoc{
|
||||
Tag: frtv.TagName(),
|
||||
StabilityLevel: TagStabilityLevelAlpha,
|
||||
Scopes: frtv.ValidScopes().UnsortedList(),
|
||||
Scopes: sets.List(frtv.ValidScopes()),
|
||||
}
|
||||
doc.PayloadsType = codetags.ValueTypeString
|
||||
if frtv.error {
|
||||
|
||||
@@ -118,7 +118,7 @@ func (udtv unionDiscriminatorTagValidator) Docs() TagDoc {
|
||||
return TagDoc{
|
||||
Tag: udtv.TagName(),
|
||||
StabilityLevel: TagStabilityLevelBeta,
|
||||
Scopes: udtv.ValidScopes().UnsortedList(),
|
||||
Scopes: sets.List(udtv.ValidScopes()),
|
||||
Description: "Indicates that this field is the discriminator for a union.",
|
||||
Args: []TagArgDoc{{
|
||||
Name: "union",
|
||||
@@ -157,7 +157,7 @@ func (umtv unionMemberTagValidator) Docs() TagDoc {
|
||||
return TagDoc{
|
||||
Tag: umtv.TagName(),
|
||||
StabilityLevel: TagStabilityLevelStable,
|
||||
Scopes: umtv.ValidScopes().UnsortedList(),
|
||||
Scopes: sets.List(umtv.ValidScopes()),
|
||||
Description: "Indicates that this field is a member of a union.",
|
||||
Args: []TagArgDoc{{
|
||||
Name: "union",
|
||||
|
||||
@@ -135,7 +135,7 @@ func (utc updateTagCollector) Docs() TagDoc {
|
||||
return TagDoc{
|
||||
Tag: utc.TagName(),
|
||||
StabilityLevel: TagStabilityLevelBeta,
|
||||
Scopes: utc.ValidScopes().UnsortedList(),
|
||||
Scopes: sets.List(utc.ValidScopes()),
|
||||
PayloadsType: codetags.ValueTypeString,
|
||||
Description: "Provides constraints on the allowed update operations of a field. " +
|
||||
"Currently supports non-list and non-map fields only. " +
|
||||
|
||||
@@ -100,7 +100,7 @@ func (zmtv zeroOrOneOfMemberTagValidator) GetValidations(context Context, tag co
|
||||
func (zmtv zeroOrOneOfMemberTagValidator) Docs() TagDoc {
|
||||
return TagDoc{
|
||||
Tag: zmtv.TagName(),
|
||||
Scopes: zmtv.ValidScopes().UnsortedList(),
|
||||
Scopes: sets.List(zmtv.ValidScopes()),
|
||||
StabilityLevel: TagStabilityLevelStable,
|
||||
Description: "Indicates that this field is a member of a zero-or-one-of union.",
|
||||
Docs: "A zero-or-one-of union allows at most one member to be set. Unlike regular unions, having no members set is valid.",
|
||||
|
||||
Reference in New Issue
Block a user