diff --git a/Makefile b/Makefile index d2d9186ada..32b2fc2009 100644 --- a/Makefile +++ b/Makefile @@ -220,6 +220,10 @@ else CONTROLLER_GEN=$(shell which controller-gen) endif +# Bootstrap auto-generable code associated with deepcopy +deepcopy-autogen: controller-gen + $(CONTROLLER_GEN) object:headerFile="scripts/boilerplate.go.txt" paths="./..." + # Run go fmt against code fmt: gofmt -s -w . diff --git a/pkg/api/kyverno/v1/zz_generated.deepcopy.go b/pkg/api/kyverno/v1/zz_generated.deepcopy.go index 08aed56bcb..c0827c9d22 100755 --- a/pkg/api/kyverno/v1/zz_generated.deepcopy.go +++ b/pkg/api/kyverno/v1/zz_generated.deepcopy.go @@ -1,8 +1,6 @@ // +build !ignore_autogenerated /* -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 @@ -16,20 +14,34 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by deepcopy-gen. DO NOT EDIT. +// Code generated by controller-gen. DO NOT EDIT. package v1 import ( rbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *APICall) DeepCopyInto(out *APICall) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APICall. +func (in *APICall) DeepCopy() *APICall { + if in == nil { + return nil + } + out := new(APICall) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CloneFrom) DeepCopyInto(out *CloneFrom) { *out = *in - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloneFrom. @@ -49,7 +61,6 @@ func (in *ClusterPolicy) DeepCopyInto(out *ClusterPolicy) { in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) in.Status.DeepCopyInto(&out.Status) - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterPolicy. @@ -82,7 +93,6 @@ func (in *ClusterPolicyList) DeepCopyInto(out *ClusterPolicyList) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterPolicyList. @@ -116,7 +126,6 @@ func (in *Condition) DeepCopy() *Condition { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ConfigMapReference) DeepCopyInto(out *ConfigMapReference) { *out = *in - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigMapReference. @@ -137,7 +146,11 @@ func (in *ContextEntry) DeepCopyInto(out *ContextEntry) { *out = new(ConfigMapReference) **out = **in } - return + if in.APICall != nil { + in, out := &in.APICall, &out.APICall + *out = new(APICall) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContextEntry. @@ -160,7 +173,6 @@ func (in *Deny) DeepCopyInto(out *Deny) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Deny. @@ -178,7 +190,6 @@ func (in *ExcludeResources) DeepCopyInto(out *ExcludeResources) { *out = *in in.UserInfo.DeepCopyInto(&out.UserInfo) in.ResourceDescription.DeepCopyInto(&out.ResourceDescription) - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExcludeResources. @@ -198,7 +209,6 @@ func (in *GenerateRequest) DeepCopyInto(out *GenerateRequest) { in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) in.Status.DeepCopyInto(&out.Status) - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GenerateRequest. @@ -223,7 +233,6 @@ func (in *GenerateRequest) DeepCopyObject() runtime.Object { func (in *GenerateRequestContext) DeepCopyInto(out *GenerateRequestContext) { *out = *in in.UserRequestInfo.DeepCopyInto(&out.UserRequestInfo) - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GenerateRequestContext. @@ -248,7 +257,6 @@ func (in *GenerateRequestList) DeepCopyInto(out *GenerateRequestList) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GenerateRequestList. @@ -274,7 +282,6 @@ func (in *GenerateRequestSpec) DeepCopyInto(out *GenerateRequestSpec) { *out = *in out.Resource = in.Resource in.Context.DeepCopyInto(&out.Context) - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GenerateRequestSpec. @@ -295,7 +302,6 @@ func (in *GenerateRequestStatus) DeepCopyInto(out *GenerateRequestStatus) { *out = make([]ResourceSpec, len(*in)) copy(*out, *in) } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GenerateRequestStatus. @@ -323,7 +329,6 @@ func (in *MatchResources) DeepCopyInto(out *MatchResources) { *out = *in in.UserInfo.DeepCopyInto(&out.UserInfo) in.ResourceDescription.DeepCopyInto(&out.ResourceDescription) - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MatchResources. @@ -353,7 +358,6 @@ func (in *Policy) DeepCopyInto(out *Policy) { in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) in.Status.DeepCopyInto(&out.Status) - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Policy. @@ -386,7 +390,6 @@ func (in *PolicyList) DeepCopyInto(out *PolicyList) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyList. @@ -415,7 +418,6 @@ func (in *PolicyStatus) DeepCopyInto(out *PolicyStatus) { *out = make([]RuleStats, len(*in)) copy(*out, *in) } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyStatus. @@ -442,7 +444,6 @@ func (in *RequestInfo) DeepCopyInto(out *RequestInfo) { copy(*out, *in) } in.AdmissionUserInfo.DeepCopyInto(&out.AdmissionUserInfo) - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RequestInfo. @@ -480,7 +481,11 @@ func (in *ResourceDescription) DeepCopyInto(out *ResourceDescription) { *out = new(metav1.LabelSelector) (*in).DeepCopyInto(*out) } - return + if in.NamespaceSelector != nil { + in, out := &in.NamespaceSelector, &out.NamespaceSelector + *out = new(metav1.LabelSelector) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceDescription. @@ -496,7 +501,6 @@ func (in *ResourceDescription) DeepCopy() *ResourceDescription { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ResourceSpec) DeepCopyInto(out *ResourceSpec) { *out = *in - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceSpec. @@ -531,7 +535,6 @@ func (in *Rule) DeepCopyInto(out *Rule) { in.Mutation.DeepCopyInto(&out.Mutation) in.Validation.DeepCopyInto(&out.Validation) in.Generation.DeepCopyInto(&out.Generation) - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Rule. @@ -547,7 +550,6 @@ func (in *Rule) DeepCopy() *Rule { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RuleStats) DeepCopyInto(out *RuleStats) { *out = *in - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuleStats. @@ -575,7 +577,6 @@ func (in *Spec) DeepCopyInto(out *Spec) { *out = new(bool) **out = **in } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Spec. @@ -606,7 +607,6 @@ func (in *UserInfo) DeepCopyInto(out *UserInfo) { *out = make([]rbacv1.Subject, len(*in)) copy(*out, *in) } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserInfo. @@ -632,7 +632,6 @@ func (in *Validation) DeepCopy() *Validation { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ViolatedRule) DeepCopyInto(out *ViolatedRule) { *out = *in - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ViolatedRule. diff --git a/pkg/api/kyverno/v1alpha1/zz_generated.deepcopy.go b/pkg/api/kyverno/v1alpha1/zz_generated.deepcopy.go index c9ffcd64d3..2c8ecf0151 100644 --- a/pkg/api/kyverno/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/api/kyverno/v1alpha1/zz_generated.deepcopy.go @@ -1,8 +1,6 @@ // +build !ignore_autogenerated /* -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 @@ -16,13 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by deepcopy-gen. DO NOT EDIT. +// Code generated by controller-gen. DO NOT EDIT. package v1alpha1 import ( policyreportv1alpha1 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha1" - v1 "k8s.io/api/core/v1" + "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -54,7 +52,6 @@ func (in *ClusterReportChangeRequest) DeepCopyInto(out *ClusterReportChangeReque } } } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterReportChangeRequest. @@ -87,7 +84,6 @@ func (in *ClusterReportChangeRequestList) DeepCopyInto(out *ClusterReportChangeR (*in)[i].DeepCopyInto(&(*out)[i]) } } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterReportChangeRequestList. @@ -135,7 +131,6 @@ func (in *ReportChangeRequest) DeepCopyInto(out *ReportChangeRequest) { } } } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReportChangeRequest. @@ -168,7 +163,6 @@ func (in *ReportChangeRequestList) DeepCopyInto(out *ReportChangeRequestList) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReportChangeRequestList. diff --git a/pkg/api/policyreport/v1alpha1/zz_generated.deepcopy.go b/pkg/api/policyreport/v1alpha1/zz_generated.deepcopy.go index 683557bf02..23fd43d65b 100644 --- a/pkg/api/policyreport/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/api/policyreport/v1alpha1/zz_generated.deepcopy.go @@ -1,8 +1,6 @@ // +build !ignore_autogenerated /* -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 @@ -16,12 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by deepcopy-gen. DO NOT EDIT. +// Code generated by controller-gen. DO NOT EDIT. package v1alpha1 import ( - v1 "k8s.io/api/core/v1" + "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -53,7 +51,6 @@ func (in *ClusterPolicyReport) DeepCopyInto(out *ClusterPolicyReport) { } } } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterPolicyReport. @@ -86,7 +83,6 @@ func (in *ClusterPolicyReportList) DeepCopyInto(out *ClusterPolicyReportList) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterPolicyReportList. @@ -134,7 +130,6 @@ func (in *PolicyReport) DeepCopyInto(out *PolicyReport) { } } } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyReport. @@ -167,7 +162,6 @@ func (in *PolicyReportList) DeepCopyInto(out *PolicyReportList) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyReportList. @@ -214,7 +208,6 @@ func (in *PolicyReportResult) DeepCopyInto(out *PolicyReportResult) { (*out)[key] = val } } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyReportResult. @@ -230,7 +223,6 @@ func (in *PolicyReportResult) DeepCopy() *PolicyReportResult { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PolicyReportSummary) DeepCopyInto(out *PolicyReportSummary) { *out = *in - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyReportSummary. diff --git a/scripts/boilerplate.go.txt b/scripts/boilerplate.go.txt new file mode 100644 index 0000000000..e2fe4d13b1 --- /dev/null +++ b/scripts/boilerplate.go.txt @@ -0,0 +1,13 @@ +/* +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. +*/ \ No newline at end of file