Generate code

Kubernetes-commit: 932a4d97249cb79f3041b5d8842425b0ed7275b3
This commit is contained in:
Joe Betz 2023-03-06 17:30:37 -05:00 committed by Kubernetes Publisher
parent 48ca73428a
commit bbbf092e1d
5 changed files with 105 additions and 3 deletions

View File

@ -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
// AuditAnnotationApplyConfiguration represents an declarative configuration of the AuditAnnotation type for use
// with apply.
type AuditAnnotationApplyConfiguration struct {
Key *string `json:"key,omitempty"`
ValueExpression *string `json:"valueExpression,omitempty"`
}
// AuditAnnotationApplyConfiguration constructs an declarative configuration of the AuditAnnotation type for use with
// apply.
func AuditAnnotation() *AuditAnnotationApplyConfiguration {
return &AuditAnnotationApplyConfiguration{}
}
// WithKey sets the Key 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 Key field is set to the value of the last call.
func (b *AuditAnnotationApplyConfiguration) WithKey(value string) *AuditAnnotationApplyConfiguration {
b.Key = &value
return b
}
// WithValueExpression sets the ValueExpression 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 ValueExpression field is set to the value of the last call.
func (b *AuditAnnotationApplyConfiguration) WithValueExpression(value string) *AuditAnnotationApplyConfiguration {
b.ValueExpression = &value
return b
}

View File

@ -18,12 +18,17 @@ limitations under the License.
package v1alpha1
import (
admissionregistrationv1alpha1 "k8s.io/api/admissionregistration/v1alpha1"
)
// ValidatingAdmissionPolicyBindingSpecApplyConfiguration represents an declarative configuration of the ValidatingAdmissionPolicyBindingSpec type for use
// with apply.
type ValidatingAdmissionPolicyBindingSpecApplyConfiguration struct {
PolicyName *string `json:"policyName,omitempty"`
ParamRef *ParamRefApplyConfiguration `json:"paramRef,omitempty"`
MatchResources *MatchResourcesApplyConfiguration `json:"matchResources,omitempty"`
PolicyName *string `json:"policyName,omitempty"`
ParamRef *ParamRefApplyConfiguration `json:"paramRef,omitempty"`
MatchResources *MatchResourcesApplyConfiguration `json:"matchResources,omitempty"`
ValidationActions []admissionregistrationv1alpha1.ValidationAction `json:"validationActions,omitempty"`
}
// ValidatingAdmissionPolicyBindingSpecApplyConfiguration constructs an declarative configuration of the ValidatingAdmissionPolicyBindingSpec type for use with
@ -55,3 +60,13 @@ func (b *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) WithMatchResour
b.MatchResources = value
return b
}
// WithValidationActions adds the given value to the ValidationActions 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 ValidationActions field.
func (b *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) WithValidationActions(values ...admissionregistrationv1alpha1.ValidationAction) *ValidatingAdmissionPolicyBindingSpecApplyConfiguration {
for i := range values {
b.ValidationActions = append(b.ValidationActions, values[i])
}
return b
}

View File

@ -29,6 +29,7 @@ type ValidatingAdmissionPolicySpecApplyConfiguration struct {
MatchConstraints *MatchResourcesApplyConfiguration `json:"matchConstraints,omitempty"`
Validations []ValidationApplyConfiguration `json:"validations,omitempty"`
FailurePolicy *admissionregistrationv1alpha1.FailurePolicyType `json:"failurePolicy,omitempty"`
AuditAnnotations []AuditAnnotationApplyConfiguration `json:"auditAnnotations,omitempty"`
}
// ValidatingAdmissionPolicySpecApplyConfiguration constructs an declarative configuration of the ValidatingAdmissionPolicySpec type for use with
@ -73,3 +74,16 @@ func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithFailurePolicy(valu
b.FailurePolicy = &value
return b
}
// WithAuditAnnotations adds the given value to the AuditAnnotations 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 AuditAnnotations field.
func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithAuditAnnotations(values ...*AuditAnnotationApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithAuditAnnotations")
}
b.AuditAnnotations = append(b.AuditAnnotations, *values[i])
}
return b
}

View File

@ -225,6 +225,17 @@ var schemaYAML = typed.YAMLObject(`types:
- name: url
type:
scalar: string
- name: io.k8s.api.admissionregistration.v1alpha1.AuditAnnotation
map:
fields:
- name: key
type:
scalar: string
default: ""
- name: valueExpression
type:
scalar: string
default: ""
- name: io.k8s.api.admissionregistration.v1alpha1.MatchResources
map:
fields:
@ -353,9 +364,21 @@ var schemaYAML = typed.YAMLObject(`types:
- name: policyName
type:
scalar: string
- name: validationActions
type:
list:
elementType:
scalar: string
elementRelationship: associative
- name: io.k8s.api.admissionregistration.v1alpha1.ValidatingAdmissionPolicySpec
map:
fields:
- name: auditAnnotations
type:
list:
elementType:
namedType: io.k8s.api.admissionregistration.v1alpha1.AuditAnnotation
elementRelationship: atomic
- name: failurePolicy
type:
scalar: string

View File

@ -139,6 +139,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
return &admissionregistrationv1.WebhookClientConfigApplyConfiguration{}
// Group=admissionregistration.k8s.io, Version=v1alpha1
case v1alpha1.SchemeGroupVersion.WithKind("AuditAnnotation"):
return &admissionregistrationv1alpha1.AuditAnnotationApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("MatchResources"):
return &admissionregistrationv1alpha1.MatchResourcesApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("NamedRuleWithOperations"):