diff --git a/api/openapi-spec/swagger.json b/api/openapi-spec/swagger.json index c9ff98d6f94..28b8351bc55 100644 --- a/api/openapi-spec/swagger.json +++ b/api/openapi-spec/swagger.json @@ -49367,7 +49367,7 @@ "type": "string" }, "rules": { - "description": "Rules describes what resources/subresources the initializer cares about. The initializer cares about an operation if it matches _any_ Rule.", + "description": "Rules describes what resources/subresources the initializer cares about. The initializer cares about an operation if it matches _any_ Rule. Rule.Resources must not include subresources.", "type": "array", "items": { "$ref": "#/definitions/io.k8s.kubernetes.pkg.apis.admissionregistration.v1alpha1.Rule" @@ -49460,7 +49460,7 @@ } }, "resources": { - "description": "Resources is a list of resources this rule applies to.\n\nFor example: 'pods' means pods. 'pods/log' means the log subresource of pods. '*' means all resources, but not subresources. 'pods/*' means all subresources of pods. '*/scale' means all scale subresources. '*/*' means all resources and their subresources.\n\nIf '*' or '*/*' is present, the length of the slice must be one. Required.", + "description": "Resources is a list of resources this rule applies to.\n\nFor example: 'pods' means pods. 'pods/log' means the log subresource of pods. '*' means all resources, but not subresources. 'pods/*' means all subresources of pods. '*/scale' means all scale subresources. '*/*' means all resources and their subresources.\n\nIf wildcard is present, the validation rule will ensure resources do not overlap with each other.\n\nDepending on the enclosing object, subresources might not be allowed. Required.", "type": "array", "items": { "type": "string" @@ -49493,7 +49493,7 @@ } }, "resources": { - "description": "Resources is a list of resources this rule applies to.\n\nFor example: 'pods' means pods. 'pods/log' means the log subresource of pods. '*' means all resources, but not subresources. 'pods/*' means all subresources of pods. '*/scale' means all scale subresources. '*/*' means all resources and their subresources.\n\nIf '*' or '*/*' is present, the length of the slice must be one. Required.", + "description": "Resources is a list of resources this rule applies to.\n\nFor example: 'pods' means pods. 'pods/log' means the log subresource of pods. '*' means all resources, but not subresources. 'pods/*' means all subresources of pods. '*/scale' means all scale subresources. '*/*' means all resources and their subresources.\n\nIf wildcard is present, the validation rule will ensure resources do not overlap with each other.\n\nDepending on the enclosing object, subresources might not be allowed. Required.", "type": "array", "items": { "type": "string" diff --git a/api/swagger-spec/admissionregistration.k8s.io_v1alpha1.json b/api/swagger-spec/admissionregistration.k8s.io_v1alpha1.json index a85b226b177..6c85ef361fb 100644 --- a/api/swagger-spec/admissionregistration.k8s.io_v1alpha1.json +++ b/api/swagger-spec/admissionregistration.k8s.io_v1alpha1.json @@ -1663,7 +1663,7 @@ "items": { "type": "string" }, - "description": "Resources is a list of resources this rule applies to.\n\nFor example: 'pods' means pods. 'pods/log' means the log subresource of pods. '*' means all resources, but not subresources. 'pods/*' means all subresources of pods. '*/scale' means all scale subresources. '*/*' means all resources and their subresources.\n\nIf '*' or '*/*' is present, the length of the slice must be one. Required." + "description": "Resources is a list of resources this rule applies to.\n\nFor example: 'pods' means pods. 'pods/log' means the log subresource of pods. '*' means all resources, but not subresources. 'pods/*' means all subresources of pods. '*/scale' means all scale subresources. '*/*' means all resources and their subresources.\n\nIf wildcard is present, the validation rule will ensure resources do not overlap with each other.\n\nDepending on the enclosing object, subresources might not be allowed. Required." } } }, @@ -1813,7 +1813,7 @@ "items": { "$ref": "v1alpha1.Rule" }, - "description": "Rules describes what resources/subresources the initializer cares about. The initializer cares about an operation if it matches _any_ Rule." + "description": "Rules describes what resources/subresources the initializer cares about. The initializer cares about an operation if it matches _any_ Rule. Rule.Resources must not include subresources." }, "failurePolicy": { "$ref": "v1alpha1.FailurePolicyType", @@ -1844,7 +1844,7 @@ "items": { "type": "string" }, - "description": "Resources is a list of resources this rule applies to.\n\nFor example: 'pods' means pods. 'pods/log' means the log subresource of pods. '*' means all resources, but not subresources. 'pods/*' means all subresources of pods. '*/scale' means all scale subresources. '*/*' means all resources and their subresources.\n\nIf '*' or '*/*' is present, the length of the slice must be one. Required." + "description": "Resources is a list of resources this rule applies to.\n\nFor example: 'pods' means pods. 'pods/log' means the log subresource of pods. '*' means all resources, but not subresources. 'pods/*' means all subresources of pods. '*/scale' means all scale subresources. '*/*' means all resources and their subresources.\n\nIf wildcard is present, the validation rule will ensure resources do not overlap with each other.\n\nDepending on the enclosing object, subresources might not be allowed. Required." } } }, diff --git a/docs/api-reference/admissionregistration.k8s.io/v1alpha1/definitions.html b/docs/api-reference/admissionregistration.k8s.io/v1alpha1/definitions.html index ecd774eec48..650cb5f5540 100755 --- a/docs/api-reference/admissionregistration.k8s.io/v1alpha1/definitions.html +++ b/docs/api-reference/admissionregistration.k8s.io/v1alpha1/definitions.html @@ -492,9 +492,11 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }

resources

Resources is a list of resources this rule applies to.

-For example: pods means pods. pods/log means the log subresource of pods. means all resources, but not subresources. pods/ means all subresources of pods. /scale means all scale subresources. / means all resources and their subresources.
+For example: pods means pods. pods/log means the log subresource of pods. means all resources, but not subresources. pods/ means all subresources of pods. /scale means all scale subresources. /* means all resources and their subresources.

-If
or / is present, the length of the slice must be one. Required.

+If wildcard is present, the validation rule will ensure resources do not overlap with each other.
+
+Depending on the enclosing object, subresources might not be allowed. Required.

false

string array

@@ -551,9 +553,11 @@ If or / is present, the length of t

resources

Resources is a list of resources this rule applies to.

-For example: pods means pods. pods/log means the log subresource of pods. means all resources, but not subresources. pods/ means all subresources of pods. /scale means all scale subresources. / means all resources and their subresources.
+For example: pods means pods. pods/log means the log subresource of pods. means all resources, but not subresources. pods/ means all subresources of pods. /scale means all scale subresources. /* means all resources and their subresources.

-If
or / is present, the length of the slice must be one. Required.

+If wildcard is present, the validation rule will ensure resources do not overlap with each other.
+
+Depending on the enclosing object, subresources might not be allowed. Required.

false

string array

@@ -968,7 +972,7 @@ If or / is present, the length of t

rules

-

Rules describes what resources/subresources the initializer cares about. The initializer cares about an operation if it matches any Rule.

+

Rules describes what resources/subresources the initializer cares about. The initializer cares about an operation if it matches any Rule. Rule.Resources must not include subresources.

false

v1alpha1.Rule array

@@ -1746,7 +1750,7 @@ Examples:
diff --git a/pkg/apis/admissionregistration/v1alpha1/generated.proto b/pkg/apis/admissionregistration/v1alpha1/generated.proto index 045279baff7..8f892e5926a 100644 --- a/pkg/apis/admissionregistration/v1alpha1/generated.proto +++ b/pkg/apis/admissionregistration/v1alpha1/generated.proto @@ -106,6 +106,7 @@ message Initializer { // Rules describes what resources/subresources the initializer cares about. // The initializer cares about an operation if it matches _any_ Rule. + // Rule.Resources must not include subresources. repeated Rule rules = 2; // FailurePolicy defines what happens if the responsible initializer controller @@ -168,7 +169,10 @@ message Rule { // '*/scale' means all scale subresources. // '*/*' means all resources and their subresources. // - // If '*' or '*/*' is present, the length of the slice must be one. + // If wildcard is present, the validation rule will ensure resources do not + // overlap with each other. + // + // Depending on the enclosing object, subresources might not be allowed. // Required. repeated string resources = 3; } diff --git a/pkg/apis/admissionregistration/v1alpha1/types_swagger_doc_generated.go b/pkg/apis/admissionregistration/v1alpha1/types_swagger_doc_generated.go index 80f9120b37b..ac3f9fa362a 100644 --- a/pkg/apis/admissionregistration/v1alpha1/types_swagger_doc_generated.go +++ b/pkg/apis/admissionregistration/v1alpha1/types_swagger_doc_generated.go @@ -72,7 +72,7 @@ func (ExternalAdmissionHookConfigurationList) SwaggerDoc() map[string]string { var map_Initializer = map[string]string{ "": "Initializer describes the name and the failure policy of an initializer, and what resources it applies to.", "name": "Name is the identifier of the initializer. It will be added to the object that needs to be initialized. Name should be fully qualified, e.g., alwayspullimages.kubernetes.io, where \"alwayspullimages\" is the name of the webhook, and kubernetes.io is the name of the organization. Required", - "rules": "Rules describes what resources/subresources the initializer cares about. The initializer cares about an operation if it matches _any_ Rule.", + "rules": "Rules describes what resources/subresources the initializer cares about. The initializer cares about an operation if it matches _any_ Rule. Rule.Resources must not include subresources.", "failurePolicy": "FailurePolicy defines what happens if the responsible initializer controller fails to takes action. Allowed values are Ignore, or Fail. If \"Ignore\" is set, initializer is removed from the initializers list of an object if the timeout is reached; If \"Fail\" is set, admissionregistration returns timeout error if the timeout is reached.", } @@ -104,7 +104,7 @@ var map_Rule = map[string]string{ "": "Rule is a tuple of APIGroups, APIVersion, and Resources.It is recommended to make sure that all the tuple expansions are valid.", "apiGroups": "APIGroups is the API groups the resources belong to. '*' is all groups. If '*' is present, the length of the slice must be one. Required.", "apiVersions": "APIVersions is the API versions the resources belong to. '*' is all versions. If '*' is present, the length of the slice must be one. Required.", - "resources": "Resources is a list of resources this rule applies to.\n\nFor example: 'pods' means pods. 'pods/log' means the log subresource of pods. '*' means all resources, but not subresources. 'pods/*' means all subresources of pods. '*/scale' means all scale subresources. '*/*' means all resources and their subresources.\n\nIf '*' or '*/*' is present, the length of the slice must be one. Required.", + "resources": "Resources is a list of resources this rule applies to.\n\nFor example: 'pods' means pods. 'pods/log' means the log subresource of pods. '*' means all resources, but not subresources. 'pods/*' means all subresources of pods. '*/scale' means all scale subresources. '*/*' means all resources and their subresources.\n\nIf wildcard is present, the validation rule will ensure resources do not overlap with each other.\n\nDepending on the enclosing object, subresources might not be allowed. Required.", } func (Rule) SwaggerDoc() map[string]string { diff --git a/staging/src/k8s.io/client-go/pkg/apis/admissionregistration/types.go b/staging/src/k8s.io/client-go/pkg/apis/admissionregistration/types.go index 037c0757709..a294deead58 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/admissionregistration/types.go +++ b/staging/src/k8s.io/client-go/pkg/apis/admissionregistration/types.go @@ -64,6 +64,7 @@ type Initializer struct { // Rules describes what resources/subresources the initializer cares about. // The initializer cares about an operation if it matches _any_ Rule. + // Rule.Resources must not include subresources. Rules []Rule // FailurePolicy defines what happens if the responsible initializer controller @@ -97,7 +98,10 @@ type Rule struct { // '*/scale' means all scale subresources. // '*/*' means all resources and their subresources. // - // If '*' or '*/*' is present, the length of the slice must be one. + // If wildcard is present, the validation rule will ensure resources do not + // overlap with each other. + // + // Depending on the enclosing object, subresources might not be allowed. // Required. Resources []string } diff --git a/staging/src/k8s.io/client-go/pkg/apis/admissionregistration/v1alpha1/generated.proto b/staging/src/k8s.io/client-go/pkg/apis/admissionregistration/v1alpha1/generated.proto index 045279baff7..8f892e5926a 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/admissionregistration/v1alpha1/generated.proto +++ b/staging/src/k8s.io/client-go/pkg/apis/admissionregistration/v1alpha1/generated.proto @@ -106,6 +106,7 @@ message Initializer { // Rules describes what resources/subresources the initializer cares about. // The initializer cares about an operation if it matches _any_ Rule. + // Rule.Resources must not include subresources. repeated Rule rules = 2; // FailurePolicy defines what happens if the responsible initializer controller @@ -168,7 +169,10 @@ message Rule { // '*/scale' means all scale subresources. // '*/*' means all resources and their subresources. // - // If '*' or '*/*' is present, the length of the slice must be one. + // If wildcard is present, the validation rule will ensure resources do not + // overlap with each other. + // + // Depending on the enclosing object, subresources might not be allowed. // Required. repeated string resources = 3; } diff --git a/staging/src/k8s.io/client-go/pkg/apis/admissionregistration/v1alpha1/types.go b/staging/src/k8s.io/client-go/pkg/apis/admissionregistration/v1alpha1/types.go index 67a76dff981..e5456c97a30 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/admissionregistration/v1alpha1/types.go +++ b/staging/src/k8s.io/client-go/pkg/apis/admissionregistration/v1alpha1/types.go @@ -66,6 +66,7 @@ type Initializer struct { // Rules describes what resources/subresources the initializer cares about. // The initializer cares about an operation if it matches _any_ Rule. + // Rule.Resources must not include subresources. Rules []Rule `json:"rules,omitempty" protobuf:"bytes,2,rep,name=rules"` // FailurePolicy defines what happens if the responsible initializer controller @@ -99,7 +100,10 @@ type Rule struct { // '*/scale' means all scale subresources. // '*/*' means all resources and their subresources. // - // If '*' or '*/*' is present, the length of the slice must be one. + // If wildcard is present, the validation rule will ensure resources do not + // overlap with each other. + // + // Depending on the enclosing object, subresources might not be allowed. // Required. Resources []string `json:"resources,omitempty" protobuf:"bytes,3,rep,name=resources"` } diff --git a/staging/src/k8s.io/client-go/pkg/apis/admissionregistration/v1alpha1/types_swagger_doc_generated.go b/staging/src/k8s.io/client-go/pkg/apis/admissionregistration/v1alpha1/types_swagger_doc_generated.go index 80f9120b37b..ac3f9fa362a 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/admissionregistration/v1alpha1/types_swagger_doc_generated.go +++ b/staging/src/k8s.io/client-go/pkg/apis/admissionregistration/v1alpha1/types_swagger_doc_generated.go @@ -72,7 +72,7 @@ func (ExternalAdmissionHookConfigurationList) SwaggerDoc() map[string]string { var map_Initializer = map[string]string{ "": "Initializer describes the name and the failure policy of an initializer, and what resources it applies to.", "name": "Name is the identifier of the initializer. It will be added to the object that needs to be initialized. Name should be fully qualified, e.g., alwayspullimages.kubernetes.io, where \"alwayspullimages\" is the name of the webhook, and kubernetes.io is the name of the organization. Required", - "rules": "Rules describes what resources/subresources the initializer cares about. The initializer cares about an operation if it matches _any_ Rule.", + "rules": "Rules describes what resources/subresources the initializer cares about. The initializer cares about an operation if it matches _any_ Rule. Rule.Resources must not include subresources.", "failurePolicy": "FailurePolicy defines what happens if the responsible initializer controller fails to takes action. Allowed values are Ignore, or Fail. If \"Ignore\" is set, initializer is removed from the initializers list of an object if the timeout is reached; If \"Fail\" is set, admissionregistration returns timeout error if the timeout is reached.", } @@ -104,7 +104,7 @@ var map_Rule = map[string]string{ "": "Rule is a tuple of APIGroups, APIVersion, and Resources.It is recommended to make sure that all the tuple expansions are valid.", "apiGroups": "APIGroups is the API groups the resources belong to. '*' is all groups. If '*' is present, the length of the slice must be one. Required.", "apiVersions": "APIVersions is the API versions the resources belong to. '*' is all versions. If '*' is present, the length of the slice must be one. Required.", - "resources": "Resources is a list of resources this rule applies to.\n\nFor example: 'pods' means pods. 'pods/log' means the log subresource of pods. '*' means all resources, but not subresources. 'pods/*' means all subresources of pods. '*/scale' means all scale subresources. '*/*' means all resources and their subresources.\n\nIf '*' or '*/*' is present, the length of the slice must be one. Required.", + "resources": "Resources is a list of resources this rule applies to.\n\nFor example: 'pods' means pods. 'pods/log' means the log subresource of pods. '*' means all resources, but not subresources. 'pods/*' means all subresources of pods. '*/scale' means all scale subresources. '*/*' means all resources and their subresources.\n\nIf wildcard is present, the validation rule will ensure resources do not overlap with each other.\n\nDepending on the enclosing object, subresources might not be allowed. Required.", } func (Rule) SwaggerDoc() map[string]string {