diff --git a/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicyspec.go b/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicyspec.go index f674b5b1..7ee320e4 100644 --- a/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicyspec.go +++ b/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicyspec.go @@ -31,6 +31,7 @@ type ValidatingAdmissionPolicySpecApplyConfiguration struct { FailurePolicy *admissionregistrationv1alpha1.FailurePolicyType `json:"failurePolicy,omitempty"` AuditAnnotations []AuditAnnotationApplyConfiguration `json:"auditAnnotations,omitempty"` MatchConditions []MatchConditionApplyConfiguration `json:"matchConditions,omitempty"` + Variables []VariableApplyConfiguration `json:"variables,omitempty"` } // ValidatingAdmissionPolicySpecApplyConfiguration constructs an declarative configuration of the ValidatingAdmissionPolicySpec type for use with @@ -101,3 +102,16 @@ func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithMatchConditions(va } return b } + +// WithVariables adds the given value to the Variables field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Variables field. +func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithVariables(values ...*VariableApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithVariables") + } + b.Variables = append(b.Variables, *values[i]) + } + return b +} diff --git a/applyconfigurations/admissionregistration/v1alpha1/variable.go b/applyconfigurations/admissionregistration/v1alpha1/variable.go new file mode 100644 index 00000000..2c70a8cf --- /dev/null +++ b/applyconfigurations/admissionregistration/v1alpha1/variable.go @@ -0,0 +1,48 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +// VariableApplyConfiguration represents an declarative configuration of the Variable type for use +// with apply. +type VariableApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Expression *string `json:"expression,omitempty"` +} + +// VariableApplyConfiguration constructs an declarative configuration of the Variable type for use with +// apply. +func Variable() *VariableApplyConfiguration { + return &VariableApplyConfiguration{} +} + +// WithName sets the Name 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 Name field is set to the value of the last call. +func (b *VariableApplyConfiguration) WithName(value string) *VariableApplyConfiguration { + b.Name = &value + return b +} + +// WithExpression sets the Expression 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 Expression field is set to the value of the last call. +func (b *VariableApplyConfiguration) WithExpression(value string) *VariableApplyConfiguration { + b.Expression = &value + return b +} diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index 2129d0d5..a23e357e 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -464,6 +464,14 @@ var schemaYAML = typed.YAMLObject(`types: elementType: namedType: io.k8s.api.admissionregistration.v1alpha1.Validation elementRelationship: atomic + - name: variables + type: + list: + elementType: + namedType: io.k8s.api.admissionregistration.v1alpha1.Variable + elementRelationship: associative + keys: + - name - name: io.k8s.api.admissionregistration.v1alpha1.ValidatingAdmissionPolicyStatus map: fields: @@ -497,6 +505,17 @@ var schemaYAML = typed.YAMLObject(`types: - name: reason type: scalar: string +- name: io.k8s.api.admissionregistration.v1alpha1.Variable + map: + fields: + - name: expression + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" - name: io.k8s.api.admissionregistration.v1beta1.MatchCondition map: fields: diff --git a/applyconfigurations/utils.go b/applyconfigurations/utils.go index 6c35d6c2..d8e4c8f0 100644 --- a/applyconfigurations/utils.go +++ b/applyconfigurations/utils.go @@ -171,6 +171,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &admissionregistrationv1alpha1.ValidatingAdmissionPolicyStatusApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("Validation"): return &admissionregistrationv1alpha1.ValidationApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("Variable"): + return &admissionregistrationv1alpha1.VariableApplyConfiguration{} // Group=admissionregistration.k8s.io, Version=v1beta1 case v1beta1.SchemeGroupVersion.WithKind("MatchCondition"): diff --git a/go.mod b/go.mod index 8b6decc1..ead2e577 100644 --- a/go.mod +++ b/go.mod @@ -23,8 +23,8 @@ require ( golang.org/x/term v0.7.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.30.0 - k8s.io/api v0.0.0-20230711173311-4993e301ed85 - k8s.io/apimachinery v0.0.0-20230628220152-83d6d372b1a4 + k8s.io/api v0.0.0-20230714010757-8167ea0e18a0 + k8s.io/apimachinery v0.0.0-20230712210707-c9b3b3a37189 k8s.io/klog/v2 v2.100.1 k8s.io/kube-openapi v0.0.0-20230601164746-7562a1006961 k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 @@ -60,6 +60,6 @@ require ( ) replace ( - k8s.io/api => k8s.io/api v0.0.0-20230711173311-4993e301ed85 - k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20230628220152-83d6d372b1a4 + k8s.io/api => k8s.io/api v0.0.0-20230714010757-8167ea0e18a0 + k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20230712210707-c9b3b3a37189 ) diff --git a/go.sum b/go.sum index 06597f79..00ed9fed 100644 --- a/go.sum +++ b/go.sum @@ -146,10 +146,10 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.0.0-20230711173311-4993e301ed85 h1:objTFO7gYE2CeGB/qKnBxdUoj2QX5a6ZlLhewph/B0M= -k8s.io/api v0.0.0-20230711173311-4993e301ed85/go.mod h1:ghFHmaoujTvUqKl24+WADIX4gEvgTA8BEpgFe3ZPylQ= -k8s.io/apimachinery v0.0.0-20230628220152-83d6d372b1a4 h1:ntS2ZHGzNY/ISRKPPU937LFSwjYZ7poMcwAeu1xCnKM= -k8s.io/apimachinery v0.0.0-20230628220152-83d6d372b1a4/go.mod h1:tAiIbF8KB8+Ri2DfUWwZGwNOThIwM0fhXLnOymriu+4= +k8s.io/api v0.0.0-20230714010757-8167ea0e18a0 h1:T9sVvsPvT6eMUXsLW0PbiIkQB4iX7QP6UdtkQdTH7LQ= +k8s.io/api v0.0.0-20230714010757-8167ea0e18a0/go.mod h1:fpwNBY6Bs/ziqh5pV+OznQed0xUjcbaf4ltGHniRCOE= +k8s.io/apimachinery v0.0.0-20230712210707-c9b3b3a37189 h1:y3e8tHyqhvrwV/79166VbMgSTy6i9/z8Tk4VrKZc8dg= +k8s.io/apimachinery v0.0.0-20230712210707-c9b3b3a37189/go.mod h1:tAiIbF8KB8+Ri2DfUWwZGwNOThIwM0fhXLnOymriu+4= k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20230601164746-7562a1006961 h1:pqRVJGQJz6oeZby8qmPKXYIBjyrcv7EHCe/33UkZMYA=