1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-04-08 18:15:48 +00:00

refactor: use single type for ephemeral reports (#9537)

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
This commit is contained in:
Charles-Edouard Brétéché 2024-01-28 00:30:04 +01:00 committed by GitHub
parent 6a41c813fa
commit afede6486d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
48 changed files with 800 additions and 3499 deletions

View file

@ -1,123 +0,0 @@
/*
Copyright 2020 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.
*/
package v1
import (
policyreportv1alpha2 "github.com/kyverno/kyverno/api/policyreport/v1alpha2"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
type BackgroundScanReportSpec struct {
// PolicyReportSummary provides a summary of results
// +optional
Summary policyreportv1alpha2.PolicyReportSummary `json:"summary,omitempty"`
// PolicyReportResult provides result details
// +optional
Results []policyreportv1alpha2.PolicyReportResult `json:"results,omitempty"`
}
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:object:root=true
// +kubebuilder:storageversion
// +kubebuilder:resource:shortName=bgscanr,categories=kyverno
// +kubebuilder:printcolumn:name="ApiVersion",type=string,JSONPath=".metadata.ownerReferences[0].apiVersion"
// +kubebuilder:printcolumn:name="Kind",type=string,JSONPath=".metadata.ownerReferences[0].kind"
// +kubebuilder:printcolumn:name="Subject",type=string,JSONPath=".metadata.ownerReferences[0].name"
// +kubebuilder:printcolumn:name="Pass",type=integer,JSONPath=".spec.summary.pass"
// +kubebuilder:printcolumn:name="Fail",type=integer,JSONPath=".spec.summary.fail"
// +kubebuilder:printcolumn:name="Warn",type=integer,JSONPath=".spec.summary.warn"
// +kubebuilder:printcolumn:name="Error",type=integer,JSONPath=".spec.summary.error"
// +kubebuilder:printcolumn:name="Skip",type=integer,JSONPath=".spec.summary.skip"
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
// +kubebuilder:printcolumn:name="Hash",type=string,JSONPath=".metadata.labels['audit\\.kyverno\\.io/resource\\.hash']",priority=1
// BackgroundScanReport is the Schema for the BackgroundScanReports API
type BackgroundScanReport struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec BackgroundScanReportSpec `json:"spec"`
}
func (r *BackgroundScanReport) GetResults() []policyreportv1alpha2.PolicyReportResult {
return r.Spec.Results
}
func (r *BackgroundScanReport) SetResults(results []policyreportv1alpha2.PolicyReportResult) {
r.Spec.Results = results
}
func (r *BackgroundScanReport) SetSummary(summary policyreportv1alpha2.PolicyReportSummary) {
r.Spec.Summary = summary
}
// +genclient
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:object:root=true
// +kubebuilder:storageversion
// +kubebuilder:resource:scope=Cluster,shortName=cbgscanr,categories=kyverno
// +kubebuilder:printcolumn:name="ApiVersion",type=string,JSONPath=".metadata.ownerReferences[0].apiVersion"
// +kubebuilder:printcolumn:name="Kind",type=string,JSONPath=".metadata.ownerReferences[0].kind"
// +kubebuilder:printcolumn:name="Subject",type=string,JSONPath=".metadata.ownerReferences[0].name"
// +kubebuilder:printcolumn:name="Pass",type=integer,JSONPath=".spec.summary.pass"
// +kubebuilder:printcolumn:name="Fail",type=integer,JSONPath=".spec.summary.fail"
// +kubebuilder:printcolumn:name="Warn",type=integer,JSONPath=".spec.summary.warn"
// +kubebuilder:printcolumn:name="Error",type=integer,JSONPath=".spec.summary.error"
// +kubebuilder:printcolumn:name="Skip",type=integer,JSONPath=".spec.summary.skip"
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
// +kubebuilder:printcolumn:name="Hash",type=string,JSONPath=".metadata.labels['audit\\.kyverno\\.io/resource\\.hash']",priority=1
// ClusterBackgroundScanReport is the Schema for the ClusterBackgroundScanReports API
type ClusterBackgroundScanReport struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec BackgroundScanReportSpec `json:"spec"`
}
func (r *ClusterBackgroundScanReport) GetResults() []policyreportv1alpha2.PolicyReportResult {
return r.Spec.Results
}
func (r *ClusterBackgroundScanReport) SetResults(results []policyreportv1alpha2.PolicyReportResult) {
r.Spec.Results = results
}
func (r *ClusterBackgroundScanReport) SetSummary(summary policyreportv1alpha2.PolicyReportSummary) {
r.Spec.Summary = summary
}
// +kubebuilder:object:root=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// BackgroundScanReportList contains a list of BackgroundScanReport
type BackgroundScanReportList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []BackgroundScanReport `json:"items"`
}
// +kubebuilder:object:root=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ClusterBackgroundScanReportList contains a list of ClusterBackgroundScanReport
type ClusterBackgroundScanReportList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ClusterBackgroundScanReport `json:"items"`
}

View file

@ -21,7 +21,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
type AdmissionReportSpec struct {
type EphemeralReportSpec struct {
// Owner is a reference to the report owner (e.g. a Deployment, Namespace, or Node)
Owner metav1.OwnerReference `json:"owner"`
@ -49,22 +49,22 @@ type AdmissionReportSpec struct {
// +kubebuilder:printcolumn:name="REF",type=string,JSONPath=".metadata.labels['audit\\.kyverno\\.io/resource\\.name']"
// +kubebuilder:printcolumn:name="AGGREGATE",type=string,JSONPath=".metadata.labels['audit\\.kyverno\\.io/report\\.aggregate']",priority=1
// AdmissionReport is the Schema for the AdmissionReports API
type AdmissionReport struct {
// EphemeralReport is the Schema for the EphemeralReports API
type EphemeralReport struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec AdmissionReportSpec `json:"spec"`
Spec EphemeralReportSpec `json:"spec"`
}
func (r *AdmissionReport) GetResults() []policyreportv1alpha2.PolicyReportResult {
func (r *EphemeralReport) GetResults() []policyreportv1alpha2.PolicyReportResult {
return r.Spec.Results
}
func (r *AdmissionReport) SetResults(results []policyreportv1alpha2.PolicyReportResult) {
func (r *EphemeralReport) SetResults(results []policyreportv1alpha2.PolicyReportResult) {
r.Spec.Results = results
}
func (r *AdmissionReport) SetSummary(summary policyreportv1alpha2.PolicyReportSummary) {
func (r *EphemeralReport) SetSummary(summary policyreportv1alpha2.PolicyReportSummary) {
r.Spec.Summary = summary
}
@ -84,41 +84,41 @@ func (r *AdmissionReport) SetSummary(summary policyreportv1alpha2.PolicyReportSu
// +kubebuilder:printcolumn:name="REF",type=string,JSONPath=".metadata.labels['audit\\.kyverno\\.io/resource\\.name']"
// +kubebuilder:printcolumn:name="AGGREGATE",type=string,JSONPath=".metadata.labels['audit\\.kyverno\\.io/report\\.aggregate']",priority=1
// ClusterAdmissionReport is the Schema for the ClusterAdmissionReports API
type ClusterAdmissionReport struct {
// ClusterEphemeralReport is the Schema for the ClusterEphemeralReports API
type ClusterEphemeralReport struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec AdmissionReportSpec `json:"spec"`
Spec EphemeralReportSpec `json:"spec"`
}
func (r *ClusterAdmissionReport) GetResults() []policyreportv1alpha2.PolicyReportResult {
func (r *ClusterEphemeralReport) GetResults() []policyreportv1alpha2.PolicyReportResult {
return r.Spec.Results
}
func (r *ClusterAdmissionReport) SetResults(results []policyreportv1alpha2.PolicyReportResult) {
func (r *ClusterEphemeralReport) SetResults(results []policyreportv1alpha2.PolicyReportResult) {
r.Spec.Results = results
}
func (r *ClusterAdmissionReport) SetSummary(summary policyreportv1alpha2.PolicyReportSummary) {
func (r *ClusterEphemeralReport) SetSummary(summary policyreportv1alpha2.PolicyReportSummary) {
r.Spec.Summary = summary
}
// +kubebuilder:object:root=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// AdmissionReportList contains a list of AdmissionReport
type AdmissionReportList struct {
// EphemeralReportList contains a list of EphemeralReport
type EphemeralReportList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []AdmissionReport `json:"items"`
Items []EphemeralReport `json:"items"`
}
// +kubebuilder:object:root=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ClusterAdmissionReportList contains a list of ClusterAdmissionReport
type ClusterAdmissionReportList struct {
// ClusterEphemeralReportList contains a list of ClusterEphemeralReport
type ClusterEphemeralReportList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ClusterAdmissionReport `json:"items"`
Items []ClusterEphemeralReport `json:"items"`
}

View file

@ -27,7 +27,7 @@ import (
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AdmissionReport) DeepCopyInto(out *AdmissionReport) {
func (in *ClusterEphemeralReport) DeepCopyInto(out *ClusterEphemeralReport) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
@ -35,18 +35,18 @@ func (in *AdmissionReport) DeepCopyInto(out *AdmissionReport) {
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdmissionReport.
func (in *AdmissionReport) DeepCopy() *AdmissionReport {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterEphemeralReport.
func (in *ClusterEphemeralReport) DeepCopy() *ClusterEphemeralReport {
if in == nil {
return nil
}
out := new(AdmissionReport)
out := new(ClusterEphemeralReport)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *AdmissionReport) DeepCopyObject() runtime.Object {
func (in *ClusterEphemeralReport) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
@ -54,13 +54,13 @@ func (in *AdmissionReport) DeepCopyObject() runtime.Object {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AdmissionReportList) DeepCopyInto(out *AdmissionReportList) {
func (in *ClusterEphemeralReportList) DeepCopyInto(out *ClusterEphemeralReportList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]AdmissionReport, len(*in))
*out = make([]ClusterEphemeralReport, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
@ -68,18 +68,18 @@ func (in *AdmissionReportList) DeepCopyInto(out *AdmissionReportList) {
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdmissionReportList.
func (in *AdmissionReportList) DeepCopy() *AdmissionReportList {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterEphemeralReportList.
func (in *ClusterEphemeralReportList) DeepCopy() *ClusterEphemeralReportList {
if in == nil {
return nil
}
out := new(AdmissionReportList)
out := new(ClusterEphemeralReportList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *AdmissionReportList) DeepCopyObject() runtime.Object {
func (in *ClusterEphemeralReportList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
@ -87,7 +87,67 @@ func (in *AdmissionReportList) DeepCopyObject() runtime.Object {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AdmissionReportSpec) DeepCopyInto(out *AdmissionReportSpec) {
func (in *EphemeralReport) DeepCopyInto(out *EphemeralReport) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EphemeralReport.
func (in *EphemeralReport) DeepCopy() *EphemeralReport {
if in == nil {
return nil
}
out := new(EphemeralReport)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *EphemeralReport) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *EphemeralReportList) DeepCopyInto(out *EphemeralReportList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]EphemeralReport, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EphemeralReportList.
func (in *EphemeralReportList) DeepCopy() *EphemeralReportList {
if in == nil {
return nil
}
out := new(EphemeralReportList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *EphemeralReportList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *EphemeralReportSpec) DeepCopyInto(out *EphemeralReportSpec) {
*out = *in
in.Owner.DeepCopyInto(&out.Owner)
out.Summary = in.Summary
@ -101,216 +161,12 @@ func (in *AdmissionReportSpec) DeepCopyInto(out *AdmissionReportSpec) {
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdmissionReportSpec.
func (in *AdmissionReportSpec) DeepCopy() *AdmissionReportSpec {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EphemeralReportSpec.
func (in *EphemeralReportSpec) DeepCopy() *EphemeralReportSpec {
if in == nil {
return nil
}
out := new(AdmissionReportSpec)
out := new(EphemeralReportSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *BackgroundScanReport) DeepCopyInto(out *BackgroundScanReport) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackgroundScanReport.
func (in *BackgroundScanReport) DeepCopy() *BackgroundScanReport {
if in == nil {
return nil
}
out := new(BackgroundScanReport)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *BackgroundScanReport) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *BackgroundScanReportList) DeepCopyInto(out *BackgroundScanReportList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]BackgroundScanReport, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackgroundScanReportList.
func (in *BackgroundScanReportList) DeepCopy() *BackgroundScanReportList {
if in == nil {
return nil
}
out := new(BackgroundScanReportList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *BackgroundScanReportList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *BackgroundScanReportSpec) DeepCopyInto(out *BackgroundScanReportSpec) {
*out = *in
out.Summary = in.Summary
if in.Results != nil {
in, out := &in.Results, &out.Results
*out = make([]v1alpha2.PolicyReportResult, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackgroundScanReportSpec.
func (in *BackgroundScanReportSpec) DeepCopy() *BackgroundScanReportSpec {
if in == nil {
return nil
}
out := new(BackgroundScanReportSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterAdmissionReport) DeepCopyInto(out *ClusterAdmissionReport) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAdmissionReport.
func (in *ClusterAdmissionReport) DeepCopy() *ClusterAdmissionReport {
if in == nil {
return nil
}
out := new(ClusterAdmissionReport)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ClusterAdmissionReport) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterAdmissionReportList) DeepCopyInto(out *ClusterAdmissionReportList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]ClusterAdmissionReport, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAdmissionReportList.
func (in *ClusterAdmissionReportList) DeepCopy() *ClusterAdmissionReportList {
if in == nil {
return nil
}
out := new(ClusterAdmissionReportList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ClusterAdmissionReportList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterBackgroundScanReport) DeepCopyInto(out *ClusterBackgroundScanReport) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterBackgroundScanReport.
func (in *ClusterBackgroundScanReport) DeepCopy() *ClusterBackgroundScanReport {
if in == nil {
return nil
}
out := new(ClusterBackgroundScanReport)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ClusterBackgroundScanReport) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterBackgroundScanReportList) DeepCopyInto(out *ClusterBackgroundScanReportList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]ClusterBackgroundScanReport, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterBackgroundScanReportList.
func (in *ClusterBackgroundScanReportList) DeepCopy() *ClusterBackgroundScanReportList {
if in == nil {
return nil
}
out := new(ClusterBackgroundScanReportList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ClusterBackgroundScanReportList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}

View file

@ -58,14 +58,10 @@ func init() {
// Adds the list of known types to Scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&AdmissionReport{},
&AdmissionReportList{},
&BackgroundScanReport{},
&BackgroundScanReportList{},
&ClusterAdmissionReport{},
&ClusterAdmissionReportList{},
&ClusterBackgroundScanReport{},
&ClusterBackgroundScanReportList{},
&ClusterEphemeralReport{},
&ClusterEphemeralReportList{},
&EphemeralReport{},
&EphemeralReportList{},
)
// AddToGroupVersion allows the serialization of client types like ListOptions.
v1.AddToGroupVersion(scheme, SchemeGroupVersion)

View file

@ -10230,19 +10230,15 @@ CEL
</p>
Resource Types:
<ul><li>
<a href="#reports.kyverno.io/v1.AdmissionReport">AdmissionReport</a>
<a href="#reports.kyverno.io/v1.ClusterEphemeralReport">ClusterEphemeralReport</a>
</li><li>
<a href="#reports.kyverno.io/v1.BackgroundScanReport">BackgroundScanReport</a>
</li><li>
<a href="#reports.kyverno.io/v1.ClusterAdmissionReport">ClusterAdmissionReport</a>
</li><li>
<a href="#reports.kyverno.io/v1.ClusterBackgroundScanReport">ClusterBackgroundScanReport</a>
<a href="#reports.kyverno.io/v1.EphemeralReport">EphemeralReport</a>
</li></ul>
<hr />
<h3 id="reports.kyverno.io/v1.AdmissionReport">AdmissionReport
<h3 id="reports.kyverno.io/v1.ClusterEphemeralReport">ClusterEphemeralReport
</h3>
<p>
<p>AdmissionReport is the Schema for the AdmissionReports API</p>
<p>ClusterEphemeralReport is the Schema for the ClusterEphemeralReports API</p>
</p>
<table class="table table-striped">
<thead class="thead-dark">
@ -10267,7 +10263,7 @@ reports.kyverno.io/v1
<code>kind</code><br/>
string
</td>
<td><code>AdmissionReport</code></td>
<td><code>ClusterEphemeralReport</code></td>
</tr>
<tr>
<td>
@ -10287,8 +10283,8 @@ Refer to the Kubernetes API documentation for the fields of the
<td>
<code>spec</code><br/>
<em>
<a href="#reports.kyverno.io/v1.AdmissionReportSpec">
AdmissionReportSpec
<a href="#reports.kyverno.io/v1.EphemeralReportSpec">
EphemeralReportSpec
</a>
</em>
</td>
@ -10343,10 +10339,10 @@ PolicyReportSummary
</tbody>
</table>
<hr />
<h3 id="reports.kyverno.io/v1.BackgroundScanReport">BackgroundScanReport
<h3 id="reports.kyverno.io/v1.EphemeralReport">EphemeralReport
</h3>
<p>
<p>BackgroundScanReport is the Schema for the BackgroundScanReports API</p>
<p>EphemeralReport is the Schema for the EphemeralReports API</p>
</p>
<table class="table table-striped">
<thead class="thead-dark">
@ -10371,7 +10367,7 @@ reports.kyverno.io/v1
<code>kind</code><br/>
string
</td>
<td><code>BackgroundScanReport</code></td>
<td><code>EphemeralReport</code></td>
</tr>
<tr>
<td>
@ -10391,99 +10387,8 @@ Refer to the Kubernetes API documentation for the fields of the
<td>
<code>spec</code><br/>
<em>
<a href="#reports.kyverno.io/v1.BackgroundScanReportSpec">
BackgroundScanReportSpec
</a>
</em>
</td>
<td>
<br/>
<br/>
<table class="table table-striped">
<tr>
<td>
<code>summary</code><br/>
<em>
<a href="#wgpolicyk8s.io/v1alpha2.PolicyReportSummary">
PolicyReportSummary
</a>
</em>
</td>
<td>
<em>(Optional)</em>
<p>PolicyReportSummary provides a summary of results</p>
</td>
</tr>
<tr>
<td>
<code>results</code><br/>
<em>
<a href="#wgpolicyk8s.io/v1alpha2.PolicyReportResult">
[]PolicyReportResult
</a>
</em>
</td>
<td>
<em>(Optional)</em>
<p>PolicyReportResult provides result details</p>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
<hr />
<h3 id="reports.kyverno.io/v1.ClusterAdmissionReport">ClusterAdmissionReport
</h3>
<p>
<p>ClusterAdmissionReport is the Schema for the ClusterAdmissionReports API</p>
</p>
<table class="table table-striped">
<thead class="thead-dark">
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>apiVersion</code><br/>
string</td>
<td>
<code>
reports.kyverno.io/v1
</code>
</td>
</tr>
<tr>
<td>
<code>kind</code><br/>
string
</td>
<td><code>ClusterAdmissionReport</code></td>
</tr>
<tr>
<td>
<code>metadata</code><br/>
<em>
<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#objectmeta-v1-meta">
Kubernetes meta/v1.ObjectMeta
</a>
</em>
</td>
<td>
Refer to the Kubernetes API documentation for the fields of the
<code>metadata</code> field.
</td>
</tr>
<tr>
<td>
<code>spec</code><br/>
<em>
<a href="#reports.kyverno.io/v1.AdmissionReportSpec">
AdmissionReportSpec
<a href="#reports.kyverno.io/v1.EphemeralReportSpec">
EphemeralReportSpec
</a>
</em>
</td>
@ -10538,103 +10443,12 @@ PolicyReportSummary
</tbody>
</table>
<hr />
<h3 id="reports.kyverno.io/v1.ClusterBackgroundScanReport">ClusterBackgroundScanReport
</h3>
<p>
<p>ClusterBackgroundScanReport is the Schema for the ClusterBackgroundScanReports API</p>
</p>
<table class="table table-striped">
<thead class="thead-dark">
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>apiVersion</code><br/>
string</td>
<td>
<code>
reports.kyverno.io/v1
</code>
</td>
</tr>
<tr>
<td>
<code>kind</code><br/>
string
</td>
<td><code>ClusterBackgroundScanReport</code></td>
</tr>
<tr>
<td>
<code>metadata</code><br/>
<em>
<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#objectmeta-v1-meta">
Kubernetes meta/v1.ObjectMeta
</a>
</em>
</td>
<td>
Refer to the Kubernetes API documentation for the fields of the
<code>metadata</code> field.
</td>
</tr>
<tr>
<td>
<code>spec</code><br/>
<em>
<a href="#reports.kyverno.io/v1.BackgroundScanReportSpec">
BackgroundScanReportSpec
</a>
</em>
</td>
<td>
<br/>
<br/>
<table class="table table-striped">
<tr>
<td>
<code>summary</code><br/>
<em>
<a href="#wgpolicyk8s.io/v1alpha2.PolicyReportSummary">
PolicyReportSummary
</a>
</em>
</td>
<td>
<em>(Optional)</em>
<p>PolicyReportSummary provides a summary of results</p>
</td>
</tr>
<tr>
<td>
<code>results</code><br/>
<em>
<a href="#wgpolicyk8s.io/v1alpha2.PolicyReportResult">
[]PolicyReportResult
</a>
</em>
</td>
<td>
<em>(Optional)</em>
<p>PolicyReportResult provides result details</p>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
<hr />
<h3 id="reports.kyverno.io/v1.AdmissionReportSpec">AdmissionReportSpec
<h3 id="reports.kyverno.io/v1.EphemeralReportSpec">EphemeralReportSpec
</h3>
<p>
(<em>Appears on:</em>
<a href="#reports.kyverno.io/v1.AdmissionReport">AdmissionReport</a>,
<a href="#reports.kyverno.io/v1.ClusterAdmissionReport">ClusterAdmissionReport</a>)
<a href="#reports.kyverno.io/v1.ClusterEphemeralReport">ClusterEphemeralReport</a>,
<a href="#reports.kyverno.io/v1.EphemeralReport">EphemeralReport</a>)
</p>
<p>
</p>
@ -10690,54 +10504,6 @@ PolicyReportSummary
</tbody>
</table>
<hr />
<h3 id="reports.kyverno.io/v1.BackgroundScanReportSpec">BackgroundScanReportSpec
</h3>
<p>
(<em>Appears on:</em>
<a href="#reports.kyverno.io/v1.BackgroundScanReport">BackgroundScanReport</a>,
<a href="#reports.kyverno.io/v1.ClusterBackgroundScanReport">ClusterBackgroundScanReport</a>)
</p>
<p>
</p>
<table class="table table-striped">
<thead class="thead-dark">
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>summary</code><br/>
<em>
<a href="#wgpolicyk8s.io/v1alpha2.PolicyReportSummary">
PolicyReportSummary
</a>
</em>
</td>
<td>
<em>(Optional)</em>
<p>PolicyReportSummary provides a summary of results</p>
</td>
</tr>
<tr>
<td>
<code>results</code><br/>
<em>
<a href="#wgpolicyk8s.io/v1alpha2.PolicyReportResult">
[]PolicyReportResult
</a>
</em>
</td>
<td>
<em>(Optional)</em>
<p>PolicyReportResult provides result details</p>
</td>
</tr>
</tbody>
</table>
<hr />
<h2 id="wgpolicyk8s.io/v1alpha2">wgpolicyk8s.io/v1alpha2</h2>
Resource Types:
<ul><li>
@ -10962,8 +10728,7 @@ PolicyReportSummary
<a href="#wgpolicyk8s.io/v1alpha2.PolicyReport">PolicyReport</a>,
<a href="#kyverno.io/v2.AdmissionReportSpec">AdmissionReportSpec</a>,
<a href="#kyverno.io/v2.BackgroundScanReportSpec">BackgroundScanReportSpec</a>,
<a href="#reports.kyverno.io/v1.AdmissionReportSpec">AdmissionReportSpec</a>,
<a href="#reports.kyverno.io/v1.BackgroundScanReportSpec">BackgroundScanReportSpec</a>)
<a href="#reports.kyverno.io/v1.EphemeralReportSpec">EphemeralReportSpec</a>)
</p>
<p>
<p>PolicyReportResult provides the result for an individual policy</p>
@ -11138,8 +10903,7 @@ PolicySeverity
<a href="#wgpolicyk8s.io/v1alpha2.PolicyReport">PolicyReport</a>,
<a href="#kyverno.io/v2.AdmissionReportSpec">AdmissionReportSpec</a>,
<a href="#kyverno.io/v2.BackgroundScanReportSpec">BackgroundScanReportSpec</a>,
<a href="#reports.kyverno.io/v1.AdmissionReportSpec">AdmissionReportSpec</a>,
<a href="#reports.kyverno.io/v1.BackgroundScanReportSpec">BackgroundScanReportSpec</a>)
<a href="#reports.kyverno.io/v1.EphemeralReportSpec">EphemeralReportSpec</a>)
</p>
<p>
<p>PolicyReportSummary provides a status count summary</p>

View file

@ -1,210 +0,0 @@
/*
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 v1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// BackgroundScanReportApplyConfiguration represents an declarative configuration of the BackgroundScanReport type for use
// with apply.
type BackgroundScanReportApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Spec *BackgroundScanReportSpecApplyConfiguration `json:"spec,omitempty"`
}
// BackgroundScanReport constructs an declarative configuration of the BackgroundScanReport type for use with
// apply.
func BackgroundScanReport(name, namespace string) *BackgroundScanReportApplyConfiguration {
b := &BackgroundScanReportApplyConfiguration{}
b.WithName(name)
b.WithNamespace(namespace)
b.WithKind("BackgroundScanReport")
b.WithAPIVersion("reports.kyverno.io/v1")
return b
}
// WithKind sets the Kind 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 Kind field is set to the value of the last call.
func (b *BackgroundScanReportApplyConfiguration) WithKind(value string) *BackgroundScanReportApplyConfiguration {
b.Kind = &value
return b
}
// WithAPIVersion sets the APIVersion 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 APIVersion field is set to the value of the last call.
func (b *BackgroundScanReportApplyConfiguration) WithAPIVersion(value string) *BackgroundScanReportApplyConfiguration {
b.APIVersion = &value
return b
}
// 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 *BackgroundScanReportApplyConfiguration) WithName(value string) *BackgroundScanReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.Name = &value
return b
}
// WithGenerateName sets the GenerateName 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 GenerateName field is set to the value of the last call.
func (b *BackgroundScanReportApplyConfiguration) WithGenerateName(value string) *BackgroundScanReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.GenerateName = &value
return b
}
// WithNamespace sets the Namespace 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 Namespace field is set to the value of the last call.
func (b *BackgroundScanReportApplyConfiguration) WithNamespace(value string) *BackgroundScanReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.Namespace = &value
return b
}
// WithUID sets the UID 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 UID field is set to the value of the last call.
func (b *BackgroundScanReportApplyConfiguration) WithUID(value types.UID) *BackgroundScanReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.UID = &value
return b
}
// WithResourceVersion sets the ResourceVersion 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 ResourceVersion field is set to the value of the last call.
func (b *BackgroundScanReportApplyConfiguration) WithResourceVersion(value string) *BackgroundScanReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ResourceVersion = &value
return b
}
// WithGeneration sets the Generation 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 Generation field is set to the value of the last call.
func (b *BackgroundScanReportApplyConfiguration) WithGeneration(value int64) *BackgroundScanReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.Generation = &value
return b
}
// WithCreationTimestamp sets the CreationTimestamp 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 CreationTimestamp field is set to the value of the last call.
func (b *BackgroundScanReportApplyConfiguration) WithCreationTimestamp(value metav1.Time) *BackgroundScanReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.CreationTimestamp = &value
return b
}
// WithDeletionTimestamp sets the DeletionTimestamp 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 DeletionTimestamp field is set to the value of the last call.
func (b *BackgroundScanReportApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *BackgroundScanReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.DeletionTimestamp = &value
return b
}
// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds 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 DeletionGracePeriodSeconds field is set to the value of the last call.
func (b *BackgroundScanReportApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *BackgroundScanReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.DeletionGracePeriodSeconds = &value
return b
}
// WithLabels puts the entries into the Labels 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 Labels field,
// overwriting an existing map entries in Labels field with the same key.
func (b *BackgroundScanReportApplyConfiguration) WithLabels(entries map[string]string) *BackgroundScanReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
if b.Labels == nil && len(entries) > 0 {
b.Labels = make(map[string]string, len(entries))
}
for k, v := range entries {
b.Labels[k] = v
}
return b
}
// WithAnnotations puts the entries into the Annotations 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 Annotations field,
// overwriting an existing map entries in Annotations field with the same key.
func (b *BackgroundScanReportApplyConfiguration) WithAnnotations(entries map[string]string) *BackgroundScanReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
if b.Annotations == nil && len(entries) > 0 {
b.Annotations = make(map[string]string, len(entries))
}
for k, v := range entries {
b.Annotations[k] = v
}
return b
}
// WithOwnerReferences adds the given value to the OwnerReferences 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 OwnerReferences field.
func (b *BackgroundScanReportApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *BackgroundScanReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
if values[i] == nil {
panic("nil value passed to WithOwnerReferences")
}
b.OwnerReferences = append(b.OwnerReferences, *values[i])
}
return b
}
// WithFinalizers adds the given value to the Finalizers 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 Finalizers field.
func (b *BackgroundScanReportApplyConfiguration) WithFinalizers(values ...string) *BackgroundScanReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
b.Finalizers = append(b.Finalizers, values[i])
}
return b
}
func (b *BackgroundScanReportApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
if b.ObjectMetaApplyConfiguration == nil {
b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
}
}
// WithSpec sets the Spec 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 Spec field is set to the value of the last call.
func (b *BackgroundScanReportApplyConfiguration) WithSpec(value *BackgroundScanReportSpecApplyConfiguration) *BackgroundScanReportApplyConfiguration {
b.Spec = value
return b
}

View file

@ -1,57 +0,0 @@
/*
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 v1
import (
v1alpha2 "github.com/kyverno/kyverno/pkg/client/applyconfigurations/policyreport/v1alpha2"
)
// BackgroundScanReportSpecApplyConfiguration represents an declarative configuration of the BackgroundScanReportSpec type for use
// with apply.
type BackgroundScanReportSpecApplyConfiguration struct {
Summary *v1alpha2.PolicyReportSummaryApplyConfiguration `json:"summary,omitempty"`
Results []v1alpha2.PolicyReportResultApplyConfiguration `json:"results,omitempty"`
}
// BackgroundScanReportSpecApplyConfiguration constructs an declarative configuration of the BackgroundScanReportSpec type for use with
// apply.
func BackgroundScanReportSpec() *BackgroundScanReportSpecApplyConfiguration {
return &BackgroundScanReportSpecApplyConfiguration{}
}
// WithSummary sets the Summary 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 Summary field is set to the value of the last call.
func (b *BackgroundScanReportSpecApplyConfiguration) WithSummary(value *v1alpha2.PolicyReportSummaryApplyConfiguration) *BackgroundScanReportSpecApplyConfiguration {
b.Summary = value
return b
}
// WithResults adds the given value to the Results 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 Results field.
func (b *BackgroundScanReportSpecApplyConfiguration) WithResults(values ...*v1alpha2.PolicyReportResultApplyConfiguration) *BackgroundScanReportSpecApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithResults")
}
b.Results = append(b.Results, *values[i])
}
return b
}

View file

@ -1,209 +0,0 @@
/*
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 v1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// ClusterBackgroundScanReportApplyConfiguration represents an declarative configuration of the ClusterBackgroundScanReport type for use
// with apply.
type ClusterBackgroundScanReportApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Spec *BackgroundScanReportSpecApplyConfiguration `json:"spec,omitempty"`
}
// ClusterBackgroundScanReport constructs an declarative configuration of the ClusterBackgroundScanReport type for use with
// apply.
func ClusterBackgroundScanReport(name string) *ClusterBackgroundScanReportApplyConfiguration {
b := &ClusterBackgroundScanReportApplyConfiguration{}
b.WithName(name)
b.WithKind("ClusterBackgroundScanReport")
b.WithAPIVersion("reports.kyverno.io/v1")
return b
}
// WithKind sets the Kind 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 Kind field is set to the value of the last call.
func (b *ClusterBackgroundScanReportApplyConfiguration) WithKind(value string) *ClusterBackgroundScanReportApplyConfiguration {
b.Kind = &value
return b
}
// WithAPIVersion sets the APIVersion 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 APIVersion field is set to the value of the last call.
func (b *ClusterBackgroundScanReportApplyConfiguration) WithAPIVersion(value string) *ClusterBackgroundScanReportApplyConfiguration {
b.APIVersion = &value
return b
}
// 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 *ClusterBackgroundScanReportApplyConfiguration) WithName(value string) *ClusterBackgroundScanReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.Name = &value
return b
}
// WithGenerateName sets the GenerateName 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 GenerateName field is set to the value of the last call.
func (b *ClusterBackgroundScanReportApplyConfiguration) WithGenerateName(value string) *ClusterBackgroundScanReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.GenerateName = &value
return b
}
// WithNamespace sets the Namespace 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 Namespace field is set to the value of the last call.
func (b *ClusterBackgroundScanReportApplyConfiguration) WithNamespace(value string) *ClusterBackgroundScanReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.Namespace = &value
return b
}
// WithUID sets the UID 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 UID field is set to the value of the last call.
func (b *ClusterBackgroundScanReportApplyConfiguration) WithUID(value types.UID) *ClusterBackgroundScanReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.UID = &value
return b
}
// WithResourceVersion sets the ResourceVersion 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 ResourceVersion field is set to the value of the last call.
func (b *ClusterBackgroundScanReportApplyConfiguration) WithResourceVersion(value string) *ClusterBackgroundScanReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ResourceVersion = &value
return b
}
// WithGeneration sets the Generation 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 Generation field is set to the value of the last call.
func (b *ClusterBackgroundScanReportApplyConfiguration) WithGeneration(value int64) *ClusterBackgroundScanReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.Generation = &value
return b
}
// WithCreationTimestamp sets the CreationTimestamp 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 CreationTimestamp field is set to the value of the last call.
func (b *ClusterBackgroundScanReportApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ClusterBackgroundScanReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.CreationTimestamp = &value
return b
}
// WithDeletionTimestamp sets the DeletionTimestamp 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 DeletionTimestamp field is set to the value of the last call.
func (b *ClusterBackgroundScanReportApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ClusterBackgroundScanReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.DeletionTimestamp = &value
return b
}
// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds 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 DeletionGracePeriodSeconds field is set to the value of the last call.
func (b *ClusterBackgroundScanReportApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ClusterBackgroundScanReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.DeletionGracePeriodSeconds = &value
return b
}
// WithLabels puts the entries into the Labels 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 Labels field,
// overwriting an existing map entries in Labels field with the same key.
func (b *ClusterBackgroundScanReportApplyConfiguration) WithLabels(entries map[string]string) *ClusterBackgroundScanReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
if b.Labels == nil && len(entries) > 0 {
b.Labels = make(map[string]string, len(entries))
}
for k, v := range entries {
b.Labels[k] = v
}
return b
}
// WithAnnotations puts the entries into the Annotations 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 Annotations field,
// overwriting an existing map entries in Annotations field with the same key.
func (b *ClusterBackgroundScanReportApplyConfiguration) WithAnnotations(entries map[string]string) *ClusterBackgroundScanReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
if b.Annotations == nil && len(entries) > 0 {
b.Annotations = make(map[string]string, len(entries))
}
for k, v := range entries {
b.Annotations[k] = v
}
return b
}
// WithOwnerReferences adds the given value to the OwnerReferences 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 OwnerReferences field.
func (b *ClusterBackgroundScanReportApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ClusterBackgroundScanReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
if values[i] == nil {
panic("nil value passed to WithOwnerReferences")
}
b.OwnerReferences = append(b.OwnerReferences, *values[i])
}
return b
}
// WithFinalizers adds the given value to the Finalizers 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 Finalizers field.
func (b *ClusterBackgroundScanReportApplyConfiguration) WithFinalizers(values ...string) *ClusterBackgroundScanReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
b.Finalizers = append(b.Finalizers, values[i])
}
return b
}
func (b *ClusterBackgroundScanReportApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
if b.ObjectMetaApplyConfiguration == nil {
b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
}
}
// WithSpec sets the Spec 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 Spec field is set to the value of the last call.
func (b *ClusterBackgroundScanReportApplyConfiguration) WithSpec(value *BackgroundScanReportSpecApplyConfiguration) *ClusterBackgroundScanReportApplyConfiguration {
b.Spec = value
return b
}

View file

@ -24,20 +24,20 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// ClusterAdmissionReportApplyConfiguration represents an declarative configuration of the ClusterAdmissionReport type for use
// ClusterEphemeralReportApplyConfiguration represents an declarative configuration of the ClusterEphemeralReport type for use
// with apply.
type ClusterAdmissionReportApplyConfiguration struct {
type ClusterEphemeralReportApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Spec *AdmissionReportSpecApplyConfiguration `json:"spec,omitempty"`
Spec *EphemeralReportSpecApplyConfiguration `json:"spec,omitempty"`
}
// ClusterAdmissionReport constructs an declarative configuration of the ClusterAdmissionReport type for use with
// ClusterEphemeralReport constructs an declarative configuration of the ClusterEphemeralReport type for use with
// apply.
func ClusterAdmissionReport(name string) *ClusterAdmissionReportApplyConfiguration {
b := &ClusterAdmissionReportApplyConfiguration{}
func ClusterEphemeralReport(name string) *ClusterEphemeralReportApplyConfiguration {
b := &ClusterEphemeralReportApplyConfiguration{}
b.WithName(name)
b.WithKind("ClusterAdmissionReport")
b.WithKind("ClusterEphemeralReport")
b.WithAPIVersion("reports.kyverno.io/v1")
return b
}
@ -45,7 +45,7 @@ func ClusterAdmissionReport(name string) *ClusterAdmissionReportApplyConfigurati
// WithKind sets the Kind 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 Kind field is set to the value of the last call.
func (b *ClusterAdmissionReportApplyConfiguration) WithKind(value string) *ClusterAdmissionReportApplyConfiguration {
func (b *ClusterEphemeralReportApplyConfiguration) WithKind(value string) *ClusterEphemeralReportApplyConfiguration {
b.Kind = &value
return b
}
@ -53,7 +53,7 @@ func (b *ClusterAdmissionReportApplyConfiguration) WithKind(value string) *Clust
// WithAPIVersion sets the APIVersion 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 APIVersion field is set to the value of the last call.
func (b *ClusterAdmissionReportApplyConfiguration) WithAPIVersion(value string) *ClusterAdmissionReportApplyConfiguration {
func (b *ClusterEphemeralReportApplyConfiguration) WithAPIVersion(value string) *ClusterEphemeralReportApplyConfiguration {
b.APIVersion = &value
return b
}
@ -61,7 +61,7 @@ func (b *ClusterAdmissionReportApplyConfiguration) WithAPIVersion(value string)
// 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 *ClusterAdmissionReportApplyConfiguration) WithName(value string) *ClusterAdmissionReportApplyConfiguration {
func (b *ClusterEphemeralReportApplyConfiguration) WithName(value string) *ClusterEphemeralReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.Name = &value
return b
@ -70,7 +70,7 @@ func (b *ClusterAdmissionReportApplyConfiguration) WithName(value string) *Clust
// WithGenerateName sets the GenerateName 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 GenerateName field is set to the value of the last call.
func (b *ClusterAdmissionReportApplyConfiguration) WithGenerateName(value string) *ClusterAdmissionReportApplyConfiguration {
func (b *ClusterEphemeralReportApplyConfiguration) WithGenerateName(value string) *ClusterEphemeralReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.GenerateName = &value
return b
@ -79,7 +79,7 @@ func (b *ClusterAdmissionReportApplyConfiguration) WithGenerateName(value string
// WithNamespace sets the Namespace 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 Namespace field is set to the value of the last call.
func (b *ClusterAdmissionReportApplyConfiguration) WithNamespace(value string) *ClusterAdmissionReportApplyConfiguration {
func (b *ClusterEphemeralReportApplyConfiguration) WithNamespace(value string) *ClusterEphemeralReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.Namespace = &value
return b
@ -88,7 +88,7 @@ func (b *ClusterAdmissionReportApplyConfiguration) WithNamespace(value string) *
// WithUID sets the UID 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 UID field is set to the value of the last call.
func (b *ClusterAdmissionReportApplyConfiguration) WithUID(value types.UID) *ClusterAdmissionReportApplyConfiguration {
func (b *ClusterEphemeralReportApplyConfiguration) WithUID(value types.UID) *ClusterEphemeralReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.UID = &value
return b
@ -97,7 +97,7 @@ func (b *ClusterAdmissionReportApplyConfiguration) WithUID(value types.UID) *Clu
// WithResourceVersion sets the ResourceVersion 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 ResourceVersion field is set to the value of the last call.
func (b *ClusterAdmissionReportApplyConfiguration) WithResourceVersion(value string) *ClusterAdmissionReportApplyConfiguration {
func (b *ClusterEphemeralReportApplyConfiguration) WithResourceVersion(value string) *ClusterEphemeralReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ResourceVersion = &value
return b
@ -106,7 +106,7 @@ func (b *ClusterAdmissionReportApplyConfiguration) WithResourceVersion(value str
// WithGeneration sets the Generation 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 Generation field is set to the value of the last call.
func (b *ClusterAdmissionReportApplyConfiguration) WithGeneration(value int64) *ClusterAdmissionReportApplyConfiguration {
func (b *ClusterEphemeralReportApplyConfiguration) WithGeneration(value int64) *ClusterEphemeralReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.Generation = &value
return b
@ -115,7 +115,7 @@ func (b *ClusterAdmissionReportApplyConfiguration) WithGeneration(value int64) *
// WithCreationTimestamp sets the CreationTimestamp 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 CreationTimestamp field is set to the value of the last call.
func (b *ClusterAdmissionReportApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ClusterAdmissionReportApplyConfiguration {
func (b *ClusterEphemeralReportApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ClusterEphemeralReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.CreationTimestamp = &value
return b
@ -124,7 +124,7 @@ func (b *ClusterAdmissionReportApplyConfiguration) WithCreationTimestamp(value m
// WithDeletionTimestamp sets the DeletionTimestamp 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 DeletionTimestamp field is set to the value of the last call.
func (b *ClusterAdmissionReportApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ClusterAdmissionReportApplyConfiguration {
func (b *ClusterEphemeralReportApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ClusterEphemeralReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.DeletionTimestamp = &value
return b
@ -133,7 +133,7 @@ func (b *ClusterAdmissionReportApplyConfiguration) WithDeletionTimestamp(value m
// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds 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 DeletionGracePeriodSeconds field is set to the value of the last call.
func (b *ClusterAdmissionReportApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ClusterAdmissionReportApplyConfiguration {
func (b *ClusterEphemeralReportApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ClusterEphemeralReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.DeletionGracePeriodSeconds = &value
return b
@ -143,7 +143,7 @@ func (b *ClusterAdmissionReportApplyConfiguration) WithDeletionGracePeriodSecond
// 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 Labels field,
// overwriting an existing map entries in Labels field with the same key.
func (b *ClusterAdmissionReportApplyConfiguration) WithLabels(entries map[string]string) *ClusterAdmissionReportApplyConfiguration {
func (b *ClusterEphemeralReportApplyConfiguration) WithLabels(entries map[string]string) *ClusterEphemeralReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
if b.Labels == nil && len(entries) > 0 {
b.Labels = make(map[string]string, len(entries))
@ -158,7 +158,7 @@ func (b *ClusterAdmissionReportApplyConfiguration) WithLabels(entries map[string
// 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 Annotations field,
// overwriting an existing map entries in Annotations field with the same key.
func (b *ClusterAdmissionReportApplyConfiguration) WithAnnotations(entries map[string]string) *ClusterAdmissionReportApplyConfiguration {
func (b *ClusterEphemeralReportApplyConfiguration) WithAnnotations(entries map[string]string) *ClusterEphemeralReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
if b.Annotations == nil && len(entries) > 0 {
b.Annotations = make(map[string]string, len(entries))
@ -172,7 +172,7 @@ func (b *ClusterAdmissionReportApplyConfiguration) WithAnnotations(entries map[s
// WithOwnerReferences adds the given value to the OwnerReferences 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 OwnerReferences field.
func (b *ClusterAdmissionReportApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ClusterAdmissionReportApplyConfiguration {
func (b *ClusterEphemeralReportApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ClusterEphemeralReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
if values[i] == nil {
@ -186,7 +186,7 @@ func (b *ClusterAdmissionReportApplyConfiguration) WithOwnerReferences(values ..
// WithFinalizers adds the given value to the Finalizers 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 Finalizers field.
func (b *ClusterAdmissionReportApplyConfiguration) WithFinalizers(values ...string) *ClusterAdmissionReportApplyConfiguration {
func (b *ClusterEphemeralReportApplyConfiguration) WithFinalizers(values ...string) *ClusterEphemeralReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
b.Finalizers = append(b.Finalizers, values[i])
@ -194,7 +194,7 @@ func (b *ClusterAdmissionReportApplyConfiguration) WithFinalizers(values ...stri
return b
}
func (b *ClusterAdmissionReportApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
func (b *ClusterEphemeralReportApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
if b.ObjectMetaApplyConfiguration == nil {
b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
}
@ -203,7 +203,7 @@ func (b *ClusterAdmissionReportApplyConfiguration) ensureObjectMetaApplyConfigur
// WithSpec sets the Spec 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 Spec field is set to the value of the last call.
func (b *ClusterAdmissionReportApplyConfiguration) WithSpec(value *AdmissionReportSpecApplyConfiguration) *ClusterAdmissionReportApplyConfiguration {
func (b *ClusterEphemeralReportApplyConfiguration) WithSpec(value *EphemeralReportSpecApplyConfiguration) *ClusterEphemeralReportApplyConfiguration {
b.Spec = value
return b
}

View file

@ -24,21 +24,21 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// AdmissionReportApplyConfiguration represents an declarative configuration of the AdmissionReport type for use
// EphemeralReportApplyConfiguration represents an declarative configuration of the EphemeralReport type for use
// with apply.
type AdmissionReportApplyConfiguration struct {
type EphemeralReportApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Spec *AdmissionReportSpecApplyConfiguration `json:"spec,omitempty"`
Spec *EphemeralReportSpecApplyConfiguration `json:"spec,omitempty"`
}
// AdmissionReport constructs an declarative configuration of the AdmissionReport type for use with
// EphemeralReport constructs an declarative configuration of the EphemeralReport type for use with
// apply.
func AdmissionReport(name, namespace string) *AdmissionReportApplyConfiguration {
b := &AdmissionReportApplyConfiguration{}
func EphemeralReport(name, namespace string) *EphemeralReportApplyConfiguration {
b := &EphemeralReportApplyConfiguration{}
b.WithName(name)
b.WithNamespace(namespace)
b.WithKind("AdmissionReport")
b.WithKind("EphemeralReport")
b.WithAPIVersion("reports.kyverno.io/v1")
return b
}
@ -46,7 +46,7 @@ func AdmissionReport(name, namespace string) *AdmissionReportApplyConfiguration
// WithKind sets the Kind 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 Kind field is set to the value of the last call.
func (b *AdmissionReportApplyConfiguration) WithKind(value string) *AdmissionReportApplyConfiguration {
func (b *EphemeralReportApplyConfiguration) WithKind(value string) *EphemeralReportApplyConfiguration {
b.Kind = &value
return b
}
@ -54,7 +54,7 @@ func (b *AdmissionReportApplyConfiguration) WithKind(value string) *AdmissionRep
// WithAPIVersion sets the APIVersion 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 APIVersion field is set to the value of the last call.
func (b *AdmissionReportApplyConfiguration) WithAPIVersion(value string) *AdmissionReportApplyConfiguration {
func (b *EphemeralReportApplyConfiguration) WithAPIVersion(value string) *EphemeralReportApplyConfiguration {
b.APIVersion = &value
return b
}
@ -62,7 +62,7 @@ func (b *AdmissionReportApplyConfiguration) WithAPIVersion(value string) *Admiss
// 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 *AdmissionReportApplyConfiguration) WithName(value string) *AdmissionReportApplyConfiguration {
func (b *EphemeralReportApplyConfiguration) WithName(value string) *EphemeralReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.Name = &value
return b
@ -71,7 +71,7 @@ func (b *AdmissionReportApplyConfiguration) WithName(value string) *AdmissionRep
// WithGenerateName sets the GenerateName 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 GenerateName field is set to the value of the last call.
func (b *AdmissionReportApplyConfiguration) WithGenerateName(value string) *AdmissionReportApplyConfiguration {
func (b *EphemeralReportApplyConfiguration) WithGenerateName(value string) *EphemeralReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.GenerateName = &value
return b
@ -80,7 +80,7 @@ func (b *AdmissionReportApplyConfiguration) WithGenerateName(value string) *Admi
// WithNamespace sets the Namespace 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 Namespace field is set to the value of the last call.
func (b *AdmissionReportApplyConfiguration) WithNamespace(value string) *AdmissionReportApplyConfiguration {
func (b *EphemeralReportApplyConfiguration) WithNamespace(value string) *EphemeralReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.Namespace = &value
return b
@ -89,7 +89,7 @@ func (b *AdmissionReportApplyConfiguration) WithNamespace(value string) *Admissi
// WithUID sets the UID 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 UID field is set to the value of the last call.
func (b *AdmissionReportApplyConfiguration) WithUID(value types.UID) *AdmissionReportApplyConfiguration {
func (b *EphemeralReportApplyConfiguration) WithUID(value types.UID) *EphemeralReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.UID = &value
return b
@ -98,7 +98,7 @@ func (b *AdmissionReportApplyConfiguration) WithUID(value types.UID) *AdmissionR
// WithResourceVersion sets the ResourceVersion 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 ResourceVersion field is set to the value of the last call.
func (b *AdmissionReportApplyConfiguration) WithResourceVersion(value string) *AdmissionReportApplyConfiguration {
func (b *EphemeralReportApplyConfiguration) WithResourceVersion(value string) *EphemeralReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ResourceVersion = &value
return b
@ -107,7 +107,7 @@ func (b *AdmissionReportApplyConfiguration) WithResourceVersion(value string) *A
// WithGeneration sets the Generation 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 Generation field is set to the value of the last call.
func (b *AdmissionReportApplyConfiguration) WithGeneration(value int64) *AdmissionReportApplyConfiguration {
func (b *EphemeralReportApplyConfiguration) WithGeneration(value int64) *EphemeralReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.Generation = &value
return b
@ -116,7 +116,7 @@ func (b *AdmissionReportApplyConfiguration) WithGeneration(value int64) *Admissi
// WithCreationTimestamp sets the CreationTimestamp 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 CreationTimestamp field is set to the value of the last call.
func (b *AdmissionReportApplyConfiguration) WithCreationTimestamp(value metav1.Time) *AdmissionReportApplyConfiguration {
func (b *EphemeralReportApplyConfiguration) WithCreationTimestamp(value metav1.Time) *EphemeralReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.CreationTimestamp = &value
return b
@ -125,7 +125,7 @@ func (b *AdmissionReportApplyConfiguration) WithCreationTimestamp(value metav1.T
// WithDeletionTimestamp sets the DeletionTimestamp 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 DeletionTimestamp field is set to the value of the last call.
func (b *AdmissionReportApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *AdmissionReportApplyConfiguration {
func (b *EphemeralReportApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *EphemeralReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.DeletionTimestamp = &value
return b
@ -134,7 +134,7 @@ func (b *AdmissionReportApplyConfiguration) WithDeletionTimestamp(value metav1.T
// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds 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 DeletionGracePeriodSeconds field is set to the value of the last call.
func (b *AdmissionReportApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *AdmissionReportApplyConfiguration {
func (b *EphemeralReportApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *EphemeralReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.DeletionGracePeriodSeconds = &value
return b
@ -144,7 +144,7 @@ func (b *AdmissionReportApplyConfiguration) WithDeletionGracePeriodSeconds(value
// 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 Labels field,
// overwriting an existing map entries in Labels field with the same key.
func (b *AdmissionReportApplyConfiguration) WithLabels(entries map[string]string) *AdmissionReportApplyConfiguration {
func (b *EphemeralReportApplyConfiguration) WithLabels(entries map[string]string) *EphemeralReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
if b.Labels == nil && len(entries) > 0 {
b.Labels = make(map[string]string, len(entries))
@ -159,7 +159,7 @@ func (b *AdmissionReportApplyConfiguration) WithLabels(entries map[string]string
// 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 Annotations field,
// overwriting an existing map entries in Annotations field with the same key.
func (b *AdmissionReportApplyConfiguration) WithAnnotations(entries map[string]string) *AdmissionReportApplyConfiguration {
func (b *EphemeralReportApplyConfiguration) WithAnnotations(entries map[string]string) *EphemeralReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
if b.Annotations == nil && len(entries) > 0 {
b.Annotations = make(map[string]string, len(entries))
@ -173,7 +173,7 @@ func (b *AdmissionReportApplyConfiguration) WithAnnotations(entries map[string]s
// WithOwnerReferences adds the given value to the OwnerReferences 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 OwnerReferences field.
func (b *AdmissionReportApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *AdmissionReportApplyConfiguration {
func (b *EphemeralReportApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *EphemeralReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
if values[i] == nil {
@ -187,7 +187,7 @@ func (b *AdmissionReportApplyConfiguration) WithOwnerReferences(values ...*v1.Ow
// WithFinalizers adds the given value to the Finalizers 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 Finalizers field.
func (b *AdmissionReportApplyConfiguration) WithFinalizers(values ...string) *AdmissionReportApplyConfiguration {
func (b *EphemeralReportApplyConfiguration) WithFinalizers(values ...string) *EphemeralReportApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
b.Finalizers = append(b.Finalizers, values[i])
@ -195,7 +195,7 @@ func (b *AdmissionReportApplyConfiguration) WithFinalizers(values ...string) *Ad
return b
}
func (b *AdmissionReportApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
func (b *EphemeralReportApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
if b.ObjectMetaApplyConfiguration == nil {
b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
}
@ -204,7 +204,7 @@ func (b *AdmissionReportApplyConfiguration) ensureObjectMetaApplyConfigurationEx
// WithSpec sets the Spec 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 Spec field is set to the value of the last call.
func (b *AdmissionReportApplyConfiguration) WithSpec(value *AdmissionReportSpecApplyConfiguration) *AdmissionReportApplyConfiguration {
func (b *EphemeralReportApplyConfiguration) WithSpec(value *EphemeralReportSpecApplyConfiguration) *EphemeralReportApplyConfiguration {
b.Spec = value
return b
}

View file

@ -23,24 +23,24 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// AdmissionReportSpecApplyConfiguration represents an declarative configuration of the AdmissionReportSpec type for use
// EphemeralReportSpecApplyConfiguration represents an declarative configuration of the EphemeralReportSpec type for use
// with apply.
type AdmissionReportSpecApplyConfiguration struct {
type EphemeralReportSpecApplyConfiguration struct {
Owner *v1.OwnerReferenceApplyConfiguration `json:"owner,omitempty"`
Summary *v1alpha2.PolicyReportSummaryApplyConfiguration `json:"summary,omitempty"`
Results []v1alpha2.PolicyReportResultApplyConfiguration `json:"results,omitempty"`
}
// AdmissionReportSpecApplyConfiguration constructs an declarative configuration of the AdmissionReportSpec type for use with
// EphemeralReportSpecApplyConfiguration constructs an declarative configuration of the EphemeralReportSpec type for use with
// apply.
func AdmissionReportSpec() *AdmissionReportSpecApplyConfiguration {
return &AdmissionReportSpecApplyConfiguration{}
func EphemeralReportSpec() *EphemeralReportSpecApplyConfiguration {
return &EphemeralReportSpecApplyConfiguration{}
}
// WithOwner sets the Owner 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 Owner field is set to the value of the last call.
func (b *AdmissionReportSpecApplyConfiguration) WithOwner(value *v1.OwnerReferenceApplyConfiguration) *AdmissionReportSpecApplyConfiguration {
func (b *EphemeralReportSpecApplyConfiguration) WithOwner(value *v1.OwnerReferenceApplyConfiguration) *EphemeralReportSpecApplyConfiguration {
b.Owner = value
return b
}
@ -48,7 +48,7 @@ func (b *AdmissionReportSpecApplyConfiguration) WithOwner(value *v1.OwnerReferen
// WithSummary sets the Summary 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 Summary field is set to the value of the last call.
func (b *AdmissionReportSpecApplyConfiguration) WithSummary(value *v1alpha2.PolicyReportSummaryApplyConfiguration) *AdmissionReportSpecApplyConfiguration {
func (b *EphemeralReportSpecApplyConfiguration) WithSummary(value *v1alpha2.PolicyReportSummaryApplyConfiguration) *EphemeralReportSpecApplyConfiguration {
b.Summary = value
return b
}
@ -56,7 +56,7 @@ func (b *AdmissionReportSpecApplyConfiguration) WithSummary(value *v1alpha2.Poli
// WithResults adds the given value to the Results 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 Results field.
func (b *AdmissionReportSpecApplyConfiguration) WithResults(values ...*v1alpha2.PolicyReportResultApplyConfiguration) *AdmissionReportSpecApplyConfiguration {
func (b *EphemeralReportSpecApplyConfiguration) WithResults(values ...*v1alpha2.PolicyReportResultApplyConfiguration) *EphemeralReportSpecApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithResults")

View file

@ -263,18 +263,12 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
return &kyvernov2beta1.WebhookConfigurationApplyConfiguration{}
// Group=reports.kyverno.io, Version=v1
case reportsv1.SchemeGroupVersion.WithKind("AdmissionReport"):
return &applyconfigurationsreportsv1.AdmissionReportApplyConfiguration{}
case reportsv1.SchemeGroupVersion.WithKind("AdmissionReportSpec"):
return &applyconfigurationsreportsv1.AdmissionReportSpecApplyConfiguration{}
case reportsv1.SchemeGroupVersion.WithKind("BackgroundScanReport"):
return &applyconfigurationsreportsv1.BackgroundScanReportApplyConfiguration{}
case reportsv1.SchemeGroupVersion.WithKind("BackgroundScanReportSpec"):
return &applyconfigurationsreportsv1.BackgroundScanReportSpecApplyConfiguration{}
case reportsv1.SchemeGroupVersion.WithKind("ClusterAdmissionReport"):
return &applyconfigurationsreportsv1.ClusterAdmissionReportApplyConfiguration{}
case reportsv1.SchemeGroupVersion.WithKind("ClusterBackgroundScanReport"):
return &applyconfigurationsreportsv1.ClusterBackgroundScanReportApplyConfiguration{}
case reportsv1.SchemeGroupVersion.WithKind("ClusterEphemeralReport"):
return &applyconfigurationsreportsv1.ClusterEphemeralReportApplyConfiguration{}
case reportsv1.SchemeGroupVersion.WithKind("EphemeralReport"):
return &applyconfigurationsreportsv1.EphemeralReportApplyConfiguration{}
case reportsv1.SchemeGroupVersion.WithKind("EphemeralReportSpec"):
return &applyconfigurationsreportsv1.EphemeralReportSpecApplyConfiguration{}
// Group=wgpolicyk8s.io, Version=v1alpha2
case policyreportv1alpha2.SchemeGroupVersion.WithKind("ClusterPolicyReport"):

View file

@ -1,178 +0,0 @@
/*
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 client-gen. DO NOT EDIT.
package v1
import (
"context"
"time"
v1 "github.com/kyverno/kyverno/api/reports/v1"
scheme "github.com/kyverno/kyverno/pkg/client/clientset/versioned/scheme"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
)
// BackgroundScanReportsGetter has a method to return a BackgroundScanReportInterface.
// A group's client should implement this interface.
type BackgroundScanReportsGetter interface {
BackgroundScanReports(namespace string) BackgroundScanReportInterface
}
// BackgroundScanReportInterface has methods to work with BackgroundScanReport resources.
type BackgroundScanReportInterface interface {
Create(ctx context.Context, backgroundScanReport *v1.BackgroundScanReport, opts metav1.CreateOptions) (*v1.BackgroundScanReport, error)
Update(ctx context.Context, backgroundScanReport *v1.BackgroundScanReport, opts metav1.UpdateOptions) (*v1.BackgroundScanReport, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.BackgroundScanReport, error)
List(ctx context.Context, opts metav1.ListOptions) (*v1.BackgroundScanReportList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.BackgroundScanReport, err error)
BackgroundScanReportExpansion
}
// backgroundScanReports implements BackgroundScanReportInterface
type backgroundScanReports struct {
client rest.Interface
ns string
}
// newBackgroundScanReports returns a BackgroundScanReports
func newBackgroundScanReports(c *ReportsV1Client, namespace string) *backgroundScanReports {
return &backgroundScanReports{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the backgroundScanReport, and returns the corresponding backgroundScanReport object, and an error if there is any.
func (c *backgroundScanReports) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.BackgroundScanReport, err error) {
result = &v1.BackgroundScanReport{}
err = c.client.Get().
Namespace(c.ns).
Resource("backgroundscanreports").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of BackgroundScanReports that match those selectors.
func (c *backgroundScanReports) List(ctx context.Context, opts metav1.ListOptions) (result *v1.BackgroundScanReportList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.BackgroundScanReportList{}
err = c.client.Get().
Namespace(c.ns).
Resource("backgroundscanreports").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested backgroundScanReports.
func (c *backgroundScanReports) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("backgroundscanreports").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a backgroundScanReport and creates it. Returns the server's representation of the backgroundScanReport, and an error, if there is any.
func (c *backgroundScanReports) Create(ctx context.Context, backgroundScanReport *v1.BackgroundScanReport, opts metav1.CreateOptions) (result *v1.BackgroundScanReport, err error) {
result = &v1.BackgroundScanReport{}
err = c.client.Post().
Namespace(c.ns).
Resource("backgroundscanreports").
VersionedParams(&opts, scheme.ParameterCodec).
Body(backgroundScanReport).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a backgroundScanReport and updates it. Returns the server's representation of the backgroundScanReport, and an error, if there is any.
func (c *backgroundScanReports) Update(ctx context.Context, backgroundScanReport *v1.BackgroundScanReport, opts metav1.UpdateOptions) (result *v1.BackgroundScanReport, err error) {
result = &v1.BackgroundScanReport{}
err = c.client.Put().
Namespace(c.ns).
Resource("backgroundscanreports").
Name(backgroundScanReport.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(backgroundScanReport).
Do(ctx).
Into(result)
return
}
// Delete takes name of the backgroundScanReport and deletes it. Returns an error if one occurs.
func (c *backgroundScanReports) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("backgroundscanreports").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *backgroundScanReports) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("backgroundscanreports").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched backgroundScanReport.
func (c *backgroundScanReports) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.BackgroundScanReport, err error) {
result = &v1.BackgroundScanReport{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("backgroundscanreports").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View file

@ -1,168 +0,0 @@
/*
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 client-gen. DO NOT EDIT.
package v1
import (
"context"
"time"
v1 "github.com/kyverno/kyverno/api/reports/v1"
scheme "github.com/kyverno/kyverno/pkg/client/clientset/versioned/scheme"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
)
// ClusterBackgroundScanReportsGetter has a method to return a ClusterBackgroundScanReportInterface.
// A group's client should implement this interface.
type ClusterBackgroundScanReportsGetter interface {
ClusterBackgroundScanReports() ClusterBackgroundScanReportInterface
}
// ClusterBackgroundScanReportInterface has methods to work with ClusterBackgroundScanReport resources.
type ClusterBackgroundScanReportInterface interface {
Create(ctx context.Context, clusterBackgroundScanReport *v1.ClusterBackgroundScanReport, opts metav1.CreateOptions) (*v1.ClusterBackgroundScanReport, error)
Update(ctx context.Context, clusterBackgroundScanReport *v1.ClusterBackgroundScanReport, opts metav1.UpdateOptions) (*v1.ClusterBackgroundScanReport, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ClusterBackgroundScanReport, error)
List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterBackgroundScanReportList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterBackgroundScanReport, err error)
ClusterBackgroundScanReportExpansion
}
// clusterBackgroundScanReports implements ClusterBackgroundScanReportInterface
type clusterBackgroundScanReports struct {
client rest.Interface
}
// newClusterBackgroundScanReports returns a ClusterBackgroundScanReports
func newClusterBackgroundScanReports(c *ReportsV1Client) *clusterBackgroundScanReports {
return &clusterBackgroundScanReports{
client: c.RESTClient(),
}
}
// Get takes name of the clusterBackgroundScanReport, and returns the corresponding clusterBackgroundScanReport object, and an error if there is any.
func (c *clusterBackgroundScanReports) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterBackgroundScanReport, err error) {
result = &v1.ClusterBackgroundScanReport{}
err = c.client.Get().
Resource("clusterbackgroundscanreports").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of ClusterBackgroundScanReports that match those selectors.
func (c *clusterBackgroundScanReports) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterBackgroundScanReportList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.ClusterBackgroundScanReportList{}
err = c.client.Get().
Resource("clusterbackgroundscanreports").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested clusterBackgroundScanReports.
func (c *clusterBackgroundScanReports) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Resource("clusterbackgroundscanreports").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a clusterBackgroundScanReport and creates it. Returns the server's representation of the clusterBackgroundScanReport, and an error, if there is any.
func (c *clusterBackgroundScanReports) Create(ctx context.Context, clusterBackgroundScanReport *v1.ClusterBackgroundScanReport, opts metav1.CreateOptions) (result *v1.ClusterBackgroundScanReport, err error) {
result = &v1.ClusterBackgroundScanReport{}
err = c.client.Post().
Resource("clusterbackgroundscanreports").
VersionedParams(&opts, scheme.ParameterCodec).
Body(clusterBackgroundScanReport).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a clusterBackgroundScanReport and updates it. Returns the server's representation of the clusterBackgroundScanReport, and an error, if there is any.
func (c *clusterBackgroundScanReports) Update(ctx context.Context, clusterBackgroundScanReport *v1.ClusterBackgroundScanReport, opts metav1.UpdateOptions) (result *v1.ClusterBackgroundScanReport, err error) {
result = &v1.ClusterBackgroundScanReport{}
err = c.client.Put().
Resource("clusterbackgroundscanreports").
Name(clusterBackgroundScanReport.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(clusterBackgroundScanReport).
Do(ctx).
Into(result)
return
}
// Delete takes name of the clusterBackgroundScanReport and deletes it. Returns an error if one occurs.
func (c *clusterBackgroundScanReports) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
return c.client.Delete().
Resource("clusterbackgroundscanreports").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *clusterBackgroundScanReports) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Resource("clusterbackgroundscanreports").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched clusterBackgroundScanReport.
func (c *clusterBackgroundScanReports) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterBackgroundScanReport, err error) {
result = &v1.ClusterBackgroundScanReport{}
err = c.client.Patch(pt).
Resource("clusterbackgroundscanreports").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View file

@ -30,42 +30,42 @@ import (
rest "k8s.io/client-go/rest"
)
// ClusterAdmissionReportsGetter has a method to return a ClusterAdmissionReportInterface.
// ClusterEphemeralReportsGetter has a method to return a ClusterEphemeralReportInterface.
// A group's client should implement this interface.
type ClusterAdmissionReportsGetter interface {
ClusterAdmissionReports() ClusterAdmissionReportInterface
type ClusterEphemeralReportsGetter interface {
ClusterEphemeralReports() ClusterEphemeralReportInterface
}
// ClusterAdmissionReportInterface has methods to work with ClusterAdmissionReport resources.
type ClusterAdmissionReportInterface interface {
Create(ctx context.Context, clusterAdmissionReport *v1.ClusterAdmissionReport, opts metav1.CreateOptions) (*v1.ClusterAdmissionReport, error)
Update(ctx context.Context, clusterAdmissionReport *v1.ClusterAdmissionReport, opts metav1.UpdateOptions) (*v1.ClusterAdmissionReport, error)
// ClusterEphemeralReportInterface has methods to work with ClusterEphemeralReport resources.
type ClusterEphemeralReportInterface interface {
Create(ctx context.Context, clusterEphemeralReport *v1.ClusterEphemeralReport, opts metav1.CreateOptions) (*v1.ClusterEphemeralReport, error)
Update(ctx context.Context, clusterEphemeralReport *v1.ClusterEphemeralReport, opts metav1.UpdateOptions) (*v1.ClusterEphemeralReport, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ClusterAdmissionReport, error)
List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterAdmissionReportList, error)
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ClusterEphemeralReport, error)
List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterEphemeralReportList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterAdmissionReport, err error)
ClusterAdmissionReportExpansion
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterEphemeralReport, err error)
ClusterEphemeralReportExpansion
}
// clusterAdmissionReports implements ClusterAdmissionReportInterface
type clusterAdmissionReports struct {
// clusterEphemeralReports implements ClusterEphemeralReportInterface
type clusterEphemeralReports struct {
client rest.Interface
}
// newClusterAdmissionReports returns a ClusterAdmissionReports
func newClusterAdmissionReports(c *ReportsV1Client) *clusterAdmissionReports {
return &clusterAdmissionReports{
// newClusterEphemeralReports returns a ClusterEphemeralReports
func newClusterEphemeralReports(c *ReportsV1Client) *clusterEphemeralReports {
return &clusterEphemeralReports{
client: c.RESTClient(),
}
}
// Get takes name of the clusterAdmissionReport, and returns the corresponding clusterAdmissionReport object, and an error if there is any.
func (c *clusterAdmissionReports) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterAdmissionReport, err error) {
result = &v1.ClusterAdmissionReport{}
// Get takes name of the clusterEphemeralReport, and returns the corresponding clusterEphemeralReport object, and an error if there is any.
func (c *clusterEphemeralReports) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterEphemeralReport, err error) {
result = &v1.ClusterEphemeralReport{}
err = c.client.Get().
Resource("clusteradmissionreports").
Resource("clusterephemeralreports").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
@ -73,15 +73,15 @@ func (c *clusterAdmissionReports) Get(ctx context.Context, name string, options
return
}
// List takes label and field selectors, and returns the list of ClusterAdmissionReports that match those selectors.
func (c *clusterAdmissionReports) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterAdmissionReportList, err error) {
// List takes label and field selectors, and returns the list of ClusterEphemeralReports that match those selectors.
func (c *clusterEphemeralReports) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterEphemeralReportList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.ClusterAdmissionReportList{}
result = &v1.ClusterEphemeralReportList{}
err = c.client.Get().
Resource("clusteradmissionreports").
Resource("clusterephemeralreports").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
@ -89,49 +89,49 @@ func (c *clusterAdmissionReports) List(ctx context.Context, opts metav1.ListOpti
return
}
// Watch returns a watch.Interface that watches the requested clusterAdmissionReports.
func (c *clusterAdmissionReports) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
// Watch returns a watch.Interface that watches the requested clusterEphemeralReports.
func (c *clusterEphemeralReports) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Resource("clusteradmissionreports").
Resource("clusterephemeralreports").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a clusterAdmissionReport and creates it. Returns the server's representation of the clusterAdmissionReport, and an error, if there is any.
func (c *clusterAdmissionReports) Create(ctx context.Context, clusterAdmissionReport *v1.ClusterAdmissionReport, opts metav1.CreateOptions) (result *v1.ClusterAdmissionReport, err error) {
result = &v1.ClusterAdmissionReport{}
// Create takes the representation of a clusterEphemeralReport and creates it. Returns the server's representation of the clusterEphemeralReport, and an error, if there is any.
func (c *clusterEphemeralReports) Create(ctx context.Context, clusterEphemeralReport *v1.ClusterEphemeralReport, opts metav1.CreateOptions) (result *v1.ClusterEphemeralReport, err error) {
result = &v1.ClusterEphemeralReport{}
err = c.client.Post().
Resource("clusteradmissionreports").
Resource("clusterephemeralreports").
VersionedParams(&opts, scheme.ParameterCodec).
Body(clusterAdmissionReport).
Body(clusterEphemeralReport).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a clusterAdmissionReport and updates it. Returns the server's representation of the clusterAdmissionReport, and an error, if there is any.
func (c *clusterAdmissionReports) Update(ctx context.Context, clusterAdmissionReport *v1.ClusterAdmissionReport, opts metav1.UpdateOptions) (result *v1.ClusterAdmissionReport, err error) {
result = &v1.ClusterAdmissionReport{}
// Update takes the representation of a clusterEphemeralReport and updates it. Returns the server's representation of the clusterEphemeralReport, and an error, if there is any.
func (c *clusterEphemeralReports) Update(ctx context.Context, clusterEphemeralReport *v1.ClusterEphemeralReport, opts metav1.UpdateOptions) (result *v1.ClusterEphemeralReport, err error) {
result = &v1.ClusterEphemeralReport{}
err = c.client.Put().
Resource("clusteradmissionreports").
Name(clusterAdmissionReport.Name).
Resource("clusterephemeralreports").
Name(clusterEphemeralReport.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(clusterAdmissionReport).
Body(clusterEphemeralReport).
Do(ctx).
Into(result)
return
}
// Delete takes name of the clusterAdmissionReport and deletes it. Returns an error if one occurs.
func (c *clusterAdmissionReports) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
// Delete takes name of the clusterEphemeralReport and deletes it. Returns an error if one occurs.
func (c *clusterEphemeralReports) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
return c.client.Delete().
Resource("clusteradmissionreports").
Resource("clusterephemeralreports").
Name(name).
Body(&opts).
Do(ctx).
@ -139,13 +139,13 @@ func (c *clusterAdmissionReports) Delete(ctx context.Context, name string, opts
}
// DeleteCollection deletes a collection of objects.
func (c *clusterAdmissionReports) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
func (c *clusterEphemeralReports) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Resource("clusteradmissionreports").
Resource("clusterephemeralreports").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
@ -153,11 +153,11 @@ func (c *clusterAdmissionReports) DeleteCollection(ctx context.Context, opts met
Error()
}
// Patch applies the patch and returns the patched clusterAdmissionReport.
func (c *clusterAdmissionReports) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterAdmissionReport, err error) {
result = &v1.ClusterAdmissionReport{}
// Patch applies the patch and returns the patched clusterEphemeralReport.
func (c *clusterEphemeralReports) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterEphemeralReport, err error) {
result = &v1.ClusterEphemeralReport{}
err = c.client.Patch(pt).
Resource("clusteradmissionreports").
Resource("clusterephemeralreports").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).

View file

@ -30,45 +30,45 @@ import (
rest "k8s.io/client-go/rest"
)
// AdmissionReportsGetter has a method to return a AdmissionReportInterface.
// EphemeralReportsGetter has a method to return a EphemeralReportInterface.
// A group's client should implement this interface.
type AdmissionReportsGetter interface {
AdmissionReports(namespace string) AdmissionReportInterface
type EphemeralReportsGetter interface {
EphemeralReports(namespace string) EphemeralReportInterface
}
// AdmissionReportInterface has methods to work with AdmissionReport resources.
type AdmissionReportInterface interface {
Create(ctx context.Context, admissionReport *v1.AdmissionReport, opts metav1.CreateOptions) (*v1.AdmissionReport, error)
Update(ctx context.Context, admissionReport *v1.AdmissionReport, opts metav1.UpdateOptions) (*v1.AdmissionReport, error)
// EphemeralReportInterface has methods to work with EphemeralReport resources.
type EphemeralReportInterface interface {
Create(ctx context.Context, ephemeralReport *v1.EphemeralReport, opts metav1.CreateOptions) (*v1.EphemeralReport, error)
Update(ctx context.Context, ephemeralReport *v1.EphemeralReport, opts metav1.UpdateOptions) (*v1.EphemeralReport, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.AdmissionReport, error)
List(ctx context.Context, opts metav1.ListOptions) (*v1.AdmissionReportList, error)
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.EphemeralReport, error)
List(ctx context.Context, opts metav1.ListOptions) (*v1.EphemeralReportList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AdmissionReport, err error)
AdmissionReportExpansion
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.EphemeralReport, err error)
EphemeralReportExpansion
}
// admissionReports implements AdmissionReportInterface
type admissionReports struct {
// ephemeralReports implements EphemeralReportInterface
type ephemeralReports struct {
client rest.Interface
ns string
}
// newAdmissionReports returns a AdmissionReports
func newAdmissionReports(c *ReportsV1Client, namespace string) *admissionReports {
return &admissionReports{
// newEphemeralReports returns a EphemeralReports
func newEphemeralReports(c *ReportsV1Client, namespace string) *ephemeralReports {
return &ephemeralReports{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the admissionReport, and returns the corresponding admissionReport object, and an error if there is any.
func (c *admissionReports) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.AdmissionReport, err error) {
result = &v1.AdmissionReport{}
// Get takes name of the ephemeralReport, and returns the corresponding ephemeralReport object, and an error if there is any.
func (c *ephemeralReports) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.EphemeralReport, err error) {
result = &v1.EphemeralReport{}
err = c.client.Get().
Namespace(c.ns).
Resource("admissionreports").
Resource("ephemeralreports").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
@ -76,16 +76,16 @@ func (c *admissionReports) Get(ctx context.Context, name string, options metav1.
return
}
// List takes label and field selectors, and returns the list of AdmissionReports that match those selectors.
func (c *admissionReports) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AdmissionReportList, err error) {
// List takes label and field selectors, and returns the list of EphemeralReports that match those selectors.
func (c *ephemeralReports) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EphemeralReportList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.AdmissionReportList{}
result = &v1.EphemeralReportList{}
err = c.client.Get().
Namespace(c.ns).
Resource("admissionreports").
Resource("ephemeralreports").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
@ -93,8 +93,8 @@ func (c *admissionReports) List(ctx context.Context, opts metav1.ListOptions) (r
return
}
// Watch returns a watch.Interface that watches the requested admissionReports.
func (c *admissionReports) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
// Watch returns a watch.Interface that watches the requested ephemeralReports.
func (c *ephemeralReports) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@ -102,44 +102,44 @@ func (c *admissionReports) Watch(ctx context.Context, opts metav1.ListOptions) (
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("admissionreports").
Resource("ephemeralreports").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a admissionReport and creates it. Returns the server's representation of the admissionReport, and an error, if there is any.
func (c *admissionReports) Create(ctx context.Context, admissionReport *v1.AdmissionReport, opts metav1.CreateOptions) (result *v1.AdmissionReport, err error) {
result = &v1.AdmissionReport{}
// Create takes the representation of a ephemeralReport and creates it. Returns the server's representation of the ephemeralReport, and an error, if there is any.
func (c *ephemeralReports) Create(ctx context.Context, ephemeralReport *v1.EphemeralReport, opts metav1.CreateOptions) (result *v1.EphemeralReport, err error) {
result = &v1.EphemeralReport{}
err = c.client.Post().
Namespace(c.ns).
Resource("admissionreports").
Resource("ephemeralreports").
VersionedParams(&opts, scheme.ParameterCodec).
Body(admissionReport).
Body(ephemeralReport).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a admissionReport and updates it. Returns the server's representation of the admissionReport, and an error, if there is any.
func (c *admissionReports) Update(ctx context.Context, admissionReport *v1.AdmissionReport, opts metav1.UpdateOptions) (result *v1.AdmissionReport, err error) {
result = &v1.AdmissionReport{}
// Update takes the representation of a ephemeralReport and updates it. Returns the server's representation of the ephemeralReport, and an error, if there is any.
func (c *ephemeralReports) Update(ctx context.Context, ephemeralReport *v1.EphemeralReport, opts metav1.UpdateOptions) (result *v1.EphemeralReport, err error) {
result = &v1.EphemeralReport{}
err = c.client.Put().
Namespace(c.ns).
Resource("admissionreports").
Name(admissionReport.Name).
Resource("ephemeralreports").
Name(ephemeralReport.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(admissionReport).
Body(ephemeralReport).
Do(ctx).
Into(result)
return
}
// Delete takes name of the admissionReport and deletes it. Returns an error if one occurs.
func (c *admissionReports) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
// Delete takes name of the ephemeralReport and deletes it. Returns an error if one occurs.
func (c *ephemeralReports) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("admissionreports").
Resource("ephemeralreports").
Name(name).
Body(&opts).
Do(ctx).
@ -147,14 +147,14 @@ func (c *admissionReports) Delete(ctx context.Context, name string, opts metav1.
}
// DeleteCollection deletes a collection of objects.
func (c *admissionReports) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
func (c *ephemeralReports) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("admissionreports").
Resource("ephemeralreports").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
@ -162,12 +162,12 @@ func (c *admissionReports) DeleteCollection(ctx context.Context, opts metav1.Del
Error()
}
// Patch applies the patch and returns the patched admissionReport.
func (c *admissionReports) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AdmissionReport, err error) {
result = &v1.AdmissionReport{}
// Patch applies the patch and returns the patched ephemeralReport.
func (c *ephemeralReports) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.EphemeralReport, err error) {
result = &v1.EphemeralReport{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("admissionreports").
Resource("ephemeralreports").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).

View file

@ -1,129 +0,0 @@
/*
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 client-gen. DO NOT EDIT.
package fake
import (
"context"
v1 "github.com/kyverno/kyverno/api/reports/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
)
// FakeAdmissionReports implements AdmissionReportInterface
type FakeAdmissionReports struct {
Fake *FakeReportsV1
ns string
}
var admissionreportsResource = v1.SchemeGroupVersion.WithResource("admissionreports")
var admissionreportsKind = v1.SchemeGroupVersion.WithKind("AdmissionReport")
// Get takes name of the admissionReport, and returns the corresponding admissionReport object, and an error if there is any.
func (c *FakeAdmissionReports) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.AdmissionReport, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(admissionreportsResource, c.ns, name), &v1.AdmissionReport{})
if obj == nil {
return nil, err
}
return obj.(*v1.AdmissionReport), err
}
// List takes label and field selectors, and returns the list of AdmissionReports that match those selectors.
func (c *FakeAdmissionReports) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AdmissionReportList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(admissionreportsResource, admissionreportsKind, c.ns, opts), &v1.AdmissionReportList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1.AdmissionReportList{ListMeta: obj.(*v1.AdmissionReportList).ListMeta}
for _, item := range obj.(*v1.AdmissionReportList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested admissionReports.
func (c *FakeAdmissionReports) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(admissionreportsResource, c.ns, opts))
}
// Create takes the representation of a admissionReport and creates it. Returns the server's representation of the admissionReport, and an error, if there is any.
func (c *FakeAdmissionReports) Create(ctx context.Context, admissionReport *v1.AdmissionReport, opts metav1.CreateOptions) (result *v1.AdmissionReport, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(admissionreportsResource, c.ns, admissionReport), &v1.AdmissionReport{})
if obj == nil {
return nil, err
}
return obj.(*v1.AdmissionReport), err
}
// Update takes the representation of a admissionReport and updates it. Returns the server's representation of the admissionReport, and an error, if there is any.
func (c *FakeAdmissionReports) Update(ctx context.Context, admissionReport *v1.AdmissionReport, opts metav1.UpdateOptions) (result *v1.AdmissionReport, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(admissionreportsResource, c.ns, admissionReport), &v1.AdmissionReport{})
if obj == nil {
return nil, err
}
return obj.(*v1.AdmissionReport), err
}
// Delete takes name of the admissionReport and deletes it. Returns an error if one occurs.
func (c *FakeAdmissionReports) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteActionWithOptions(admissionreportsResource, c.ns, name, opts), &v1.AdmissionReport{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeAdmissionReports) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
action := testing.NewDeleteCollectionAction(admissionreportsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1.AdmissionReportList{})
return err
}
// Patch applies the patch and returns the patched admissionReport.
func (c *FakeAdmissionReports) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AdmissionReport, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(admissionreportsResource, c.ns, name, pt, data, subresources...), &v1.AdmissionReport{})
if obj == nil {
return nil, err
}
return obj.(*v1.AdmissionReport), err
}

View file

@ -1,129 +0,0 @@
/*
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 client-gen. DO NOT EDIT.
package fake
import (
"context"
v1 "github.com/kyverno/kyverno/api/reports/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
)
// FakeBackgroundScanReports implements BackgroundScanReportInterface
type FakeBackgroundScanReports struct {
Fake *FakeReportsV1
ns string
}
var backgroundscanreportsResource = v1.SchemeGroupVersion.WithResource("backgroundscanreports")
var backgroundscanreportsKind = v1.SchemeGroupVersion.WithKind("BackgroundScanReport")
// Get takes name of the backgroundScanReport, and returns the corresponding backgroundScanReport object, and an error if there is any.
func (c *FakeBackgroundScanReports) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.BackgroundScanReport, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(backgroundscanreportsResource, c.ns, name), &v1.BackgroundScanReport{})
if obj == nil {
return nil, err
}
return obj.(*v1.BackgroundScanReport), err
}
// List takes label and field selectors, and returns the list of BackgroundScanReports that match those selectors.
func (c *FakeBackgroundScanReports) List(ctx context.Context, opts metav1.ListOptions) (result *v1.BackgroundScanReportList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(backgroundscanreportsResource, backgroundscanreportsKind, c.ns, opts), &v1.BackgroundScanReportList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1.BackgroundScanReportList{ListMeta: obj.(*v1.BackgroundScanReportList).ListMeta}
for _, item := range obj.(*v1.BackgroundScanReportList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested backgroundScanReports.
func (c *FakeBackgroundScanReports) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(backgroundscanreportsResource, c.ns, opts))
}
// Create takes the representation of a backgroundScanReport and creates it. Returns the server's representation of the backgroundScanReport, and an error, if there is any.
func (c *FakeBackgroundScanReports) Create(ctx context.Context, backgroundScanReport *v1.BackgroundScanReport, opts metav1.CreateOptions) (result *v1.BackgroundScanReport, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(backgroundscanreportsResource, c.ns, backgroundScanReport), &v1.BackgroundScanReport{})
if obj == nil {
return nil, err
}
return obj.(*v1.BackgroundScanReport), err
}
// Update takes the representation of a backgroundScanReport and updates it. Returns the server's representation of the backgroundScanReport, and an error, if there is any.
func (c *FakeBackgroundScanReports) Update(ctx context.Context, backgroundScanReport *v1.BackgroundScanReport, opts metav1.UpdateOptions) (result *v1.BackgroundScanReport, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(backgroundscanreportsResource, c.ns, backgroundScanReport), &v1.BackgroundScanReport{})
if obj == nil {
return nil, err
}
return obj.(*v1.BackgroundScanReport), err
}
// Delete takes name of the backgroundScanReport and deletes it. Returns an error if one occurs.
func (c *FakeBackgroundScanReports) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteActionWithOptions(backgroundscanreportsResource, c.ns, name, opts), &v1.BackgroundScanReport{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeBackgroundScanReports) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
action := testing.NewDeleteCollectionAction(backgroundscanreportsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1.BackgroundScanReportList{})
return err
}
// Patch applies the patch and returns the patched backgroundScanReport.
func (c *FakeBackgroundScanReports) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.BackgroundScanReport, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(backgroundscanreportsResource, c.ns, name, pt, data, subresources...), &v1.BackgroundScanReport{})
if obj == nil {
return nil, err
}
return obj.(*v1.BackgroundScanReport), err
}

View file

@ -1,121 +0,0 @@
/*
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 client-gen. DO NOT EDIT.
package fake
import (
"context"
v1 "github.com/kyverno/kyverno/api/reports/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
)
// FakeClusterAdmissionReports implements ClusterAdmissionReportInterface
type FakeClusterAdmissionReports struct {
Fake *FakeReportsV1
}
var clusteradmissionreportsResource = v1.SchemeGroupVersion.WithResource("clusteradmissionreports")
var clusteradmissionreportsKind = v1.SchemeGroupVersion.WithKind("ClusterAdmissionReport")
// Get takes name of the clusterAdmissionReport, and returns the corresponding clusterAdmissionReport object, and an error if there is any.
func (c *FakeClusterAdmissionReports) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterAdmissionReport, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(clusteradmissionreportsResource, name), &v1.ClusterAdmissionReport{})
if obj == nil {
return nil, err
}
return obj.(*v1.ClusterAdmissionReport), err
}
// List takes label and field selectors, and returns the list of ClusterAdmissionReports that match those selectors.
func (c *FakeClusterAdmissionReports) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterAdmissionReportList, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootListAction(clusteradmissionreportsResource, clusteradmissionreportsKind, opts), &v1.ClusterAdmissionReportList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1.ClusterAdmissionReportList{ListMeta: obj.(*v1.ClusterAdmissionReportList).ListMeta}
for _, item := range obj.(*v1.ClusterAdmissionReportList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested clusterAdmissionReports.
func (c *FakeClusterAdmissionReports) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewRootWatchAction(clusteradmissionreportsResource, opts))
}
// Create takes the representation of a clusterAdmissionReport and creates it. Returns the server's representation of the clusterAdmissionReport, and an error, if there is any.
func (c *FakeClusterAdmissionReports) Create(ctx context.Context, clusterAdmissionReport *v1.ClusterAdmissionReport, opts metav1.CreateOptions) (result *v1.ClusterAdmissionReport, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(clusteradmissionreportsResource, clusterAdmissionReport), &v1.ClusterAdmissionReport{})
if obj == nil {
return nil, err
}
return obj.(*v1.ClusterAdmissionReport), err
}
// Update takes the representation of a clusterAdmissionReport and updates it. Returns the server's representation of the clusterAdmissionReport, and an error, if there is any.
func (c *FakeClusterAdmissionReports) Update(ctx context.Context, clusterAdmissionReport *v1.ClusterAdmissionReport, opts metav1.UpdateOptions) (result *v1.ClusterAdmissionReport, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(clusteradmissionreportsResource, clusterAdmissionReport), &v1.ClusterAdmissionReport{})
if obj == nil {
return nil, err
}
return obj.(*v1.ClusterAdmissionReport), err
}
// Delete takes name of the clusterAdmissionReport and deletes it. Returns an error if one occurs.
func (c *FakeClusterAdmissionReports) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteActionWithOptions(clusteradmissionreportsResource, name, opts), &v1.ClusterAdmissionReport{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeClusterAdmissionReports) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(clusteradmissionreportsResource, listOpts)
_, err := c.Fake.Invokes(action, &v1.ClusterAdmissionReportList{})
return err
}
// Patch applies the patch and returns the patched clusterAdmissionReport.
func (c *FakeClusterAdmissionReports) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterAdmissionReport, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(clusteradmissionreportsResource, name, pt, data, subresources...), &v1.ClusterAdmissionReport{})
if obj == nil {
return nil, err
}
return obj.(*v1.ClusterAdmissionReport), err
}

View file

@ -1,121 +0,0 @@
/*
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 client-gen. DO NOT EDIT.
package fake
import (
"context"
v1 "github.com/kyverno/kyverno/api/reports/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
)
// FakeClusterBackgroundScanReports implements ClusterBackgroundScanReportInterface
type FakeClusterBackgroundScanReports struct {
Fake *FakeReportsV1
}
var clusterbackgroundscanreportsResource = v1.SchemeGroupVersion.WithResource("clusterbackgroundscanreports")
var clusterbackgroundscanreportsKind = v1.SchemeGroupVersion.WithKind("ClusterBackgroundScanReport")
// Get takes name of the clusterBackgroundScanReport, and returns the corresponding clusterBackgroundScanReport object, and an error if there is any.
func (c *FakeClusterBackgroundScanReports) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterBackgroundScanReport, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(clusterbackgroundscanreportsResource, name), &v1.ClusterBackgroundScanReport{})
if obj == nil {
return nil, err
}
return obj.(*v1.ClusterBackgroundScanReport), err
}
// List takes label and field selectors, and returns the list of ClusterBackgroundScanReports that match those selectors.
func (c *FakeClusterBackgroundScanReports) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterBackgroundScanReportList, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootListAction(clusterbackgroundscanreportsResource, clusterbackgroundscanreportsKind, opts), &v1.ClusterBackgroundScanReportList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1.ClusterBackgroundScanReportList{ListMeta: obj.(*v1.ClusterBackgroundScanReportList).ListMeta}
for _, item := range obj.(*v1.ClusterBackgroundScanReportList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested clusterBackgroundScanReports.
func (c *FakeClusterBackgroundScanReports) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewRootWatchAction(clusterbackgroundscanreportsResource, opts))
}
// Create takes the representation of a clusterBackgroundScanReport and creates it. Returns the server's representation of the clusterBackgroundScanReport, and an error, if there is any.
func (c *FakeClusterBackgroundScanReports) Create(ctx context.Context, clusterBackgroundScanReport *v1.ClusterBackgroundScanReport, opts metav1.CreateOptions) (result *v1.ClusterBackgroundScanReport, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(clusterbackgroundscanreportsResource, clusterBackgroundScanReport), &v1.ClusterBackgroundScanReport{})
if obj == nil {
return nil, err
}
return obj.(*v1.ClusterBackgroundScanReport), err
}
// Update takes the representation of a clusterBackgroundScanReport and updates it. Returns the server's representation of the clusterBackgroundScanReport, and an error, if there is any.
func (c *FakeClusterBackgroundScanReports) Update(ctx context.Context, clusterBackgroundScanReport *v1.ClusterBackgroundScanReport, opts metav1.UpdateOptions) (result *v1.ClusterBackgroundScanReport, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(clusterbackgroundscanreportsResource, clusterBackgroundScanReport), &v1.ClusterBackgroundScanReport{})
if obj == nil {
return nil, err
}
return obj.(*v1.ClusterBackgroundScanReport), err
}
// Delete takes name of the clusterBackgroundScanReport and deletes it. Returns an error if one occurs.
func (c *FakeClusterBackgroundScanReports) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteActionWithOptions(clusterbackgroundscanreportsResource, name, opts), &v1.ClusterBackgroundScanReport{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeClusterBackgroundScanReports) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(clusterbackgroundscanreportsResource, listOpts)
_, err := c.Fake.Invokes(action, &v1.ClusterBackgroundScanReportList{})
return err
}
// Patch applies the patch and returns the patched clusterBackgroundScanReport.
func (c *FakeClusterBackgroundScanReports) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterBackgroundScanReport, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(clusterbackgroundscanreportsResource, name, pt, data, subresources...), &v1.ClusterBackgroundScanReport{})
if obj == nil {
return nil, err
}
return obj.(*v1.ClusterBackgroundScanReport), err
}

View file

@ -0,0 +1,121 @@
/*
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 client-gen. DO NOT EDIT.
package fake
import (
"context"
v1 "github.com/kyverno/kyverno/api/reports/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
)
// FakeClusterEphemeralReports implements ClusterEphemeralReportInterface
type FakeClusterEphemeralReports struct {
Fake *FakeReportsV1
}
var clusterephemeralreportsResource = v1.SchemeGroupVersion.WithResource("clusterephemeralreports")
var clusterephemeralreportsKind = v1.SchemeGroupVersion.WithKind("ClusterEphemeralReport")
// Get takes name of the clusterEphemeralReport, and returns the corresponding clusterEphemeralReport object, and an error if there is any.
func (c *FakeClusterEphemeralReports) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterEphemeralReport, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(clusterephemeralreportsResource, name), &v1.ClusterEphemeralReport{})
if obj == nil {
return nil, err
}
return obj.(*v1.ClusterEphemeralReport), err
}
// List takes label and field selectors, and returns the list of ClusterEphemeralReports that match those selectors.
func (c *FakeClusterEphemeralReports) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterEphemeralReportList, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootListAction(clusterephemeralreportsResource, clusterephemeralreportsKind, opts), &v1.ClusterEphemeralReportList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1.ClusterEphemeralReportList{ListMeta: obj.(*v1.ClusterEphemeralReportList).ListMeta}
for _, item := range obj.(*v1.ClusterEphemeralReportList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested clusterEphemeralReports.
func (c *FakeClusterEphemeralReports) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewRootWatchAction(clusterephemeralreportsResource, opts))
}
// Create takes the representation of a clusterEphemeralReport and creates it. Returns the server's representation of the clusterEphemeralReport, and an error, if there is any.
func (c *FakeClusterEphemeralReports) Create(ctx context.Context, clusterEphemeralReport *v1.ClusterEphemeralReport, opts metav1.CreateOptions) (result *v1.ClusterEphemeralReport, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(clusterephemeralreportsResource, clusterEphemeralReport), &v1.ClusterEphemeralReport{})
if obj == nil {
return nil, err
}
return obj.(*v1.ClusterEphemeralReport), err
}
// Update takes the representation of a clusterEphemeralReport and updates it. Returns the server's representation of the clusterEphemeralReport, and an error, if there is any.
func (c *FakeClusterEphemeralReports) Update(ctx context.Context, clusterEphemeralReport *v1.ClusterEphemeralReport, opts metav1.UpdateOptions) (result *v1.ClusterEphemeralReport, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(clusterephemeralreportsResource, clusterEphemeralReport), &v1.ClusterEphemeralReport{})
if obj == nil {
return nil, err
}
return obj.(*v1.ClusterEphemeralReport), err
}
// Delete takes name of the clusterEphemeralReport and deletes it. Returns an error if one occurs.
func (c *FakeClusterEphemeralReports) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteActionWithOptions(clusterephemeralreportsResource, name, opts), &v1.ClusterEphemeralReport{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeClusterEphemeralReports) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(clusterephemeralreportsResource, listOpts)
_, err := c.Fake.Invokes(action, &v1.ClusterEphemeralReportList{})
return err
}
// Patch applies the patch and returns the patched clusterEphemeralReport.
func (c *FakeClusterEphemeralReports) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterEphemeralReport, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(clusterephemeralreportsResource, name, pt, data, subresources...), &v1.ClusterEphemeralReport{})
if obj == nil {
return nil, err
}
return obj.(*v1.ClusterEphemeralReport), err
}

View file

@ -0,0 +1,129 @@
/*
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 client-gen. DO NOT EDIT.
package fake
import (
"context"
v1 "github.com/kyverno/kyverno/api/reports/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
)
// FakeEphemeralReports implements EphemeralReportInterface
type FakeEphemeralReports struct {
Fake *FakeReportsV1
ns string
}
var ephemeralreportsResource = v1.SchemeGroupVersion.WithResource("ephemeralreports")
var ephemeralreportsKind = v1.SchemeGroupVersion.WithKind("EphemeralReport")
// Get takes name of the ephemeralReport, and returns the corresponding ephemeralReport object, and an error if there is any.
func (c *FakeEphemeralReports) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.EphemeralReport, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(ephemeralreportsResource, c.ns, name), &v1.EphemeralReport{})
if obj == nil {
return nil, err
}
return obj.(*v1.EphemeralReport), err
}
// List takes label and field selectors, and returns the list of EphemeralReports that match those selectors.
func (c *FakeEphemeralReports) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EphemeralReportList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(ephemeralreportsResource, ephemeralreportsKind, c.ns, opts), &v1.EphemeralReportList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1.EphemeralReportList{ListMeta: obj.(*v1.EphemeralReportList).ListMeta}
for _, item := range obj.(*v1.EphemeralReportList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested ephemeralReports.
func (c *FakeEphemeralReports) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(ephemeralreportsResource, c.ns, opts))
}
// Create takes the representation of a ephemeralReport and creates it. Returns the server's representation of the ephemeralReport, and an error, if there is any.
func (c *FakeEphemeralReports) Create(ctx context.Context, ephemeralReport *v1.EphemeralReport, opts metav1.CreateOptions) (result *v1.EphemeralReport, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(ephemeralreportsResource, c.ns, ephemeralReport), &v1.EphemeralReport{})
if obj == nil {
return nil, err
}
return obj.(*v1.EphemeralReport), err
}
// Update takes the representation of a ephemeralReport and updates it. Returns the server's representation of the ephemeralReport, and an error, if there is any.
func (c *FakeEphemeralReports) Update(ctx context.Context, ephemeralReport *v1.EphemeralReport, opts metav1.UpdateOptions) (result *v1.EphemeralReport, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(ephemeralreportsResource, c.ns, ephemeralReport), &v1.EphemeralReport{})
if obj == nil {
return nil, err
}
return obj.(*v1.EphemeralReport), err
}
// Delete takes name of the ephemeralReport and deletes it. Returns an error if one occurs.
func (c *FakeEphemeralReports) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteActionWithOptions(ephemeralreportsResource, c.ns, name, opts), &v1.EphemeralReport{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeEphemeralReports) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
action := testing.NewDeleteCollectionAction(ephemeralreportsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1.EphemeralReportList{})
return err
}
// Patch applies the patch and returns the patched ephemeralReport.
func (c *FakeEphemeralReports) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.EphemeralReport, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(ephemeralreportsResource, c.ns, name, pt, data, subresources...), &v1.EphemeralReport{})
if obj == nil {
return nil, err
}
return obj.(*v1.EphemeralReport), err
}

View file

@ -28,20 +28,12 @@ type FakeReportsV1 struct {
*testing.Fake
}
func (c *FakeReportsV1) AdmissionReports(namespace string) v1.AdmissionReportInterface {
return &FakeAdmissionReports{c, namespace}
func (c *FakeReportsV1) ClusterEphemeralReports() v1.ClusterEphemeralReportInterface {
return &FakeClusterEphemeralReports{c}
}
func (c *FakeReportsV1) BackgroundScanReports(namespace string) v1.BackgroundScanReportInterface {
return &FakeBackgroundScanReports{c, namespace}
}
func (c *FakeReportsV1) ClusterAdmissionReports() v1.ClusterAdmissionReportInterface {
return &FakeClusterAdmissionReports{c}
}
func (c *FakeReportsV1) ClusterBackgroundScanReports() v1.ClusterBackgroundScanReportInterface {
return &FakeClusterBackgroundScanReports{c}
func (c *FakeReportsV1) EphemeralReports(namespace string) v1.EphemeralReportInterface {
return &FakeEphemeralReports{c, namespace}
}
// RESTClient returns a RESTClient that is used to communicate

View file

@ -18,10 +18,6 @@ limitations under the License.
package v1
type AdmissionReportExpansion interface{}
type ClusterEphemeralReportExpansion interface{}
type BackgroundScanReportExpansion interface{}
type ClusterAdmissionReportExpansion interface{}
type ClusterBackgroundScanReportExpansion interface{}
type EphemeralReportExpansion interface{}

View file

@ -28,10 +28,8 @@ import (
type ReportsV1Interface interface {
RESTClient() rest.Interface
AdmissionReportsGetter
BackgroundScanReportsGetter
ClusterAdmissionReportsGetter
ClusterBackgroundScanReportsGetter
ClusterEphemeralReportsGetter
EphemeralReportsGetter
}
// ReportsV1Client is used to interact with features provided by the reports.kyverno.io group.
@ -39,20 +37,12 @@ type ReportsV1Client struct {
restClient rest.Interface
}
func (c *ReportsV1Client) AdmissionReports(namespace string) AdmissionReportInterface {
return newAdmissionReports(c, namespace)
func (c *ReportsV1Client) ClusterEphemeralReports() ClusterEphemeralReportInterface {
return newClusterEphemeralReports(c)
}
func (c *ReportsV1Client) BackgroundScanReports(namespace string) BackgroundScanReportInterface {
return newBackgroundScanReports(c, namespace)
}
func (c *ReportsV1Client) ClusterAdmissionReports() ClusterAdmissionReportInterface {
return newClusterAdmissionReports(c)
}
func (c *ReportsV1Client) ClusterBackgroundScanReports() ClusterBackgroundScanReportInterface {
return newClusterBackgroundScanReports(c)
func (c *ReportsV1Client) EphemeralReports(namespace string) EphemeralReportInterface {
return newEphemeralReports(c, namespace)
}
// NewForConfig creates a new ReportsV1Client for the given config.

View file

@ -118,14 +118,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
return &genericInformer{resource: resource.GroupResource(), informer: f.Kyverno().V2beta1().PolicyExceptions().Informer()}, nil
// Group=reports.kyverno.io, Version=v1
case reportsv1.SchemeGroupVersion.WithResource("admissionreports"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Reports().V1().AdmissionReports().Informer()}, nil
case reportsv1.SchemeGroupVersion.WithResource("backgroundscanreports"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Reports().V1().BackgroundScanReports().Informer()}, nil
case reportsv1.SchemeGroupVersion.WithResource("clusteradmissionreports"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Reports().V1().ClusterAdmissionReports().Informer()}, nil
case reportsv1.SchemeGroupVersion.WithResource("clusterbackgroundscanreports"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Reports().V1().ClusterBackgroundScanReports().Informer()}, nil
case reportsv1.SchemeGroupVersion.WithResource("clusterephemeralreports"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Reports().V1().ClusterEphemeralReports().Informer()}, nil
case reportsv1.SchemeGroupVersion.WithResource("ephemeralreports"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Reports().V1().EphemeralReports().Informer()}, nil
// Group=wgpolicyk8s.io, Version=v1alpha2
case policyreportv1alpha2.SchemeGroupVersion.WithResource("clusterpolicyreports"):

View file

@ -1,90 +0,0 @@
/*
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 informer-gen. DO NOT EDIT.
package v1
import (
"context"
time "time"
reportsv1 "github.com/kyverno/kyverno/api/reports/v1"
versioned "github.com/kyverno/kyverno/pkg/client/clientset/versioned"
internalinterfaces "github.com/kyverno/kyverno/pkg/client/informers/externalversions/internalinterfaces"
v1 "github.com/kyverno/kyverno/pkg/client/listers/reports/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
)
// BackgroundScanReportInformer provides access to a shared informer and lister for
// BackgroundScanReports.
type BackgroundScanReportInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1.BackgroundScanReportLister
}
type backgroundScanReportInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
namespace string
}
// NewBackgroundScanReportInformer constructs a new informer for BackgroundScanReport type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewBackgroundScanReportInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredBackgroundScanReportInformer(client, namespace, resyncPeriod, indexers, nil)
}
// NewFilteredBackgroundScanReportInformer constructs a new informer for BackgroundScanReport type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewFilteredBackgroundScanReportInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ReportsV1().BackgroundScanReports(namespace).List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ReportsV1().BackgroundScanReports(namespace).Watch(context.TODO(), options)
},
},
&reportsv1.BackgroundScanReport{},
resyncPeriod,
indexers,
)
}
func (f *backgroundScanReportInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredBackgroundScanReportInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
func (f *backgroundScanReportInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&reportsv1.BackgroundScanReport{}, f.defaultInformer)
}
func (f *backgroundScanReportInformer) Lister() v1.BackgroundScanReportLister {
return v1.NewBackgroundScanReportLister(f.Informer().GetIndexer())
}

View file

@ -1,89 +0,0 @@
/*
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 informer-gen. DO NOT EDIT.
package v1
import (
"context"
time "time"
reportsv1 "github.com/kyverno/kyverno/api/reports/v1"
versioned "github.com/kyverno/kyverno/pkg/client/clientset/versioned"
internalinterfaces "github.com/kyverno/kyverno/pkg/client/informers/externalversions/internalinterfaces"
v1 "github.com/kyverno/kyverno/pkg/client/listers/reports/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
)
// ClusterBackgroundScanReportInformer provides access to a shared informer and lister for
// ClusterBackgroundScanReports.
type ClusterBackgroundScanReportInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1.ClusterBackgroundScanReportLister
}
type clusterBackgroundScanReportInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
}
// NewClusterBackgroundScanReportInformer constructs a new informer for ClusterBackgroundScanReport type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewClusterBackgroundScanReportInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredClusterBackgroundScanReportInformer(client, resyncPeriod, indexers, nil)
}
// NewFilteredClusterBackgroundScanReportInformer constructs a new informer for ClusterBackgroundScanReport type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewFilteredClusterBackgroundScanReportInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ReportsV1().ClusterBackgroundScanReports().List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ReportsV1().ClusterBackgroundScanReports().Watch(context.TODO(), options)
},
},
&reportsv1.ClusterBackgroundScanReport{},
resyncPeriod,
indexers,
)
}
func (f *clusterBackgroundScanReportInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredClusterBackgroundScanReportInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
func (f *clusterBackgroundScanReportInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&reportsv1.ClusterBackgroundScanReport{}, f.defaultInformer)
}
func (f *clusterBackgroundScanReportInformer) Lister() v1.ClusterBackgroundScanReportLister {
return v1.NewClusterBackgroundScanReportLister(f.Informer().GetIndexer())
}

View file

@ -32,58 +32,58 @@ import (
cache "k8s.io/client-go/tools/cache"
)
// ClusterAdmissionReportInformer provides access to a shared informer and lister for
// ClusterAdmissionReports.
type ClusterAdmissionReportInformer interface {
// ClusterEphemeralReportInformer provides access to a shared informer and lister for
// ClusterEphemeralReports.
type ClusterEphemeralReportInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1.ClusterAdmissionReportLister
Lister() v1.ClusterEphemeralReportLister
}
type clusterAdmissionReportInformer struct {
type clusterEphemeralReportInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
}
// NewClusterAdmissionReportInformer constructs a new informer for ClusterAdmissionReport type.
// NewClusterEphemeralReportInformer constructs a new informer for ClusterEphemeralReport type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewClusterAdmissionReportInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredClusterAdmissionReportInformer(client, resyncPeriod, indexers, nil)
func NewClusterEphemeralReportInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredClusterEphemeralReportInformer(client, resyncPeriod, indexers, nil)
}
// NewFilteredClusterAdmissionReportInformer constructs a new informer for ClusterAdmissionReport type.
// NewFilteredClusterEphemeralReportInformer constructs a new informer for ClusterEphemeralReport type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewFilteredClusterAdmissionReportInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
func NewFilteredClusterEphemeralReportInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ReportsV1().ClusterAdmissionReports().List(context.TODO(), options)
return client.ReportsV1().ClusterEphemeralReports().List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ReportsV1().ClusterAdmissionReports().Watch(context.TODO(), options)
return client.ReportsV1().ClusterEphemeralReports().Watch(context.TODO(), options)
},
},
&reportsv1.ClusterAdmissionReport{},
&reportsv1.ClusterEphemeralReport{},
resyncPeriod,
indexers,
)
}
func (f *clusterAdmissionReportInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredClusterAdmissionReportInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
func (f *clusterEphemeralReportInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredClusterEphemeralReportInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
func (f *clusterAdmissionReportInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&reportsv1.ClusterAdmissionReport{}, f.defaultInformer)
func (f *clusterEphemeralReportInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&reportsv1.ClusterEphemeralReport{}, f.defaultInformer)
}
func (f *clusterAdmissionReportInformer) Lister() v1.ClusterAdmissionReportLister {
return v1.NewClusterAdmissionReportLister(f.Informer().GetIndexer())
func (f *clusterEphemeralReportInformer) Lister() v1.ClusterEphemeralReportLister {
return v1.NewClusterEphemeralReportLister(f.Informer().GetIndexer())
}

View file

@ -32,59 +32,59 @@ import (
cache "k8s.io/client-go/tools/cache"
)
// AdmissionReportInformer provides access to a shared informer and lister for
// AdmissionReports.
type AdmissionReportInformer interface {
// EphemeralReportInformer provides access to a shared informer and lister for
// EphemeralReports.
type EphemeralReportInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1.AdmissionReportLister
Lister() v1.EphemeralReportLister
}
type admissionReportInformer struct {
type ephemeralReportInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
namespace string
}
// NewAdmissionReportInformer constructs a new informer for AdmissionReport type.
// NewEphemeralReportInformer constructs a new informer for EphemeralReport type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewAdmissionReportInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredAdmissionReportInformer(client, namespace, resyncPeriod, indexers, nil)
func NewEphemeralReportInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredEphemeralReportInformer(client, namespace, resyncPeriod, indexers, nil)
}
// NewFilteredAdmissionReportInformer constructs a new informer for AdmissionReport type.
// NewFilteredEphemeralReportInformer constructs a new informer for EphemeralReport type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewFilteredAdmissionReportInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
func NewFilteredEphemeralReportInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ReportsV1().AdmissionReports(namespace).List(context.TODO(), options)
return client.ReportsV1().EphemeralReports(namespace).List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ReportsV1().AdmissionReports(namespace).Watch(context.TODO(), options)
return client.ReportsV1().EphemeralReports(namespace).Watch(context.TODO(), options)
},
},
&reportsv1.AdmissionReport{},
&reportsv1.EphemeralReport{},
resyncPeriod,
indexers,
)
}
func (f *admissionReportInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredAdmissionReportInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
func (f *ephemeralReportInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredEphemeralReportInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
func (f *admissionReportInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&reportsv1.AdmissionReport{}, f.defaultInformer)
func (f *ephemeralReportInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&reportsv1.EphemeralReport{}, f.defaultInformer)
}
func (f *admissionReportInformer) Lister() v1.AdmissionReportLister {
return v1.NewAdmissionReportLister(f.Informer().GetIndexer())
func (f *ephemeralReportInformer) Lister() v1.EphemeralReportLister {
return v1.NewEphemeralReportLister(f.Informer().GetIndexer())
}

View file

@ -24,14 +24,10 @@ import (
// Interface provides access to all the informers in this group version.
type Interface interface {
// AdmissionReports returns a AdmissionReportInformer.
AdmissionReports() AdmissionReportInformer
// BackgroundScanReports returns a BackgroundScanReportInformer.
BackgroundScanReports() BackgroundScanReportInformer
// ClusterAdmissionReports returns a ClusterAdmissionReportInformer.
ClusterAdmissionReports() ClusterAdmissionReportInformer
// ClusterBackgroundScanReports returns a ClusterBackgroundScanReportInformer.
ClusterBackgroundScanReports() ClusterBackgroundScanReportInformer
// ClusterEphemeralReports returns a ClusterEphemeralReportInformer.
ClusterEphemeralReports() ClusterEphemeralReportInformer
// EphemeralReports returns a EphemeralReportInformer.
EphemeralReports() EphemeralReportInformer
}
type version struct {
@ -45,22 +41,12 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList
return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
}
// AdmissionReports returns a AdmissionReportInformer.
func (v *version) AdmissionReports() AdmissionReportInformer {
return &admissionReportInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
// ClusterEphemeralReports returns a ClusterEphemeralReportInformer.
func (v *version) ClusterEphemeralReports() ClusterEphemeralReportInformer {
return &clusterEphemeralReportInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
}
// BackgroundScanReports returns a BackgroundScanReportInformer.
func (v *version) BackgroundScanReports() BackgroundScanReportInformer {
return &backgroundScanReportInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}
// ClusterAdmissionReports returns a ClusterAdmissionReportInformer.
func (v *version) ClusterAdmissionReports() ClusterAdmissionReportInformer {
return &clusterAdmissionReportInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
}
// ClusterBackgroundScanReports returns a ClusterBackgroundScanReportInformer.
func (v *version) ClusterBackgroundScanReports() ClusterBackgroundScanReportInformer {
return &clusterBackgroundScanReportInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
// EphemeralReports returns a EphemeralReportInformer.
func (v *version) EphemeralReports() EphemeralReportInformer {
return &ephemeralReportInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}

View file

@ -1,99 +0,0 @@
/*
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 lister-gen. DO NOT EDIT.
package v1
import (
v1 "github.com/kyverno/kyverno/api/reports/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
)
// AdmissionReportLister helps list AdmissionReports.
// All objects returned here must be treated as read-only.
type AdmissionReportLister interface {
// List lists all AdmissionReports in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1.AdmissionReport, err error)
// AdmissionReports returns an object that can list and get AdmissionReports.
AdmissionReports(namespace string) AdmissionReportNamespaceLister
AdmissionReportListerExpansion
}
// admissionReportLister implements the AdmissionReportLister interface.
type admissionReportLister struct {
indexer cache.Indexer
}
// NewAdmissionReportLister returns a new AdmissionReportLister.
func NewAdmissionReportLister(indexer cache.Indexer) AdmissionReportLister {
return &admissionReportLister{indexer: indexer}
}
// List lists all AdmissionReports in the indexer.
func (s *admissionReportLister) List(selector labels.Selector) (ret []*v1.AdmissionReport, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1.AdmissionReport))
})
return ret, err
}
// AdmissionReports returns an object that can list and get AdmissionReports.
func (s *admissionReportLister) AdmissionReports(namespace string) AdmissionReportNamespaceLister {
return admissionReportNamespaceLister{indexer: s.indexer, namespace: namespace}
}
// AdmissionReportNamespaceLister helps list and get AdmissionReports.
// All objects returned here must be treated as read-only.
type AdmissionReportNamespaceLister interface {
// List lists all AdmissionReports in the indexer for a given namespace.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1.AdmissionReport, err error)
// Get retrieves the AdmissionReport from the indexer for a given namespace and name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1.AdmissionReport, error)
AdmissionReportNamespaceListerExpansion
}
// admissionReportNamespaceLister implements the AdmissionReportNamespaceLister
// interface.
type admissionReportNamespaceLister struct {
indexer cache.Indexer
namespace string
}
// List lists all AdmissionReports in the indexer for a given namespace.
func (s admissionReportNamespaceLister) List(selector labels.Selector) (ret []*v1.AdmissionReport, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1.AdmissionReport))
})
return ret, err
}
// Get retrieves the AdmissionReport from the indexer for a given namespace and name.
func (s admissionReportNamespaceLister) Get(name string) (*v1.AdmissionReport, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1.Resource("admissionreport"), name)
}
return obj.(*v1.AdmissionReport), nil
}

View file

@ -1,99 +0,0 @@
/*
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 lister-gen. DO NOT EDIT.
package v1
import (
v1 "github.com/kyverno/kyverno/api/reports/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
)
// BackgroundScanReportLister helps list BackgroundScanReports.
// All objects returned here must be treated as read-only.
type BackgroundScanReportLister interface {
// List lists all BackgroundScanReports in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1.BackgroundScanReport, err error)
// BackgroundScanReports returns an object that can list and get BackgroundScanReports.
BackgroundScanReports(namespace string) BackgroundScanReportNamespaceLister
BackgroundScanReportListerExpansion
}
// backgroundScanReportLister implements the BackgroundScanReportLister interface.
type backgroundScanReportLister struct {
indexer cache.Indexer
}
// NewBackgroundScanReportLister returns a new BackgroundScanReportLister.
func NewBackgroundScanReportLister(indexer cache.Indexer) BackgroundScanReportLister {
return &backgroundScanReportLister{indexer: indexer}
}
// List lists all BackgroundScanReports in the indexer.
func (s *backgroundScanReportLister) List(selector labels.Selector) (ret []*v1.BackgroundScanReport, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1.BackgroundScanReport))
})
return ret, err
}
// BackgroundScanReports returns an object that can list and get BackgroundScanReports.
func (s *backgroundScanReportLister) BackgroundScanReports(namespace string) BackgroundScanReportNamespaceLister {
return backgroundScanReportNamespaceLister{indexer: s.indexer, namespace: namespace}
}
// BackgroundScanReportNamespaceLister helps list and get BackgroundScanReports.
// All objects returned here must be treated as read-only.
type BackgroundScanReportNamespaceLister interface {
// List lists all BackgroundScanReports in the indexer for a given namespace.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1.BackgroundScanReport, err error)
// Get retrieves the BackgroundScanReport from the indexer for a given namespace and name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1.BackgroundScanReport, error)
BackgroundScanReportNamespaceListerExpansion
}
// backgroundScanReportNamespaceLister implements the BackgroundScanReportNamespaceLister
// interface.
type backgroundScanReportNamespaceLister struct {
indexer cache.Indexer
namespace string
}
// List lists all BackgroundScanReports in the indexer for a given namespace.
func (s backgroundScanReportNamespaceLister) List(selector labels.Selector) (ret []*v1.BackgroundScanReport, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1.BackgroundScanReport))
})
return ret, err
}
// Get retrieves the BackgroundScanReport from the indexer for a given namespace and name.
func (s backgroundScanReportNamespaceLister) Get(name string) (*v1.BackgroundScanReport, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1.Resource("backgroundscanreport"), name)
}
return obj.(*v1.BackgroundScanReport), nil
}

View file

@ -1,68 +0,0 @@
/*
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 lister-gen. DO NOT EDIT.
package v1
import (
v1 "github.com/kyverno/kyverno/api/reports/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
)
// ClusterBackgroundScanReportLister helps list ClusterBackgroundScanReports.
// All objects returned here must be treated as read-only.
type ClusterBackgroundScanReportLister interface {
// List lists all ClusterBackgroundScanReports in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1.ClusterBackgroundScanReport, err error)
// Get retrieves the ClusterBackgroundScanReport from the index for a given name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1.ClusterBackgroundScanReport, error)
ClusterBackgroundScanReportListerExpansion
}
// clusterBackgroundScanReportLister implements the ClusterBackgroundScanReportLister interface.
type clusterBackgroundScanReportLister struct {
indexer cache.Indexer
}
// NewClusterBackgroundScanReportLister returns a new ClusterBackgroundScanReportLister.
func NewClusterBackgroundScanReportLister(indexer cache.Indexer) ClusterBackgroundScanReportLister {
return &clusterBackgroundScanReportLister{indexer: indexer}
}
// List lists all ClusterBackgroundScanReports in the indexer.
func (s *clusterBackgroundScanReportLister) List(selector labels.Selector) (ret []*v1.ClusterBackgroundScanReport, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1.ClusterBackgroundScanReport))
})
return ret, err
}
// Get retrieves the ClusterBackgroundScanReport from the index for a given name.
func (s *clusterBackgroundScanReportLister) Get(name string) (*v1.ClusterBackgroundScanReport, error) {
obj, exists, err := s.indexer.GetByKey(name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1.Resource("clusterbackgroundscanreport"), name)
}
return obj.(*v1.ClusterBackgroundScanReport), nil
}

View file

@ -25,44 +25,44 @@ import (
"k8s.io/client-go/tools/cache"
)
// ClusterAdmissionReportLister helps list ClusterAdmissionReports.
// ClusterEphemeralReportLister helps list ClusterEphemeralReports.
// All objects returned here must be treated as read-only.
type ClusterAdmissionReportLister interface {
// List lists all ClusterAdmissionReports in the indexer.
type ClusterEphemeralReportLister interface {
// List lists all ClusterEphemeralReports in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1.ClusterAdmissionReport, err error)
// Get retrieves the ClusterAdmissionReport from the index for a given name.
List(selector labels.Selector) (ret []*v1.ClusterEphemeralReport, err error)
// Get retrieves the ClusterEphemeralReport from the index for a given name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1.ClusterAdmissionReport, error)
ClusterAdmissionReportListerExpansion
Get(name string) (*v1.ClusterEphemeralReport, error)
ClusterEphemeralReportListerExpansion
}
// clusterAdmissionReportLister implements the ClusterAdmissionReportLister interface.
type clusterAdmissionReportLister struct {
// clusterEphemeralReportLister implements the ClusterEphemeralReportLister interface.
type clusterEphemeralReportLister struct {
indexer cache.Indexer
}
// NewClusterAdmissionReportLister returns a new ClusterAdmissionReportLister.
func NewClusterAdmissionReportLister(indexer cache.Indexer) ClusterAdmissionReportLister {
return &clusterAdmissionReportLister{indexer: indexer}
// NewClusterEphemeralReportLister returns a new ClusterEphemeralReportLister.
func NewClusterEphemeralReportLister(indexer cache.Indexer) ClusterEphemeralReportLister {
return &clusterEphemeralReportLister{indexer: indexer}
}
// List lists all ClusterAdmissionReports in the indexer.
func (s *clusterAdmissionReportLister) List(selector labels.Selector) (ret []*v1.ClusterAdmissionReport, err error) {
// List lists all ClusterEphemeralReports in the indexer.
func (s *clusterEphemeralReportLister) List(selector labels.Selector) (ret []*v1.ClusterEphemeralReport, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1.ClusterAdmissionReport))
ret = append(ret, m.(*v1.ClusterEphemeralReport))
})
return ret, err
}
// Get retrieves the ClusterAdmissionReport from the index for a given name.
func (s *clusterAdmissionReportLister) Get(name string) (*v1.ClusterAdmissionReport, error) {
// Get retrieves the ClusterEphemeralReport from the index for a given name.
func (s *clusterEphemeralReportLister) Get(name string) (*v1.ClusterEphemeralReport, error) {
obj, exists, err := s.indexer.GetByKey(name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1.Resource("clusteradmissionreport"), name)
return nil, errors.NewNotFound(v1.Resource("clusterephemeralreport"), name)
}
return obj.(*v1.ClusterAdmissionReport), nil
return obj.(*v1.ClusterEphemeralReport), nil
}

View file

@ -0,0 +1,99 @@
/*
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 lister-gen. DO NOT EDIT.
package v1
import (
v1 "github.com/kyverno/kyverno/api/reports/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
)
// EphemeralReportLister helps list EphemeralReports.
// All objects returned here must be treated as read-only.
type EphemeralReportLister interface {
// List lists all EphemeralReports in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1.EphemeralReport, err error)
// EphemeralReports returns an object that can list and get EphemeralReports.
EphemeralReports(namespace string) EphemeralReportNamespaceLister
EphemeralReportListerExpansion
}
// ephemeralReportLister implements the EphemeralReportLister interface.
type ephemeralReportLister struct {
indexer cache.Indexer
}
// NewEphemeralReportLister returns a new EphemeralReportLister.
func NewEphemeralReportLister(indexer cache.Indexer) EphemeralReportLister {
return &ephemeralReportLister{indexer: indexer}
}
// List lists all EphemeralReports in the indexer.
func (s *ephemeralReportLister) List(selector labels.Selector) (ret []*v1.EphemeralReport, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1.EphemeralReport))
})
return ret, err
}
// EphemeralReports returns an object that can list and get EphemeralReports.
func (s *ephemeralReportLister) EphemeralReports(namespace string) EphemeralReportNamespaceLister {
return ephemeralReportNamespaceLister{indexer: s.indexer, namespace: namespace}
}
// EphemeralReportNamespaceLister helps list and get EphemeralReports.
// All objects returned here must be treated as read-only.
type EphemeralReportNamespaceLister interface {
// List lists all EphemeralReports in the indexer for a given namespace.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1.EphemeralReport, err error)
// Get retrieves the EphemeralReport from the indexer for a given namespace and name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1.EphemeralReport, error)
EphemeralReportNamespaceListerExpansion
}
// ephemeralReportNamespaceLister implements the EphemeralReportNamespaceLister
// interface.
type ephemeralReportNamespaceLister struct {
indexer cache.Indexer
namespace string
}
// List lists all EphemeralReports in the indexer for a given namespace.
func (s ephemeralReportNamespaceLister) List(selector labels.Selector) (ret []*v1.EphemeralReport, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1.EphemeralReport))
})
return ret, err
}
// Get retrieves the EphemeralReport from the indexer for a given namespace and name.
func (s ephemeralReportNamespaceLister) Get(name string) (*v1.EphemeralReport, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1.Resource("ephemeralreport"), name)
}
return obj.(*v1.EphemeralReport), nil
}

View file

@ -18,26 +18,14 @@ limitations under the License.
package v1
// AdmissionReportListerExpansion allows custom methods to be added to
// AdmissionReportLister.
type AdmissionReportListerExpansion interface{}
// ClusterEphemeralReportListerExpansion allows custom methods to be added to
// ClusterEphemeralReportLister.
type ClusterEphemeralReportListerExpansion interface{}
// AdmissionReportNamespaceListerExpansion allows custom methods to be added to
// AdmissionReportNamespaceLister.
type AdmissionReportNamespaceListerExpansion interface{}
// EphemeralReportListerExpansion allows custom methods to be added to
// EphemeralReportLister.
type EphemeralReportListerExpansion interface{}
// BackgroundScanReportListerExpansion allows custom methods to be added to
// BackgroundScanReportLister.
type BackgroundScanReportListerExpansion interface{}
// BackgroundScanReportNamespaceListerExpansion allows custom methods to be added to
// BackgroundScanReportNamespaceLister.
type BackgroundScanReportNamespaceListerExpansion interface{}
// ClusterAdmissionReportListerExpansion allows custom methods to be added to
// ClusterAdmissionReportLister.
type ClusterAdmissionReportListerExpansion interface{}
// ClusterBackgroundScanReportListerExpansion allows custom methods to be added to
// ClusterBackgroundScanReportLister.
type ClusterBackgroundScanReportListerExpansion interface{}
// EphemeralReportNamespaceListerExpansion allows custom methods to be added to
// EphemeralReportNamespaceLister.
type EphemeralReportNamespaceListerExpansion interface{}

View file

@ -1,337 +0,0 @@
package resource
import (
context "context"
"fmt"
"time"
"github.com/go-logr/logr"
github_com_kyverno_kyverno_api_reports_v1 "github.com/kyverno/kyverno/api/reports/v1"
github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/reports/v1"
"github.com/kyverno/kyverno/pkg/metrics"
"github.com/kyverno/kyverno/pkg/tracing"
"go.opentelemetry.io/otel/trace"
"go.uber.org/multierr"
k8s_io_apimachinery_pkg_apis_meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
k8s_io_apimachinery_pkg_types "k8s.io/apimachinery/pkg/types"
k8s_io_apimachinery_pkg_watch "k8s.io/apimachinery/pkg/watch"
)
func WithLogging(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.BackgroundScanReportInterface, logger logr.Logger) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.BackgroundScanReportInterface {
return &withLogging{inner, logger}
}
func WithMetrics(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.BackgroundScanReportInterface, recorder metrics.Recorder) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.BackgroundScanReportInterface {
return &withMetrics{inner, recorder}
}
func WithTracing(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.BackgroundScanReportInterface, client, kind string) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.BackgroundScanReportInterface {
return &withTracing{inner, client, kind}
}
type withLogging struct {
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.BackgroundScanReportInterface
logger logr.Logger
}
func (c *withLogging) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_reports_v1.BackgroundScanReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_reports_v1.BackgroundScanReport, error) {
start := time.Now()
logger := c.logger.WithValues("operation", "Create")
ret0, ret1 := c.inner.Create(arg0, arg1, arg2)
if err := multierr.Combine(ret1); err != nil {
logger.Error(err, "Create failed", "duration", time.Since(start))
} else {
logger.Info("Create done", "duration", time.Since(start))
}
return ret0, ret1
}
func (c *withLogging) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error {
start := time.Now()
logger := c.logger.WithValues("operation", "Delete")
ret0 := c.inner.Delete(arg0, arg1, arg2)
if err := multierr.Combine(ret0); err != nil {
logger.Error(err, "Delete failed", "duration", time.Since(start))
} else {
logger.Info("Delete done", "duration", time.Since(start))
}
return ret0
}
func (c *withLogging) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) error {
start := time.Now()
logger := c.logger.WithValues("operation", "DeleteCollection")
ret0 := c.inner.DeleteCollection(arg0, arg1, arg2)
if err := multierr.Combine(ret0); err != nil {
logger.Error(err, "DeleteCollection failed", "duration", time.Since(start))
} else {
logger.Info("DeleteCollection done", "duration", time.Since(start))
}
return ret0
}
func (c *withLogging) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_reports_v1.BackgroundScanReport, error) {
start := time.Now()
logger := c.logger.WithValues("operation", "Get")
ret0, ret1 := c.inner.Get(arg0, arg1, arg2)
if err := multierr.Combine(ret1); err != nil {
logger.Error(err, "Get failed", "duration", time.Since(start))
} else {
logger.Info("Get done", "duration", time.Since(start))
}
return ret0, ret1
}
func (c *withLogging) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_reports_v1.BackgroundScanReportList, error) {
start := time.Now()
logger := c.logger.WithValues("operation", "List")
ret0, ret1 := c.inner.List(arg0, arg1)
if err := multierr.Combine(ret1); err != nil {
logger.Error(err, "List failed", "duration", time.Since(start))
} else {
logger.Info("List done", "duration", time.Since(start))
}
return ret0, ret1
}
func (c *withLogging) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_reports_v1.BackgroundScanReport, error) {
start := time.Now()
logger := c.logger.WithValues("operation", "Patch")
ret0, ret1 := c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...)
if err := multierr.Combine(ret1); err != nil {
logger.Error(err, "Patch failed", "duration", time.Since(start))
} else {
logger.Info("Patch done", "duration", time.Since(start))
}
return ret0, ret1
}
func (c *withLogging) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_reports_v1.BackgroundScanReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_reports_v1.BackgroundScanReport, error) {
start := time.Now()
logger := c.logger.WithValues("operation", "Update")
ret0, ret1 := c.inner.Update(arg0, arg1, arg2)
if err := multierr.Combine(ret1); err != nil {
logger.Error(err, "Update failed", "duration", time.Since(start))
} else {
logger.Info("Update done", "duration", time.Since(start))
}
return ret0, ret1
}
func (c *withLogging) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (k8s_io_apimachinery_pkg_watch.Interface, error) {
start := time.Now()
logger := c.logger.WithValues("operation", "Watch")
ret0, ret1 := c.inner.Watch(arg0, arg1)
if err := multierr.Combine(ret1); err != nil {
logger.Error(err, "Watch failed", "duration", time.Since(start))
} else {
logger.Info("Watch done", "duration", time.Since(start))
}
return ret0, ret1
}
type withMetrics struct {
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.BackgroundScanReportInterface
recorder metrics.Recorder
}
func (c *withMetrics) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_reports_v1.BackgroundScanReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_reports_v1.BackgroundScanReport, error) {
defer c.recorder.RecordWithContext(arg0, "create")
return c.inner.Create(arg0, arg1, arg2)
}
func (c *withMetrics) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error {
defer c.recorder.RecordWithContext(arg0, "delete")
return c.inner.Delete(arg0, arg1, arg2)
}
func (c *withMetrics) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) error {
defer c.recorder.RecordWithContext(arg0, "delete_collection")
return c.inner.DeleteCollection(arg0, arg1, arg2)
}
func (c *withMetrics) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_reports_v1.BackgroundScanReport, error) {
defer c.recorder.RecordWithContext(arg0, "get")
return c.inner.Get(arg0, arg1, arg2)
}
func (c *withMetrics) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_reports_v1.BackgroundScanReportList, error) {
defer c.recorder.RecordWithContext(arg0, "list")
return c.inner.List(arg0, arg1)
}
func (c *withMetrics) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_reports_v1.BackgroundScanReport, error) {
defer c.recorder.RecordWithContext(arg0, "patch")
return c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...)
}
func (c *withMetrics) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_reports_v1.BackgroundScanReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_reports_v1.BackgroundScanReport, error) {
defer c.recorder.RecordWithContext(arg0, "update")
return c.inner.Update(arg0, arg1, arg2)
}
func (c *withMetrics) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (k8s_io_apimachinery_pkg_watch.Interface, error) {
defer c.recorder.RecordWithContext(arg0, "watch")
return c.inner.Watch(arg0, arg1)
}
type withTracing struct {
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.BackgroundScanReportInterface
client string
kind string
}
func (c *withTracing) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_reports_v1.BackgroundScanReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_reports_v1.BackgroundScanReport, error) {
var span trace.Span
if tracing.IsInSpan(arg0) {
arg0, span = tracing.StartChildSpan(
arg0,
"",
fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Create"),
trace.WithAttributes(
tracing.KubeClientGroupKey.String(c.client),
tracing.KubeClientKindKey.String(c.kind),
tracing.KubeClientOperationKey.String("Create"),
),
)
defer span.End()
}
ret0, ret1 := c.inner.Create(arg0, arg1, arg2)
if span != nil {
tracing.SetSpanStatus(span, ret1)
}
return ret0, ret1
}
func (c *withTracing) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error {
var span trace.Span
if tracing.IsInSpan(arg0) {
arg0, span = tracing.StartChildSpan(
arg0,
"",
fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Delete"),
trace.WithAttributes(
tracing.KubeClientGroupKey.String(c.client),
tracing.KubeClientKindKey.String(c.kind),
tracing.KubeClientOperationKey.String("Delete"),
),
)
defer span.End()
}
ret0 := c.inner.Delete(arg0, arg1, arg2)
if span != nil {
tracing.SetSpanStatus(span, ret0)
}
return ret0
}
func (c *withTracing) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) error {
var span trace.Span
if tracing.IsInSpan(arg0) {
arg0, span = tracing.StartChildSpan(
arg0,
"",
fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "DeleteCollection"),
trace.WithAttributes(
tracing.KubeClientGroupKey.String(c.client),
tracing.KubeClientKindKey.String(c.kind),
tracing.KubeClientOperationKey.String("DeleteCollection"),
),
)
defer span.End()
}
ret0 := c.inner.DeleteCollection(arg0, arg1, arg2)
if span != nil {
tracing.SetSpanStatus(span, ret0)
}
return ret0
}
func (c *withTracing) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_reports_v1.BackgroundScanReport, error) {
var span trace.Span
if tracing.IsInSpan(arg0) {
arg0, span = tracing.StartChildSpan(
arg0,
"",
fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Get"),
trace.WithAttributes(
tracing.KubeClientGroupKey.String(c.client),
tracing.KubeClientKindKey.String(c.kind),
tracing.KubeClientOperationKey.String("Get"),
),
)
defer span.End()
}
ret0, ret1 := c.inner.Get(arg0, arg1, arg2)
if span != nil {
tracing.SetSpanStatus(span, ret1)
}
return ret0, ret1
}
func (c *withTracing) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_reports_v1.BackgroundScanReportList, error) {
var span trace.Span
if tracing.IsInSpan(arg0) {
arg0, span = tracing.StartChildSpan(
arg0,
"",
fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "List"),
trace.WithAttributes(
tracing.KubeClientGroupKey.String(c.client),
tracing.KubeClientKindKey.String(c.kind),
tracing.KubeClientOperationKey.String("List"),
),
)
defer span.End()
}
ret0, ret1 := c.inner.List(arg0, arg1)
if span != nil {
tracing.SetSpanStatus(span, ret1)
}
return ret0, ret1
}
func (c *withTracing) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_reports_v1.BackgroundScanReport, error) {
var span trace.Span
if tracing.IsInSpan(arg0) {
arg0, span = tracing.StartChildSpan(
arg0,
"",
fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Patch"),
trace.WithAttributes(
tracing.KubeClientGroupKey.String(c.client),
tracing.KubeClientKindKey.String(c.kind),
tracing.KubeClientOperationKey.String("Patch"),
),
)
defer span.End()
}
ret0, ret1 := c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...)
if span != nil {
tracing.SetSpanStatus(span, ret1)
}
return ret0, ret1
}
func (c *withTracing) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_reports_v1.BackgroundScanReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_reports_v1.BackgroundScanReport, error) {
var span trace.Span
if tracing.IsInSpan(arg0) {
arg0, span = tracing.StartChildSpan(
arg0,
"",
fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Update"),
trace.WithAttributes(
tracing.KubeClientGroupKey.String(c.client),
tracing.KubeClientKindKey.String(c.kind),
tracing.KubeClientOperationKey.String("Update"),
),
)
defer span.End()
}
ret0, ret1 := c.inner.Update(arg0, arg1, arg2)
if span != nil {
tracing.SetSpanStatus(span, ret1)
}
return ret0, ret1
}
func (c *withTracing) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (k8s_io_apimachinery_pkg_watch.Interface, error) {
var span trace.Span
if tracing.IsInSpan(arg0) {
arg0, span = tracing.StartChildSpan(
arg0,
"",
fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Watch"),
trace.WithAttributes(
tracing.KubeClientGroupKey.String(c.client),
tracing.KubeClientKindKey.String(c.kind),
tracing.KubeClientOperationKey.String("Watch"),
),
)
defer span.End()
}
ret0, ret1 := c.inner.Watch(arg0, arg1)
if span != nil {
tracing.SetSpanStatus(span, ret1)
}
return ret0, ret1
}

View file

@ -3,10 +3,8 @@ package client
import (
"github.com/go-logr/logr"
github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/reports/v1"
admissionreports "github.com/kyverno/kyverno/pkg/clients/kyverno/reportsv1/admissionreports"
backgroundscanreports "github.com/kyverno/kyverno/pkg/clients/kyverno/reportsv1/backgroundscanreports"
clusteradmissionreports "github.com/kyverno/kyverno/pkg/clients/kyverno/reportsv1/clusteradmissionreports"
clusterbackgroundscanreports "github.com/kyverno/kyverno/pkg/clients/kyverno/reportsv1/clusterbackgroundscanreports"
clusterephemeralreports "github.com/kyverno/kyverno/pkg/clients/kyverno/reportsv1/clusterephemeralreports"
ephemeralreports "github.com/kyverno/kyverno/pkg/clients/kyverno/reportsv1/ephemeralreports"
"github.com/kyverno/kyverno/pkg/metrics"
"k8s.io/client-go/rest"
)
@ -32,21 +30,13 @@ type withMetrics struct {
func (c *withMetrics) RESTClient() rest.Interface {
return c.inner.RESTClient()
}
func (c *withMetrics) AdmissionReports(namespace string) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.AdmissionReportInterface {
recorder := metrics.NamespacedClientQueryRecorder(c.metrics, namespace, "AdmissionReport", c.clientType)
return admissionreports.WithMetrics(c.inner.AdmissionReports(namespace), recorder)
func (c *withMetrics) ClusterEphemeralReports() github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.ClusterEphemeralReportInterface {
recorder := metrics.ClusteredClientQueryRecorder(c.metrics, "ClusterEphemeralReport", c.clientType)
return clusterephemeralreports.WithMetrics(c.inner.ClusterEphemeralReports(), recorder)
}
func (c *withMetrics) BackgroundScanReports(namespace string) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.BackgroundScanReportInterface {
recorder := metrics.NamespacedClientQueryRecorder(c.metrics, namespace, "BackgroundScanReport", c.clientType)
return backgroundscanreports.WithMetrics(c.inner.BackgroundScanReports(namespace), recorder)
}
func (c *withMetrics) ClusterAdmissionReports() github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.ClusterAdmissionReportInterface {
recorder := metrics.ClusteredClientQueryRecorder(c.metrics, "ClusterAdmissionReport", c.clientType)
return clusteradmissionreports.WithMetrics(c.inner.ClusterAdmissionReports(), recorder)
}
func (c *withMetrics) ClusterBackgroundScanReports() github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.ClusterBackgroundScanReportInterface {
recorder := metrics.ClusteredClientQueryRecorder(c.metrics, "ClusterBackgroundScanReport", c.clientType)
return clusterbackgroundscanreports.WithMetrics(c.inner.ClusterBackgroundScanReports(), recorder)
func (c *withMetrics) EphemeralReports(namespace string) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.EphemeralReportInterface {
recorder := metrics.NamespacedClientQueryRecorder(c.metrics, namespace, "EphemeralReport", c.clientType)
return ephemeralreports.WithMetrics(c.inner.EphemeralReports(namespace), recorder)
}
type withTracing struct {
@ -57,17 +47,11 @@ type withTracing struct {
func (c *withTracing) RESTClient() rest.Interface {
return c.inner.RESTClient()
}
func (c *withTracing) AdmissionReports(namespace string) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.AdmissionReportInterface {
return admissionreports.WithTracing(c.inner.AdmissionReports(namespace), c.client, "AdmissionReport")
func (c *withTracing) ClusterEphemeralReports() github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.ClusterEphemeralReportInterface {
return clusterephemeralreports.WithTracing(c.inner.ClusterEphemeralReports(), c.client, "ClusterEphemeralReport")
}
func (c *withTracing) BackgroundScanReports(namespace string) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.BackgroundScanReportInterface {
return backgroundscanreports.WithTracing(c.inner.BackgroundScanReports(namespace), c.client, "BackgroundScanReport")
}
func (c *withTracing) ClusterAdmissionReports() github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.ClusterAdmissionReportInterface {
return clusteradmissionreports.WithTracing(c.inner.ClusterAdmissionReports(), c.client, "ClusterAdmissionReport")
}
func (c *withTracing) ClusterBackgroundScanReports() github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.ClusterBackgroundScanReportInterface {
return clusterbackgroundscanreports.WithTracing(c.inner.ClusterBackgroundScanReports(), c.client, "ClusterBackgroundScanReport")
func (c *withTracing) EphemeralReports(namespace string) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.EphemeralReportInterface {
return ephemeralreports.WithTracing(c.inner.EphemeralReports(namespace), c.client, "EphemeralReport")
}
type withLogging struct {
@ -78,15 +62,9 @@ type withLogging struct {
func (c *withLogging) RESTClient() rest.Interface {
return c.inner.RESTClient()
}
func (c *withLogging) AdmissionReports(namespace string) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.AdmissionReportInterface {
return admissionreports.WithLogging(c.inner.AdmissionReports(namespace), c.logger.WithValues("resource", "AdmissionReports").WithValues("namespace", namespace))
func (c *withLogging) ClusterEphemeralReports() github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.ClusterEphemeralReportInterface {
return clusterephemeralreports.WithLogging(c.inner.ClusterEphemeralReports(), c.logger.WithValues("resource", "ClusterEphemeralReports"))
}
func (c *withLogging) BackgroundScanReports(namespace string) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.BackgroundScanReportInterface {
return backgroundscanreports.WithLogging(c.inner.BackgroundScanReports(namespace), c.logger.WithValues("resource", "BackgroundScanReports").WithValues("namespace", namespace))
}
func (c *withLogging) ClusterAdmissionReports() github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.ClusterAdmissionReportInterface {
return clusteradmissionreports.WithLogging(c.inner.ClusterAdmissionReports(), c.logger.WithValues("resource", "ClusterAdmissionReports"))
}
func (c *withLogging) ClusterBackgroundScanReports() github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.ClusterBackgroundScanReportInterface {
return clusterbackgroundscanreports.WithLogging(c.inner.ClusterBackgroundScanReports(), c.logger.WithValues("resource", "ClusterBackgroundScanReports"))
func (c *withLogging) EphemeralReports(namespace string) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.EphemeralReportInterface {
return ephemeralreports.WithLogging(c.inner.EphemeralReports(namespace), c.logger.WithValues("resource", "EphemeralReports").WithValues("namespace", namespace))
}

View file

@ -1,337 +0,0 @@
package resource
import (
context "context"
"fmt"
"time"
"github.com/go-logr/logr"
github_com_kyverno_kyverno_api_reports_v1 "github.com/kyverno/kyverno/api/reports/v1"
github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/reports/v1"
"github.com/kyverno/kyverno/pkg/metrics"
"github.com/kyverno/kyverno/pkg/tracing"
"go.opentelemetry.io/otel/trace"
"go.uber.org/multierr"
k8s_io_apimachinery_pkg_apis_meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
k8s_io_apimachinery_pkg_types "k8s.io/apimachinery/pkg/types"
k8s_io_apimachinery_pkg_watch "k8s.io/apimachinery/pkg/watch"
)
func WithLogging(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.ClusterBackgroundScanReportInterface, logger logr.Logger) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.ClusterBackgroundScanReportInterface {
return &withLogging{inner, logger}
}
func WithMetrics(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.ClusterBackgroundScanReportInterface, recorder metrics.Recorder) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.ClusterBackgroundScanReportInterface {
return &withMetrics{inner, recorder}
}
func WithTracing(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.ClusterBackgroundScanReportInterface, client, kind string) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.ClusterBackgroundScanReportInterface {
return &withTracing{inner, client, kind}
}
type withLogging struct {
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.ClusterBackgroundScanReportInterface
logger logr.Logger
}
func (c *withLogging) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_reports_v1.ClusterBackgroundScanReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_reports_v1.ClusterBackgroundScanReport, error) {
start := time.Now()
logger := c.logger.WithValues("operation", "Create")
ret0, ret1 := c.inner.Create(arg0, arg1, arg2)
if err := multierr.Combine(ret1); err != nil {
logger.Error(err, "Create failed", "duration", time.Since(start))
} else {
logger.Info("Create done", "duration", time.Since(start))
}
return ret0, ret1
}
func (c *withLogging) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error {
start := time.Now()
logger := c.logger.WithValues("operation", "Delete")
ret0 := c.inner.Delete(arg0, arg1, arg2)
if err := multierr.Combine(ret0); err != nil {
logger.Error(err, "Delete failed", "duration", time.Since(start))
} else {
logger.Info("Delete done", "duration", time.Since(start))
}
return ret0
}
func (c *withLogging) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) error {
start := time.Now()
logger := c.logger.WithValues("operation", "DeleteCollection")
ret0 := c.inner.DeleteCollection(arg0, arg1, arg2)
if err := multierr.Combine(ret0); err != nil {
logger.Error(err, "DeleteCollection failed", "duration", time.Since(start))
} else {
logger.Info("DeleteCollection done", "duration", time.Since(start))
}
return ret0
}
func (c *withLogging) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_reports_v1.ClusterBackgroundScanReport, error) {
start := time.Now()
logger := c.logger.WithValues("operation", "Get")
ret0, ret1 := c.inner.Get(arg0, arg1, arg2)
if err := multierr.Combine(ret1); err != nil {
logger.Error(err, "Get failed", "duration", time.Since(start))
} else {
logger.Info("Get done", "duration", time.Since(start))
}
return ret0, ret1
}
func (c *withLogging) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_reports_v1.ClusterBackgroundScanReportList, error) {
start := time.Now()
logger := c.logger.WithValues("operation", "List")
ret0, ret1 := c.inner.List(arg0, arg1)
if err := multierr.Combine(ret1); err != nil {
logger.Error(err, "List failed", "duration", time.Since(start))
} else {
logger.Info("List done", "duration", time.Since(start))
}
return ret0, ret1
}
func (c *withLogging) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_reports_v1.ClusterBackgroundScanReport, error) {
start := time.Now()
logger := c.logger.WithValues("operation", "Patch")
ret0, ret1 := c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...)
if err := multierr.Combine(ret1); err != nil {
logger.Error(err, "Patch failed", "duration", time.Since(start))
} else {
logger.Info("Patch done", "duration", time.Since(start))
}
return ret0, ret1
}
func (c *withLogging) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_reports_v1.ClusterBackgroundScanReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_reports_v1.ClusterBackgroundScanReport, error) {
start := time.Now()
logger := c.logger.WithValues("operation", "Update")
ret0, ret1 := c.inner.Update(arg0, arg1, arg2)
if err := multierr.Combine(ret1); err != nil {
logger.Error(err, "Update failed", "duration", time.Since(start))
} else {
logger.Info("Update done", "duration", time.Since(start))
}
return ret0, ret1
}
func (c *withLogging) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (k8s_io_apimachinery_pkg_watch.Interface, error) {
start := time.Now()
logger := c.logger.WithValues("operation", "Watch")
ret0, ret1 := c.inner.Watch(arg0, arg1)
if err := multierr.Combine(ret1); err != nil {
logger.Error(err, "Watch failed", "duration", time.Since(start))
} else {
logger.Info("Watch done", "duration", time.Since(start))
}
return ret0, ret1
}
type withMetrics struct {
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.ClusterBackgroundScanReportInterface
recorder metrics.Recorder
}
func (c *withMetrics) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_reports_v1.ClusterBackgroundScanReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_reports_v1.ClusterBackgroundScanReport, error) {
defer c.recorder.RecordWithContext(arg0, "create")
return c.inner.Create(arg0, arg1, arg2)
}
func (c *withMetrics) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error {
defer c.recorder.RecordWithContext(arg0, "delete")
return c.inner.Delete(arg0, arg1, arg2)
}
func (c *withMetrics) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) error {
defer c.recorder.RecordWithContext(arg0, "delete_collection")
return c.inner.DeleteCollection(arg0, arg1, arg2)
}
func (c *withMetrics) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_reports_v1.ClusterBackgroundScanReport, error) {
defer c.recorder.RecordWithContext(arg0, "get")
return c.inner.Get(arg0, arg1, arg2)
}
func (c *withMetrics) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_reports_v1.ClusterBackgroundScanReportList, error) {
defer c.recorder.RecordWithContext(arg0, "list")
return c.inner.List(arg0, arg1)
}
func (c *withMetrics) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_reports_v1.ClusterBackgroundScanReport, error) {
defer c.recorder.RecordWithContext(arg0, "patch")
return c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...)
}
func (c *withMetrics) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_reports_v1.ClusterBackgroundScanReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_reports_v1.ClusterBackgroundScanReport, error) {
defer c.recorder.RecordWithContext(arg0, "update")
return c.inner.Update(arg0, arg1, arg2)
}
func (c *withMetrics) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (k8s_io_apimachinery_pkg_watch.Interface, error) {
defer c.recorder.RecordWithContext(arg0, "watch")
return c.inner.Watch(arg0, arg1)
}
type withTracing struct {
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.ClusterBackgroundScanReportInterface
client string
kind string
}
func (c *withTracing) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_reports_v1.ClusterBackgroundScanReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_reports_v1.ClusterBackgroundScanReport, error) {
var span trace.Span
if tracing.IsInSpan(arg0) {
arg0, span = tracing.StartChildSpan(
arg0,
"",
fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Create"),
trace.WithAttributes(
tracing.KubeClientGroupKey.String(c.client),
tracing.KubeClientKindKey.String(c.kind),
tracing.KubeClientOperationKey.String("Create"),
),
)
defer span.End()
}
ret0, ret1 := c.inner.Create(arg0, arg1, arg2)
if span != nil {
tracing.SetSpanStatus(span, ret1)
}
return ret0, ret1
}
func (c *withTracing) Delete(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions) error {
var span trace.Span
if tracing.IsInSpan(arg0) {
arg0, span = tracing.StartChildSpan(
arg0,
"",
fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Delete"),
trace.WithAttributes(
tracing.KubeClientGroupKey.String(c.client),
tracing.KubeClientKindKey.String(c.kind),
tracing.KubeClientOperationKey.String("Delete"),
),
)
defer span.End()
}
ret0 := c.inner.Delete(arg0, arg1, arg2)
if span != nil {
tracing.SetSpanStatus(span, ret0)
}
return ret0
}
func (c *withTracing) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) error {
var span trace.Span
if tracing.IsInSpan(arg0) {
arg0, span = tracing.StartChildSpan(
arg0,
"",
fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "DeleteCollection"),
trace.WithAttributes(
tracing.KubeClientGroupKey.String(c.client),
tracing.KubeClientKindKey.String(c.kind),
tracing.KubeClientOperationKey.String("DeleteCollection"),
),
)
defer span.End()
}
ret0 := c.inner.DeleteCollection(arg0, arg1, arg2)
if span != nil {
tracing.SetSpanStatus(span, ret0)
}
return ret0
}
func (c *withTracing) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_reports_v1.ClusterBackgroundScanReport, error) {
var span trace.Span
if tracing.IsInSpan(arg0) {
arg0, span = tracing.StartChildSpan(
arg0,
"",
fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Get"),
trace.WithAttributes(
tracing.KubeClientGroupKey.String(c.client),
tracing.KubeClientKindKey.String(c.kind),
tracing.KubeClientOperationKey.String("Get"),
),
)
defer span.End()
}
ret0, ret1 := c.inner.Get(arg0, arg1, arg2)
if span != nil {
tracing.SetSpanStatus(span, ret1)
}
return ret0, ret1
}
func (c *withTracing) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_reports_v1.ClusterBackgroundScanReportList, error) {
var span trace.Span
if tracing.IsInSpan(arg0) {
arg0, span = tracing.StartChildSpan(
arg0,
"",
fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "List"),
trace.WithAttributes(
tracing.KubeClientGroupKey.String(c.client),
tracing.KubeClientKindKey.String(c.kind),
tracing.KubeClientOperationKey.String("List"),
),
)
defer span.End()
}
ret0, ret1 := c.inner.List(arg0, arg1)
if span != nil {
tracing.SetSpanStatus(span, ret1)
}
return ret0, ret1
}
func (c *withTracing) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_reports_v1.ClusterBackgroundScanReport, error) {
var span trace.Span
if tracing.IsInSpan(arg0) {
arg0, span = tracing.StartChildSpan(
arg0,
"",
fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Patch"),
trace.WithAttributes(
tracing.KubeClientGroupKey.String(c.client),
tracing.KubeClientKindKey.String(c.kind),
tracing.KubeClientOperationKey.String("Patch"),
),
)
defer span.End()
}
ret0, ret1 := c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...)
if span != nil {
tracing.SetSpanStatus(span, ret1)
}
return ret0, ret1
}
func (c *withTracing) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_reports_v1.ClusterBackgroundScanReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_reports_v1.ClusterBackgroundScanReport, error) {
var span trace.Span
if tracing.IsInSpan(arg0) {
arg0, span = tracing.StartChildSpan(
arg0,
"",
fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Update"),
trace.WithAttributes(
tracing.KubeClientGroupKey.String(c.client),
tracing.KubeClientKindKey.String(c.kind),
tracing.KubeClientOperationKey.String("Update"),
),
)
defer span.End()
}
ret0, ret1 := c.inner.Update(arg0, arg1, arg2)
if span != nil {
tracing.SetSpanStatus(span, ret1)
}
return ret0, ret1
}
func (c *withTracing) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (k8s_io_apimachinery_pkg_watch.Interface, error) {
var span trace.Span
if tracing.IsInSpan(arg0) {
arg0, span = tracing.StartChildSpan(
arg0,
"",
fmt.Sprintf("KUBE %s/%s/%s", c.client, c.kind, "Watch"),
trace.WithAttributes(
tracing.KubeClientGroupKey.String(c.client),
tracing.KubeClientKindKey.String(c.kind),
tracing.KubeClientOperationKey.String("Watch"),
),
)
defer span.End()
}
ret0, ret1 := c.inner.Watch(arg0, arg1)
if span != nil {
tracing.SetSpanStatus(span, ret1)
}
return ret0, ret1
}

View file

@ -17,24 +17,24 @@ import (
k8s_io_apimachinery_pkg_watch "k8s.io/apimachinery/pkg/watch"
)
func WithLogging(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.ClusterAdmissionReportInterface, logger logr.Logger) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.ClusterAdmissionReportInterface {
func WithLogging(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.ClusterEphemeralReportInterface, logger logr.Logger) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.ClusterEphemeralReportInterface {
return &withLogging{inner, logger}
}
func WithMetrics(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.ClusterAdmissionReportInterface, recorder metrics.Recorder) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.ClusterAdmissionReportInterface {
func WithMetrics(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.ClusterEphemeralReportInterface, recorder metrics.Recorder) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.ClusterEphemeralReportInterface {
return &withMetrics{inner, recorder}
}
func WithTracing(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.ClusterAdmissionReportInterface, client, kind string) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.ClusterAdmissionReportInterface {
func WithTracing(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.ClusterEphemeralReportInterface, client, kind string) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.ClusterEphemeralReportInterface {
return &withTracing{inner, client, kind}
}
type withLogging struct {
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.ClusterAdmissionReportInterface
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.ClusterEphemeralReportInterface
logger logr.Logger
}
func (c *withLogging) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_reports_v1.ClusterAdmissionReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_reports_v1.ClusterAdmissionReport, error) {
func (c *withLogging) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_reports_v1.ClusterEphemeralReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_reports_v1.ClusterEphemeralReport, error) {
start := time.Now()
logger := c.logger.WithValues("operation", "Create")
ret0, ret1 := c.inner.Create(arg0, arg1, arg2)
@ -67,7 +67,7 @@ func (c *withLogging) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimach
}
return ret0
}
func (c *withLogging) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_reports_v1.ClusterAdmissionReport, error) {
func (c *withLogging) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_reports_v1.ClusterEphemeralReport, error) {
start := time.Now()
logger := c.logger.WithValues("operation", "Get")
ret0, ret1 := c.inner.Get(arg0, arg1, arg2)
@ -78,7 +78,7 @@ func (c *withLogging) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimach
}
return ret0, ret1
}
func (c *withLogging) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_reports_v1.ClusterAdmissionReportList, error) {
func (c *withLogging) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_reports_v1.ClusterEphemeralReportList, error) {
start := time.Now()
logger := c.logger.WithValues("operation", "List")
ret0, ret1 := c.inner.List(arg0, arg1)
@ -89,7 +89,7 @@ func (c *withLogging) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_ap
}
return ret0, ret1
}
func (c *withLogging) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_reports_v1.ClusterAdmissionReport, error) {
func (c *withLogging) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_reports_v1.ClusterEphemeralReport, error) {
start := time.Now()
logger := c.logger.WithValues("operation", "Patch")
ret0, ret1 := c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...)
@ -100,7 +100,7 @@ func (c *withLogging) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apima
}
return ret0, ret1
}
func (c *withLogging) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_reports_v1.ClusterAdmissionReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_reports_v1.ClusterAdmissionReport, error) {
func (c *withLogging) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_reports_v1.ClusterEphemeralReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_reports_v1.ClusterEphemeralReport, error) {
start := time.Now()
logger := c.logger.WithValues("operation", "Update")
ret0, ret1 := c.inner.Update(arg0, arg1, arg2)
@ -124,11 +124,11 @@ func (c *withLogging) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_a
}
type withMetrics struct {
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.ClusterAdmissionReportInterface
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.ClusterEphemeralReportInterface
recorder metrics.Recorder
}
func (c *withMetrics) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_reports_v1.ClusterAdmissionReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_reports_v1.ClusterAdmissionReport, error) {
func (c *withMetrics) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_reports_v1.ClusterEphemeralReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_reports_v1.ClusterEphemeralReport, error) {
defer c.recorder.RecordWithContext(arg0, "create")
return c.inner.Create(arg0, arg1, arg2)
}
@ -140,19 +140,19 @@ func (c *withMetrics) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimach
defer c.recorder.RecordWithContext(arg0, "delete_collection")
return c.inner.DeleteCollection(arg0, arg1, arg2)
}
func (c *withMetrics) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_reports_v1.ClusterAdmissionReport, error) {
func (c *withMetrics) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_reports_v1.ClusterEphemeralReport, error) {
defer c.recorder.RecordWithContext(arg0, "get")
return c.inner.Get(arg0, arg1, arg2)
}
func (c *withMetrics) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_reports_v1.ClusterAdmissionReportList, error) {
func (c *withMetrics) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_reports_v1.ClusterEphemeralReportList, error) {
defer c.recorder.RecordWithContext(arg0, "list")
return c.inner.List(arg0, arg1)
}
func (c *withMetrics) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_reports_v1.ClusterAdmissionReport, error) {
func (c *withMetrics) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_reports_v1.ClusterEphemeralReport, error) {
defer c.recorder.RecordWithContext(arg0, "patch")
return c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...)
}
func (c *withMetrics) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_reports_v1.ClusterAdmissionReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_reports_v1.ClusterAdmissionReport, error) {
func (c *withMetrics) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_reports_v1.ClusterEphemeralReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_reports_v1.ClusterEphemeralReport, error) {
defer c.recorder.RecordWithContext(arg0, "update")
return c.inner.Update(arg0, arg1, arg2)
}
@ -162,12 +162,12 @@ func (c *withMetrics) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_a
}
type withTracing struct {
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.ClusterAdmissionReportInterface
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.ClusterEphemeralReportInterface
client string
kind string
}
func (c *withTracing) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_reports_v1.ClusterAdmissionReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_reports_v1.ClusterAdmissionReport, error) {
func (c *withTracing) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_reports_v1.ClusterEphemeralReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_reports_v1.ClusterEphemeralReport, error) {
var span trace.Span
if tracing.IsInSpan(arg0) {
arg0, span = tracing.StartChildSpan(
@ -230,7 +230,7 @@ func (c *withTracing) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimach
}
return ret0
}
func (c *withTracing) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_reports_v1.ClusterAdmissionReport, error) {
func (c *withTracing) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_reports_v1.ClusterEphemeralReport, error) {
var span trace.Span
if tracing.IsInSpan(arg0) {
arg0, span = tracing.StartChildSpan(
@ -251,7 +251,7 @@ func (c *withTracing) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimach
}
return ret0, ret1
}
func (c *withTracing) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_reports_v1.ClusterAdmissionReportList, error) {
func (c *withTracing) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_reports_v1.ClusterEphemeralReportList, error) {
var span trace.Span
if tracing.IsInSpan(arg0) {
arg0, span = tracing.StartChildSpan(
@ -272,7 +272,7 @@ func (c *withTracing) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_ap
}
return ret0, ret1
}
func (c *withTracing) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_reports_v1.ClusterAdmissionReport, error) {
func (c *withTracing) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_reports_v1.ClusterEphemeralReport, error) {
var span trace.Span
if tracing.IsInSpan(arg0) {
arg0, span = tracing.StartChildSpan(
@ -293,7 +293,7 @@ func (c *withTracing) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apima
}
return ret0, ret1
}
func (c *withTracing) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_reports_v1.ClusterAdmissionReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_reports_v1.ClusterAdmissionReport, error) {
func (c *withTracing) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_reports_v1.ClusterEphemeralReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_reports_v1.ClusterEphemeralReport, error) {
var span trace.Span
if tracing.IsInSpan(arg0) {
arg0, span = tracing.StartChildSpan(

View file

@ -17,24 +17,24 @@ import (
k8s_io_apimachinery_pkg_watch "k8s.io/apimachinery/pkg/watch"
)
func WithLogging(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.AdmissionReportInterface, logger logr.Logger) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.AdmissionReportInterface {
func WithLogging(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.EphemeralReportInterface, logger logr.Logger) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.EphemeralReportInterface {
return &withLogging{inner, logger}
}
func WithMetrics(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.AdmissionReportInterface, recorder metrics.Recorder) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.AdmissionReportInterface {
func WithMetrics(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.EphemeralReportInterface, recorder metrics.Recorder) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.EphemeralReportInterface {
return &withMetrics{inner, recorder}
}
func WithTracing(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.AdmissionReportInterface, client, kind string) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.AdmissionReportInterface {
func WithTracing(inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.EphemeralReportInterface, client, kind string) github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.EphemeralReportInterface {
return &withTracing{inner, client, kind}
}
type withLogging struct {
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.AdmissionReportInterface
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.EphemeralReportInterface
logger logr.Logger
}
func (c *withLogging) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_reports_v1.AdmissionReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_reports_v1.AdmissionReport, error) {
func (c *withLogging) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_reports_v1.EphemeralReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_reports_v1.EphemeralReport, error) {
start := time.Now()
logger := c.logger.WithValues("operation", "Create")
ret0, ret1 := c.inner.Create(arg0, arg1, arg2)
@ -67,7 +67,7 @@ func (c *withLogging) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimach
}
return ret0
}
func (c *withLogging) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_reports_v1.AdmissionReport, error) {
func (c *withLogging) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_reports_v1.EphemeralReport, error) {
start := time.Now()
logger := c.logger.WithValues("operation", "Get")
ret0, ret1 := c.inner.Get(arg0, arg1, arg2)
@ -78,7 +78,7 @@ func (c *withLogging) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimach
}
return ret0, ret1
}
func (c *withLogging) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_reports_v1.AdmissionReportList, error) {
func (c *withLogging) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_reports_v1.EphemeralReportList, error) {
start := time.Now()
logger := c.logger.WithValues("operation", "List")
ret0, ret1 := c.inner.List(arg0, arg1)
@ -89,7 +89,7 @@ func (c *withLogging) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_ap
}
return ret0, ret1
}
func (c *withLogging) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_reports_v1.AdmissionReport, error) {
func (c *withLogging) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_reports_v1.EphemeralReport, error) {
start := time.Now()
logger := c.logger.WithValues("operation", "Patch")
ret0, ret1 := c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...)
@ -100,7 +100,7 @@ func (c *withLogging) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apima
}
return ret0, ret1
}
func (c *withLogging) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_reports_v1.AdmissionReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_reports_v1.AdmissionReport, error) {
func (c *withLogging) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_reports_v1.EphemeralReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_reports_v1.EphemeralReport, error) {
start := time.Now()
logger := c.logger.WithValues("operation", "Update")
ret0, ret1 := c.inner.Update(arg0, arg1, arg2)
@ -124,11 +124,11 @@ func (c *withLogging) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_a
}
type withMetrics struct {
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.AdmissionReportInterface
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.EphemeralReportInterface
recorder metrics.Recorder
}
func (c *withMetrics) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_reports_v1.AdmissionReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_reports_v1.AdmissionReport, error) {
func (c *withMetrics) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_reports_v1.EphemeralReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_reports_v1.EphemeralReport, error) {
defer c.recorder.RecordWithContext(arg0, "create")
return c.inner.Create(arg0, arg1, arg2)
}
@ -140,19 +140,19 @@ func (c *withMetrics) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimach
defer c.recorder.RecordWithContext(arg0, "delete_collection")
return c.inner.DeleteCollection(arg0, arg1, arg2)
}
func (c *withMetrics) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_reports_v1.AdmissionReport, error) {
func (c *withMetrics) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_reports_v1.EphemeralReport, error) {
defer c.recorder.RecordWithContext(arg0, "get")
return c.inner.Get(arg0, arg1, arg2)
}
func (c *withMetrics) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_reports_v1.AdmissionReportList, error) {
func (c *withMetrics) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_reports_v1.EphemeralReportList, error) {
defer c.recorder.RecordWithContext(arg0, "list")
return c.inner.List(arg0, arg1)
}
func (c *withMetrics) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_reports_v1.AdmissionReport, error) {
func (c *withMetrics) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_reports_v1.EphemeralReport, error) {
defer c.recorder.RecordWithContext(arg0, "patch")
return c.inner.Patch(arg0, arg1, arg2, arg3, arg4, arg5...)
}
func (c *withMetrics) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_reports_v1.AdmissionReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_reports_v1.AdmissionReport, error) {
func (c *withMetrics) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_reports_v1.EphemeralReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_reports_v1.EphemeralReport, error) {
defer c.recorder.RecordWithContext(arg0, "update")
return c.inner.Update(arg0, arg1, arg2)
}
@ -162,12 +162,12 @@ func (c *withMetrics) Watch(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_a
}
type withTracing struct {
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.AdmissionReportInterface
inner github_com_kyverno_kyverno_pkg_client_clientset_versioned_typed_reports_v1.EphemeralReportInterface
client string
kind string
}
func (c *withTracing) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_reports_v1.AdmissionReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_reports_v1.AdmissionReport, error) {
func (c *withTracing) Create(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_reports_v1.EphemeralReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.CreateOptions) (*github_com_kyverno_kyverno_api_reports_v1.EphemeralReport, error) {
var span trace.Span
if tracing.IsInSpan(arg0) {
arg0, span = tracing.StartChildSpan(
@ -230,7 +230,7 @@ func (c *withTracing) DeleteCollection(arg0 context.Context, arg1 k8s_io_apimach
}
return ret0
}
func (c *withTracing) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_reports_v1.AdmissionReport, error) {
func (c *withTracing) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.GetOptions) (*github_com_kyverno_kyverno_api_reports_v1.EphemeralReport, error) {
var span trace.Span
if tracing.IsInSpan(arg0) {
arg0, span = tracing.StartChildSpan(
@ -251,7 +251,7 @@ func (c *withTracing) Get(arg0 context.Context, arg1 string, arg2 k8s_io_apimach
}
return ret0, ret1
}
func (c *withTracing) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_reports_v1.AdmissionReportList, error) {
func (c *withTracing) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_apis_meta_v1.ListOptions) (*github_com_kyverno_kyverno_api_reports_v1.EphemeralReportList, error) {
var span trace.Span
if tracing.IsInSpan(arg0) {
arg0, span = tracing.StartChildSpan(
@ -272,7 +272,7 @@ func (c *withTracing) List(arg0 context.Context, arg1 k8s_io_apimachinery_pkg_ap
}
return ret0, ret1
}
func (c *withTracing) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_reports_v1.AdmissionReport, error) {
func (c *withTracing) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apimachinery_pkg_types.PatchType, arg3 []uint8, arg4 k8s_io_apimachinery_pkg_apis_meta_v1.PatchOptions, arg5 ...string) (*github_com_kyverno_kyverno_api_reports_v1.EphemeralReport, error) {
var span trace.Span
if tracing.IsInSpan(arg0) {
arg0, span = tracing.StartChildSpan(
@ -293,7 +293,7 @@ func (c *withTracing) Patch(arg0 context.Context, arg1 string, arg2 k8s_io_apima
}
return ret0, ret1
}
func (c *withTracing) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_reports_v1.AdmissionReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_reports_v1.AdmissionReport, error) {
func (c *withTracing) Update(arg0 context.Context, arg1 *github_com_kyverno_kyverno_api_reports_v1.EphemeralReport, arg2 k8s_io_apimachinery_pkg_apis_meta_v1.UpdateOptions) (*github_com_kyverno_kyverno_api_reports_v1.EphemeralReport, error) {
var span trace.Span
if tracing.IsInSpan(arg0) {
arg0, span = tracing.StartChildSpan(

View file

@ -27,13 +27,9 @@ func deepCopyV1Alpha2(report kyvernov1alpha2.ReportInterface) kyvernov1alpha2.Re
func deepCopyReportV1(report kyvernov1alpha2.ReportInterface) kyvernov1alpha2.ReportInterface {
switch v := report.(type) {
case *reportsv1.AdmissionReport:
case *reportsv1.EphemeralReport:
return v.DeepCopy()
case *reportsv1.ClusterAdmissionReport:
return v.DeepCopy()
case *reportsv1.BackgroundScanReport:
return v.DeepCopy()
case *reportsv1.ClusterBackgroundScanReport:
case *reportsv1.ClusterEphemeralReport:
return v.DeepCopy()
case *policyreportv1alpha2.PolicyReport:
return v.DeepCopy()

View file

@ -38,17 +38,11 @@ func createV1Alpha1Report(ctx context.Context, report kyvernov1alpha2.ReportInte
func createReportV1Report(ctx context.Context, report kyvernov1alpha2.ReportInterface, client versioned.Interface) (kyvernov1alpha2.ReportInterface, error) {
switch v := report.(type) {
case *reportsv1.AdmissionReport:
report, err := client.ReportsV1().AdmissionReports(report.GetNamespace()).Create(ctx, v, metav1.CreateOptions{})
case *reportsv1.EphemeralReport:
report, err := client.ReportsV1().EphemeralReports(report.GetNamespace()).Create(ctx, v, metav1.CreateOptions{})
return report, err
case *reportsv1.ClusterAdmissionReport:
report, err := client.ReportsV1().ClusterAdmissionReports().Create(ctx, v, metav1.CreateOptions{})
return report, err
case *reportsv1.BackgroundScanReport:
report, err := client.ReportsV1().BackgroundScanReports(report.GetNamespace()).Create(ctx, v, metav1.CreateOptions{})
return report, err
case *reportsv1.ClusterBackgroundScanReport:
report, err := client.ReportsV1().ClusterBackgroundScanReports().Create(ctx, v, metav1.CreateOptions{})
case *reportsv1.ClusterEphemeralReport:
report, err := client.ReportsV1().ClusterEphemeralReports().Create(ctx, v, metav1.CreateOptions{})
return report, err
case *policyreportv1alpha2.PolicyReport:
report, err := client.Wgpolicyk8sV1alpha2().PolicyReports(report.GetNamespace()).Create(ctx, v, metav1.CreateOptions{})

View file

@ -32,14 +32,10 @@ func deleteV1Alpha1Reports(ctx context.Context, report kyvernov1alpha2.ReportInt
func deleteReportV1Reports(ctx context.Context, report kyvernov1alpha2.ReportInterface, client versioned.Interface) error {
switch v := report.(type) {
case *reportsv1.AdmissionReport:
return client.ReportsV1().AdmissionReports(report.GetNamespace()).Delete(ctx, v.GetName(), metav1.DeleteOptions{})
case *reportsv1.ClusterAdmissionReport:
return client.ReportsV1().ClusterAdmissionReports().Delete(ctx, v.GetName(), metav1.DeleteOptions{})
case *reportsv1.BackgroundScanReport:
return client.ReportsV1().BackgroundScanReports(report.GetNamespace()).Delete(ctx, v.GetName(), metav1.DeleteOptions{})
case *reportsv1.ClusterBackgroundScanReport:
return client.ReportsV1().ClusterBackgroundScanReports().Delete(ctx, v.GetName(), metav1.DeleteOptions{})
case *reportsv1.EphemeralReport:
return client.ReportsV1().EphemeralReports(report.GetNamespace()).Delete(ctx, v.GetName(), metav1.DeleteOptions{})
case *reportsv1.ClusterEphemeralReport:
return client.ReportsV1().ClusterEphemeralReports().Delete(ctx, v.GetName(), metav1.DeleteOptions{})
case *policyreportv1alpha2.PolicyReport:
return client.Wgpolicyk8sV1alpha2().PolicyReports(report.GetNamespace()).Delete(ctx, v.GetName(), metav1.DeleteOptions{})
case *policyreportv1alpha2.ClusterPolicyReport:

View file

@ -38,9 +38,9 @@ func buildAdmissionReportV1Alpha1(resource unstructured.Unstructured, request ad
func newAdmissionReportReportV1(namespace, name string, gvr schema.GroupVersionResource, resource unstructured.Unstructured) kyvernov1alpha2.ReportInterface {
var report kyvernov1alpha2.ReportInterface
if namespace == "" {
report = &reportsv1.ClusterAdmissionReport{Spec: reportsv1.AdmissionReportSpec{}}
report = &reportsv1.ClusterEphemeralReport{Spec: reportsv1.EphemeralReportSpec{}}
} else {
report = &reportsv1.AdmissionReport{Spec: reportsv1.AdmissionReportSpec{}}
report = &reportsv1.EphemeralReport{Spec: reportsv1.EphemeralReportSpec{}}
}
report.SetName(name)
report.SetNamespace(namespace)
@ -75,9 +75,9 @@ func newBackgroundScanReportV1Alpha1(namespace, name string, gvk schema.GroupVer
func newBackgroundScanReportReportsV1(namespace, name string, gvk schema.GroupVersionKind, owner string, uid types.UID) kyvernov1alpha2.ReportInterface {
var report kyvernov1alpha2.ReportInterface
if namespace == "" {
report = &reportsv1.ClusterBackgroundScanReport{}
report = &reportsv1.ClusterEphemeralReport{}
} else {
report = &reportsv1.BackgroundScanReport{}
report = &reportsv1.EphemeralReport{}
}
report.SetName(name)
report.SetNamespace(namespace)

View file

@ -88,7 +88,7 @@ func (r *reportManager) DeleteReport(ctx context.Context, report kyvernov1alpha2
func (r *reportManager) GetAdmissionReports(ctx context.Context, name string, namespace string, opts metav1.GetOptions) (kyvernov1alpha2.ReportInterface, error) {
if r.storeInDB {
return r.client.ReportsV1().AdmissionReports(namespace).Get(ctx, name, opts)
return r.client.ReportsV1().EphemeralReports(namespace).Get(ctx, name, opts)
} else {
return r.client.KyvernoV1alpha2().AdmissionReports(namespace).Get(ctx, name, opts)
}
@ -96,7 +96,7 @@ func (r *reportManager) GetAdmissionReports(ctx context.Context, name string, na
func (r *reportManager) ListAdmissionReports(ctx context.Context, namespace string, opts metav1.ListOptions) (runtime.Object, error) {
if r.storeInDB {
return r.client.ReportsV1().AdmissionReports(namespace).List(ctx, opts)
return r.client.ReportsV1().EphemeralReports(namespace).List(ctx, opts)
} else {
return r.client.KyvernoV1alpha2().AdmissionReports(namespace).List(ctx, opts)
}
@ -104,7 +104,7 @@ func (r *reportManager) ListAdmissionReports(ctx context.Context, namespace stri
func (r *reportManager) DeleteAdmissionReports(ctx context.Context, name, namespace string, opts metav1.DeleteOptions) error {
if r.storeInDB {
return r.client.ReportsV1().AdmissionReports(namespace).Delete(ctx, name, opts)
return r.client.ReportsV1().EphemeralReports(namespace).Delete(ctx, name, opts)
} else {
return r.client.KyvernoV1alpha2().AdmissionReports(namespace).Delete(ctx, name, opts)
}
@ -112,7 +112,7 @@ func (r *reportManager) DeleteAdmissionReports(ctx context.Context, name, namesp
func (r *reportManager) GetBackgroundScanReports(ctx context.Context, name string, namespace string, opts metav1.GetOptions) (kyvernov1alpha2.ReportInterface, error) {
if r.storeInDB {
return r.client.ReportsV1().BackgroundScanReports(namespace).Get(ctx, name, opts)
return r.client.ReportsV1().EphemeralReports(namespace).Get(ctx, name, opts)
} else {
return r.client.KyvernoV1alpha2().BackgroundScanReports(namespace).Get(ctx, name, opts)
}
@ -120,7 +120,7 @@ func (r *reportManager) GetBackgroundScanReports(ctx context.Context, name strin
func (r *reportManager) ListBackgroundScanReports(ctx context.Context, namespace string, opts metav1.ListOptions) (runtime.Object, error) {
if r.storeInDB {
return r.client.ReportsV1().BackgroundScanReports(namespace).List(ctx, opts)
return r.client.ReportsV1().EphemeralReports(namespace).List(ctx, opts)
} else {
return r.client.KyvernoV1alpha2().BackgroundScanReports(namespace).List(ctx, opts)
}
@ -128,7 +128,7 @@ func (r *reportManager) ListBackgroundScanReports(ctx context.Context, namespace
func (r *reportManager) DeleteBackgroundScanReports(ctx context.Context, name, namespace string, opts metav1.DeleteOptions) error {
if r.storeInDB {
return r.client.ReportsV1().BackgroundScanReports(namespace).Delete(ctx, name, opts)
return r.client.ReportsV1().EphemeralReports(namespace).Delete(ctx, name, opts)
} else {
return r.client.KyvernoV1alpha2().BackgroundScanReports(namespace).Delete(ctx, name, opts)
}
@ -136,7 +136,7 @@ func (r *reportManager) DeleteBackgroundScanReports(ctx context.Context, name, n
func (r *reportManager) GetClusterAdmissionReports(ctx context.Context, name string, opts metav1.GetOptions) (kyvernov1alpha2.ReportInterface, error) {
if r.storeInDB {
return r.client.ReportsV1().ClusterAdmissionReports().Get(ctx, name, opts)
return r.client.ReportsV1().ClusterEphemeralReports().Get(ctx, name, opts)
} else {
return r.client.KyvernoV1alpha2().ClusterAdmissionReports().Get(ctx, name, opts)
}
@ -144,7 +144,7 @@ func (r *reportManager) GetClusterAdmissionReports(ctx context.Context, name str
func (r *reportManager) ListClusterAdmissionReports(ctx context.Context, opts metav1.ListOptions) (runtime.Object, error) {
if r.storeInDB {
return r.client.ReportsV1().ClusterAdmissionReports().List(ctx, opts)
return r.client.ReportsV1().ClusterEphemeralReports().List(ctx, opts)
} else {
return r.client.KyvernoV1alpha2().ClusterAdmissionReports().List(ctx, opts)
}
@ -152,7 +152,7 @@ func (r *reportManager) ListClusterAdmissionReports(ctx context.Context, opts me
func (r *reportManager) DeleteClusterAdmissionReports(ctx context.Context, name string, opts metav1.DeleteOptions) error {
if r.storeInDB {
return r.client.ReportsV1().ClusterAdmissionReports().Delete(ctx, name, opts)
return r.client.ReportsV1().ClusterEphemeralReports().Delete(ctx, name, opts)
} else {
return r.client.KyvernoV1alpha2().ClusterAdmissionReports().Delete(ctx, name, opts)
}
@ -160,7 +160,7 @@ func (r *reportManager) DeleteClusterAdmissionReports(ctx context.Context, name
func (r *reportManager) GetClusterBackgroundScanReports(ctx context.Context, name string, opts metav1.GetOptions) (kyvernov1alpha2.ReportInterface, error) {
if r.storeInDB {
return r.client.ReportsV1().ClusterBackgroundScanReports().Get(ctx, name, opts)
return r.client.ReportsV1().ClusterEphemeralReports().Get(ctx, name, opts)
} else {
return r.client.KyvernoV1alpha2().ClusterBackgroundScanReports().Get(ctx, name, opts)
}
@ -168,7 +168,7 @@ func (r *reportManager) GetClusterBackgroundScanReports(ctx context.Context, nam
func (r *reportManager) ListClusterBackgroundScanReports(ctx context.Context, opts metav1.ListOptions) (runtime.Object, error) {
if r.storeInDB {
return r.client.ReportsV1().ClusterBackgroundScanReports().List(ctx, opts)
return r.client.ReportsV1().ClusterEphemeralReports().List(ctx, opts)
} else {
return r.client.KyvernoV1alpha2().ClusterBackgroundScanReports().List(ctx, opts)
}
@ -176,7 +176,7 @@ func (r *reportManager) ListClusterBackgroundScanReports(ctx context.Context, op
func (r *reportManager) DeleteClusterBackgroundScanReports(ctx context.Context, name string, opts metav1.DeleteOptions) error {
if r.storeInDB {
return r.client.ReportsV1().ClusterBackgroundScanReports().Delete(ctx, name, opts)
return r.client.ReportsV1().ClusterEphemeralReports().Delete(ctx, name, opts)
} else {
return r.client.KyvernoV1alpha2().ClusterBackgroundScanReports().Delete(ctx, name, opts)
}

View file

@ -38,17 +38,11 @@ func updateV1Alpha1Report(ctx context.Context, report kyvernov1alpha2.ReportInte
func updateReportsV1Report(ctx context.Context, report kyvernov1alpha2.ReportInterface, client versioned.Interface) (kyvernov1alpha2.ReportInterface, error) {
switch v := report.(type) {
case *reportsv1.AdmissionReport:
report, err := client.ReportsV1().AdmissionReports(report.GetNamespace()).Update(ctx, v, metav1.UpdateOptions{})
case *reportsv1.EphemeralReport:
report, err := client.ReportsV1().EphemeralReports(report.GetNamespace()).Update(ctx, v, metav1.UpdateOptions{})
return report, err
case *reportsv1.ClusterAdmissionReport:
report, err := client.ReportsV1().ClusterAdmissionReports().Update(ctx, v, metav1.UpdateOptions{})
return report, err
case *reportsv1.BackgroundScanReport:
report, err := client.ReportsV1().BackgroundScanReports(report.GetNamespace()).Update(ctx, v, metav1.UpdateOptions{})
return report, err
case *reportsv1.ClusterBackgroundScanReport:
report, err := client.ReportsV1().ClusterBackgroundScanReports().Update(ctx, v, metav1.UpdateOptions{})
case *reportsv1.ClusterEphemeralReport:
report, err := client.ReportsV1().ClusterEphemeralReports().Update(ctx, v, metav1.UpdateOptions{})
return report, err
case *policyreportv1alpha2.PolicyReport:
report, err := client.Wgpolicyk8sV1alpha2().PolicyReports(report.GetNamespace()).Update(ctx, v, metav1.UpdateOptions{})