mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-12 02:46:56 +00:00
87 lines
3.9 KiB
Go
87 lines
3.9 KiB
Go
/*
|
|
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
|
|
|
|
import (
|
|
v1 "k8s.io/api/admissionregistration/v1"
|
|
)
|
|
|
|
// AutogenRuleApplyConfiguration represents an declarative configuration of the AutogenRule type for use
|
|
// with apply.
|
|
type AutogenRuleApplyConfiguration struct {
|
|
MatchConstraints *v1.MatchResources `json:"matchConstraints,omitempty"`
|
|
MatchConditions []v1.MatchCondition `json:"matchConditions,omitempty"`
|
|
Validations []v1.Validation `json:"validations,omitempty"`
|
|
AuditAnnotation []v1.AuditAnnotation `json:"auditAnnotations,omitempty"`
|
|
Variables []v1.Variable `json:"variables,omitempty"`
|
|
}
|
|
|
|
// AutogenRuleApplyConfiguration constructs an declarative configuration of the AutogenRule type for use with
|
|
// apply.
|
|
func AutogenRule() *AutogenRuleApplyConfiguration {
|
|
return &AutogenRuleApplyConfiguration{}
|
|
}
|
|
|
|
// WithMatchConstraints sets the MatchConstraints 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 MatchConstraints field is set to the value of the last call.
|
|
func (b *AutogenRuleApplyConfiguration) WithMatchConstraints(value v1.MatchResources) *AutogenRuleApplyConfiguration {
|
|
b.MatchConstraints = &value
|
|
return b
|
|
}
|
|
|
|
// WithMatchConditions adds the given value to the MatchConditions 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 MatchConditions field.
|
|
func (b *AutogenRuleApplyConfiguration) WithMatchConditions(values ...v1.MatchCondition) *AutogenRuleApplyConfiguration {
|
|
for i := range values {
|
|
b.MatchConditions = append(b.MatchConditions, values[i])
|
|
}
|
|
return b
|
|
}
|
|
|
|
// WithValidations adds the given value to the Validations 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 Validations field.
|
|
func (b *AutogenRuleApplyConfiguration) WithValidations(values ...v1.Validation) *AutogenRuleApplyConfiguration {
|
|
for i := range values {
|
|
b.Validations = append(b.Validations, values[i])
|
|
}
|
|
return b
|
|
}
|
|
|
|
// WithAuditAnnotation adds the given value to the AuditAnnotation 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 AuditAnnotation field.
|
|
func (b *AutogenRuleApplyConfiguration) WithAuditAnnotation(values ...v1.AuditAnnotation) *AutogenRuleApplyConfiguration {
|
|
for i := range values {
|
|
b.AuditAnnotation = append(b.AuditAnnotation, values[i])
|
|
}
|
|
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 *AutogenRuleApplyConfiguration) WithVariables(values ...v1.Variable) *AutogenRuleApplyConfiguration {
|
|
for i := range values {
|
|
b.Variables = append(b.Variables, values[i])
|
|
}
|
|
return b
|
|
}
|