Merge pull request #119215 from alexzielenski/apiserver/policy/namespaceParamRef-alpha

KEP-3488: Per namespace policy params

Kubernetes-commit: 8a053c700a3abc30717860e0b6a13243a7250743
This commit is contained in:
Kubernetes Publisher 2023-07-20 13:18:10 -07:00
commit 605aac15d7
4 changed files with 35 additions and 6 deletions

View File

@ -18,11 +18,18 @@ limitations under the License.
package v1alpha1 package v1alpha1
import (
v1alpha1 "k8s.io/api/admissionregistration/v1alpha1"
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// ParamRefApplyConfiguration represents an declarative configuration of the ParamRef type for use // ParamRefApplyConfiguration represents an declarative configuration of the ParamRef type for use
// with apply. // with apply.
type ParamRefApplyConfiguration struct { type ParamRefApplyConfiguration struct {
Name *string `json:"name,omitempty"` Name *string `json:"name,omitempty"`
Namespace *string `json:"namespace,omitempty"` Namespace *string `json:"namespace,omitempty"`
Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"`
ParameterNotFoundAction *v1alpha1.ParameterNotFoundActionType `json:"parameterNotFoundAction,omitempty"`
} }
// ParamRefApplyConfiguration constructs an declarative configuration of the ParamRef type for use with // ParamRefApplyConfiguration constructs an declarative configuration of the ParamRef type for use with
@ -46,3 +53,19 @@ func (b *ParamRefApplyConfiguration) WithNamespace(value string) *ParamRefApplyC
b.Namespace = &value b.Namespace = &value
return b return b
} }
// WithSelector sets the Selector field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Selector field is set to the value of the last call.
func (b *ParamRefApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *ParamRefApplyConfiguration {
b.Selector = value
return b
}
// WithParameterNotFoundAction sets the ParameterNotFoundAction field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the ParameterNotFoundAction field is set to the value of the last call.
func (b *ParamRefApplyConfiguration) WithParameterNotFoundAction(value v1alpha1.ParameterNotFoundActionType) *ParamRefApplyConfiguration {
b.ParameterNotFoundAction = &value
return b
}

View File

@ -366,6 +366,12 @@ var schemaYAML = typed.YAMLObject(`types:
- name: namespace - name: namespace
type: type:
scalar: string scalar: string
- name: parameterNotFoundAction
type:
scalar: string
- name: selector
type:
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector
elementRelationship: atomic elementRelationship: atomic
- name: io.k8s.api.admissionregistration.v1alpha1.TypeChecking - name: io.k8s.api.admissionregistration.v1alpha1.TypeChecking
map: map:

4
go.mod
View File

@ -23,7 +23,7 @@ require (
golang.org/x/term v0.10.0 golang.org/x/term v0.10.0
golang.org/x/time v0.3.0 golang.org/x/time v0.3.0
google.golang.org/protobuf v1.30.0 google.golang.org/protobuf v1.30.0
k8s.io/api v0.0.0-20230719224004-86e8180c2c5f k8s.io/api v0.0.0-20230720224857-6ff1b210fae8
k8s.io/apimachinery v0.0.0-20230718054246-5cb236977966 k8s.io/apimachinery v0.0.0-20230718054246-5cb236977966
k8s.io/klog/v2 v2.100.1 k8s.io/klog/v2 v2.100.1
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9
@ -60,6 +60,6 @@ require (
) )
replace ( replace (
k8s.io/api => k8s.io/api v0.0.0-20230719224004-86e8180c2c5f k8s.io/api => k8s.io/api v0.0.0-20230720224857-6ff1b210fae8
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20230718054246-5cb236977966 k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20230718054246-5cb236977966
) )

4
go.sum
View File

@ -146,8 +146,8 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
k8s.io/api v0.0.0-20230719224004-86e8180c2c5f h1:5DEYx2JsX2lvch6vOC1fv0QZ5+nme/AynMsZhQWS220= k8s.io/api v0.0.0-20230720224857-6ff1b210fae8 h1:ANacNQ2bfky2VhOqsQmeRARhiDCahFJsgRJL85gCx4Y=
k8s.io/api v0.0.0-20230719224004-86e8180c2c5f/go.mod h1:DlNtgYu2BX/uM/IkiPaFRqDBVazxK5ggJs19ERbMLZ4= k8s.io/api v0.0.0-20230720224857-6ff1b210fae8/go.mod h1:DlNtgYu2BX/uM/IkiPaFRqDBVazxK5ggJs19ERbMLZ4=
k8s.io/apimachinery v0.0.0-20230718054246-5cb236977966 h1:IYMQQBHbPi6jyorsuYWXB3+kJFH/MxVyLvKJH4nITrg= k8s.io/apimachinery v0.0.0-20230718054246-5cb236977966 h1:IYMQQBHbPi6jyorsuYWXB3+kJFH/MxVyLvKJH4nITrg=
k8s.io/apimachinery v0.0.0-20230718054246-5cb236977966/go.mod h1:xhQIsaL3hXneGluH+0pzF7kr+VYuLS/VcYJxF1xQf+g= k8s.io/apimachinery v0.0.0-20230718054246-5cb236977966/go.mod h1:xhQIsaL3hXneGluH+0pzF7kr+VYuLS/VcYJxF1xQf+g=
k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg=