mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-09 17:37:12 +00:00
152 lines
7.4 KiB
Go
152 lines
7.4 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 v1alpha2
|
|
|
|
import (
|
|
v1alpha2 "github.com/kyverno/kyverno/api/policyreport/v1alpha2"
|
|
v1 "k8s.io/api/core/v1"
|
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
|
)
|
|
|
|
// PolicyReportResultApplyConfiguration represents an declarative configuration of the PolicyReportResult type for use
|
|
// with apply.
|
|
type PolicyReportResultApplyConfiguration struct {
|
|
Source *string `json:"source,omitempty"`
|
|
Policy *string `json:"policy,omitempty"`
|
|
Rule *string `json:"rule,omitempty"`
|
|
Resources []v1.ObjectReference `json:"resources,omitempty"`
|
|
ResourceSelector *metav1.LabelSelector `json:"resourceSelector,omitempty"`
|
|
Message *string `json:"message,omitempty"`
|
|
Result *v1alpha2.PolicyResult `json:"result,omitempty"`
|
|
Scored *bool `json:"scored,omitempty"`
|
|
Properties map[string]string `json:"properties,omitempty"`
|
|
Timestamp *metav1.Timestamp `json:"timestamp,omitempty"`
|
|
Category *string `json:"category,omitempty"`
|
|
Severity *v1alpha2.PolicySeverity `json:"severity,omitempty"`
|
|
}
|
|
|
|
// PolicyReportResultApplyConfiguration constructs an declarative configuration of the PolicyReportResult type for use with
|
|
// apply.
|
|
func PolicyReportResult() *PolicyReportResultApplyConfiguration {
|
|
return &PolicyReportResultApplyConfiguration{}
|
|
}
|
|
|
|
// WithSource sets the Source 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 Source field is set to the value of the last call.
|
|
func (b *PolicyReportResultApplyConfiguration) WithSource(value string) *PolicyReportResultApplyConfiguration {
|
|
b.Source = &value
|
|
return b
|
|
}
|
|
|
|
// WithPolicy sets the Policy 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 Policy field is set to the value of the last call.
|
|
func (b *PolicyReportResultApplyConfiguration) WithPolicy(value string) *PolicyReportResultApplyConfiguration {
|
|
b.Policy = &value
|
|
return b
|
|
}
|
|
|
|
// WithRule sets the Rule 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 Rule field is set to the value of the last call.
|
|
func (b *PolicyReportResultApplyConfiguration) WithRule(value string) *PolicyReportResultApplyConfiguration {
|
|
b.Rule = &value
|
|
return b
|
|
}
|
|
|
|
// WithResources adds the given value to the Resources 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 Resources field.
|
|
func (b *PolicyReportResultApplyConfiguration) WithResources(values ...v1.ObjectReference) *PolicyReportResultApplyConfiguration {
|
|
for i := range values {
|
|
b.Resources = append(b.Resources, values[i])
|
|
}
|
|
return b
|
|
}
|
|
|
|
// WithResourceSelector sets the ResourceSelector 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 ResourceSelector field is set to the value of the last call.
|
|
func (b *PolicyReportResultApplyConfiguration) WithResourceSelector(value metav1.LabelSelector) *PolicyReportResultApplyConfiguration {
|
|
b.ResourceSelector = &value
|
|
return b
|
|
}
|
|
|
|
// WithMessage sets the Message 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 Message field is set to the value of the last call.
|
|
func (b *PolicyReportResultApplyConfiguration) WithMessage(value string) *PolicyReportResultApplyConfiguration {
|
|
b.Message = &value
|
|
return b
|
|
}
|
|
|
|
// WithResult sets the Result 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 Result field is set to the value of the last call.
|
|
func (b *PolicyReportResultApplyConfiguration) WithResult(value v1alpha2.PolicyResult) *PolicyReportResultApplyConfiguration {
|
|
b.Result = &value
|
|
return b
|
|
}
|
|
|
|
// WithScored sets the Scored 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 Scored field is set to the value of the last call.
|
|
func (b *PolicyReportResultApplyConfiguration) WithScored(value bool) *PolicyReportResultApplyConfiguration {
|
|
b.Scored = &value
|
|
return b
|
|
}
|
|
|
|
// WithProperties puts the entries into the Properties field in the declarative configuration
|
|
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
|
|
// If called multiple times, the entries provided by each call will be put on the Properties field,
|
|
// overwriting an existing map entries in Properties field with the same key.
|
|
func (b *PolicyReportResultApplyConfiguration) WithProperties(entries map[string]string) *PolicyReportResultApplyConfiguration {
|
|
if b.Properties == nil && len(entries) > 0 {
|
|
b.Properties = make(map[string]string, len(entries))
|
|
}
|
|
for k, v := range entries {
|
|
b.Properties[k] = v
|
|
}
|
|
return b
|
|
}
|
|
|
|
// WithTimestamp sets the Timestamp 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 Timestamp field is set to the value of the last call.
|
|
func (b *PolicyReportResultApplyConfiguration) WithTimestamp(value metav1.Timestamp) *PolicyReportResultApplyConfiguration {
|
|
b.Timestamp = &value
|
|
return b
|
|
}
|
|
|
|
// WithCategory sets the Category 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 Category field is set to the value of the last call.
|
|
func (b *PolicyReportResultApplyConfiguration) WithCategory(value string) *PolicyReportResultApplyConfiguration {
|
|
b.Category = &value
|
|
return b
|
|
}
|
|
|
|
// WithSeverity sets the Severity 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 Severity field is set to the value of the last call.
|
|
func (b *PolicyReportResultApplyConfiguration) WithSeverity(value v1alpha2.PolicySeverity) *PolicyReportResultApplyConfiguration {
|
|
b.Severity = &value
|
|
return b
|
|
}
|