From 62a5cd097562134bc4ffb822d7dacc90b85c767c Mon Sep 17 00:00:00 2001 From: Chao Xu Date: Wed, 31 May 2017 15:36:49 -0700 Subject: [PATCH] generated Kubernetes-commit: e9d9b05234b46d2419112adb2009a9802998027c --- pkg/apis/admissionregistration/types.go | 6 +++++- pkg/apis/admissionregistration/v1alpha1/generated.proto | 6 +++++- pkg/apis/admissionregistration/v1alpha1/types.go | 6 +++++- .../v1alpha1/types_swagger_doc_generated.go | 4 ++-- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/pkg/apis/admissionregistration/types.go b/pkg/apis/admissionregistration/types.go index be760c44..74131792 100644 --- a/pkg/apis/admissionregistration/types.go +++ b/pkg/apis/admissionregistration/types.go @@ -65,6 +65,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 @@ -98,7 +99,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/pkg/apis/admissionregistration/v1alpha1/generated.proto b/pkg/apis/admissionregistration/v1alpha1/generated.proto index da82fb54..318b0eb2 100644 --- a/pkg/apis/admissionregistration/v1alpha1/generated.proto +++ b/pkg/apis/admissionregistration/v1alpha1/generated.proto @@ -105,6 +105,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 @@ -167,7 +168,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.go b/pkg/apis/admissionregistration/v1alpha1/types.go index f35d54a8..c84df0ac 100644 --- a/pkg/apis/admissionregistration/v1alpha1/types.go +++ b/pkg/apis/admissionregistration/v1alpha1/types.go @@ -67,6 +67,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 @@ -100,7 +101,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/pkg/apis/admissionregistration/v1alpha1/types_swagger_doc_generated.go b/pkg/apis/admissionregistration/v1alpha1/types_swagger_doc_generated.go index 80f9120b..ac3f9fa3 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 {