From d95dd030c1b65e045b7ca17804acd8de7584ce8d Mon Sep 17 00:00:00 2001 From: Tom Wieczorek Date: Tue, 4 Jun 2024 16:00:24 +0200 Subject: [PATCH] WIP Enable deepcopy-gen Signed-off-by: Tom Wieczorek --- Makefile | 17 +++--- pkg/apis/autopilot/v1beta2/doc.go | 1 + pkg/apis/autopilot/v1beta2/types.go | 4 ++ pkg/apis/autopilot/v1beta2/updateconfig.go | 2 + .../v1beta2/zz_generated.deepcopy.go | 36 ++++++++++++- pkg/apis/etcd/v1beta1/doc.go | 1 + pkg/apis/etcd/v1beta1/types.go | 2 + .../etcd/v1beta1/zz_generated.deepcopy.go | 8 ++- pkg/apis/helm/v1beta1/chart_types.go | 2 +- pkg/apis/helm/v1beta1/doc.go | 1 + .../helm/v1beta1/zz_generated.deepcopy.go | 7 ++- pkg/apis/k0s/v1beta1/clusterconfig_types.go | 5 +- pkg/apis/k0s/v1beta1/doc.go | 1 + pkg/apis/k0s/v1beta1/zz_generated.deepcopy.go | 53 ++++++++++++++++++- 14 files changed, 122 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index ec54ea3bb1b6..2e5d0977d185 100644 --- a/Makefile +++ b/Makefile @@ -116,26 +116,23 @@ go.sum: go.mod .k0sbuild.docker-image.k0s api_group_versions := $(foreach path,$(wildcard pkg/apis/*/v*/doc.go),$(path:pkg/apis/%/doc.go=%)) # Declare the requisites for the generators operating on API group versions. -k8s_code_generators := register defaulter +k8s_code_generators := deepcopy register defaulter api_group_version_targets := .controller-gen.stamp $(foreach gen,$(k8s_code_generators),zz_generated.$(gen).go) $(foreach gv,$(api_group_versions),$(eval $(foreach t,$(api_group_version_targets),pkg/apis/$(gv)/$(t)): $$(shell find pkg/apis/$(gv)/ -maxdepth 1 -type f -name '*.go' -not -name '*_test.go' -not -name 'zz_generated*'))) -# Run controller-gen for each API group version. -controller_gen_targets := $(foreach gv,$(api_group_versions),pkg/apis/$(gv)/.controller-gen.stamp) -codegen_targets := $(controller_gen_targets) -$(controller_gen_targets): .k0sbuild.docker-image.k0s hack/tools/boilerplate.go.txt hack/tools/Makefile.variables +# Run controller-gen to generate CRDs for each API group version. +crd_targets := $(foreach gv,$(api_group_versions),pkg/apis/$(gv)/.controller-gen.stamp) +$(crd_targets): .k0sbuild.docker-image.k0s hack/tools/Makefile.variables rm -rf 'static/manifests/$(dir $(@:pkg/apis/%/.controller-gen.stamp=%))CustomResourceDefinition' mkdir -p 'static/manifests/$(dir $(@:pkg/apis/%/.controller-gen.stamp=%))' gendir="$$(mktemp -d .controller-gen.XXXXXX.tmp)" \ && trap "rm -rf -- $$gendir" INT EXIT \ && CGO_ENABLED=0 $(GO) run sigs.k8s.io/controller-tools/cmd/controller-gen@v$(controller-gen_version) \ paths="./$(dir $@)..." \ - object:headerFile=hack/tools/boilerplate.go.txt output:object:dir="$$gendir" \ - crd output:crd:dir='static/manifests/$(dir $(@:pkg/apis/%/.controller-gen.stamp=%))CustomResourceDefinition' \ - && mv -f -- "$$gendir"/zz_generated.deepcopy.go '$(dir $@).' + crd output:crd:dir='static/manifests/$(dir $(@:pkg/apis/%/.controller-gen.stamp=%))CustomResourceDefinition' touch -- '$@' -# Run Kubernetes code generators for each API group versions. +# Run Kubernetes code generators for each API group version. k8s_code_generator_targets := $(foreach gv,$(api_group_versions),$(foreach gen,$(k8s_code_generators),pkg/apis/$(gv)/zz_generated.$(gen).go)) codegen_targets += $(k8s_code_generator_targets) $(k8s_code_generator_targets): .k0sbuild.docker-image.k0s hack/tools/boilerplate.go.txt embedded-bins/Makefile.variables @@ -168,7 +165,7 @@ pkg/client/clientset/.client-gen.stamp: .k0sbuild.docker-image.k0s hack/tools/bo touch -- '$@' codegen_targets += static/zz_generated_assets.go -static/zz_generated_assets.go: $(controller_gen_targets) # to generate the CRDs into static/manifests/*/CustomResourceDefinition +static/zz_generated_assets.go: $(crd_targets) # to generate the CRDs into static/manifests/*/CustomResourceDefinition static/zz_generated_assets.go: $(shell find static/manifests/calico static/manifests/windows static/misc -type f) static/zz_generated_assets.go: .k0sbuild.docker-image.k0s hack/tools/Makefile.variables CGO_ENABLED=0 $(GO) run github.com/kevinburke/go-bindata/go-bindata@v$(go-bindata_version) \ diff --git a/pkg/apis/autopilot/v1beta2/doc.go b/pkg/apis/autopilot/v1beta2/doc.go index cd73f491a6d0..ae0ae97c7af0 100644 --- a/pkg/apis/autopilot/v1beta2/doc.go +++ b/pkg/apis/autopilot/v1beta2/doc.go @@ -13,6 +13,7 @@ // limitations under the License. // +k8s:defaulter-gen=TypeMeta +// +k8s:deepcopy-gen=package // +groupName=autopilot.k0sproject.io // +kubebuilder:object:generate=true diff --git a/pkg/apis/autopilot/v1beta2/types.go b/pkg/apis/autopilot/v1beta2/types.go index d6693c9b7509..67986d05cae4 100644 --- a/pkg/apis/autopilot/v1beta2/types.go +++ b/pkg/apis/autopilot/v1beta2/types.go @@ -25,6 +25,7 @@ import ( // +kubebuilder:object:root=true // +kubebuilder:resource:scope=Cluster // +kubebuilder:subresource:status +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +genclient // +genclient:onlyVerbs=create,delete,list,get,watch,update,updateStatus // +genclient:nonNamespaced @@ -53,6 +54,7 @@ func (c *ControlNodeStatus) GetInternalIP() string { // // +kubebuilder:object:root=true // +kubebuilder:resource:scope=Cluster +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type ControlNodeList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` @@ -68,6 +70,7 @@ type ControlNodeList struct { // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.state" // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +genclient // +genclient:onlyVerbs=create,delete,list,get,watch,update // +genclient:nonNamespaced @@ -87,6 +90,7 @@ type Plan struct { // // +kubebuilder:object:root=true // +kubebuilder:resource:scope=Cluster +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type PlanList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` diff --git a/pkg/apis/autopilot/v1beta2/updateconfig.go b/pkg/apis/autopilot/v1beta2/updateconfig.go index b08d3a34ad6e..43dfbf96dd89 100644 --- a/pkg/apis/autopilot/v1beta2/updateconfig.go +++ b/pkg/apis/autopilot/v1beta2/updateconfig.go @@ -32,6 +32,7 @@ const ( // +kubebuilder:object:root=true // +kubebuilder:resource:scope=Cluster +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +genclient // +genclient:onlyVerbs=create,delete,list,get,watch,update // +genclient:nonNamespaced @@ -151,6 +152,7 @@ func startTimeForCurrentDay(startTime time.Time) time.Time { // +kubebuilder:object:root=true // +kubebuilder:resource:scope=Cluster +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type UpdateConfigList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` diff --git a/pkg/apis/autopilot/v1beta2/zz_generated.deepcopy.go b/pkg/apis/autopilot/v1beta2/zz_generated.deepcopy.go index bfc6b6642f86..010bbba107f9 100644 --- a/pkg/apis/autopilot/v1beta2/zz_generated.deepcopy.go +++ b/pkg/apis/autopilot/v1beta2/zz_generated.deepcopy.go @@ -1,4 +1,5 @@ //go:build !ignore_autogenerated +// +build !ignore_autogenerated /* Copyright k0s authors @@ -16,12 +17,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by controller-gen. DO NOT EDIT. +// Code generated by deepcopy-gen. DO NOT EDIT. package v1beta2 import ( - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -38,6 +39,7 @@ func (in *AutopilotPlanCommand) DeepCopyInto(out *AutopilotPlanCommand) { *out = new(AutopilotPlanCommandAirgapUpdate) (*in).DeepCopyInto(*out) } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutopilotPlanCommand. @@ -54,6 +56,7 @@ func (in *AutopilotPlanCommand) DeepCopy() *AutopilotPlanCommand { func (in *AutopilotPlanCommandAirgapUpdate) DeepCopyInto(out *AutopilotPlanCommandAirgapUpdate) { *out = *in in.Workers.DeepCopyInto(&out.Workers) + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutopilotPlanCommandAirgapUpdate. @@ -70,6 +73,7 @@ func (in *AutopilotPlanCommandAirgapUpdate) DeepCopy() *AutopilotPlanCommandAirg func (in *AutopilotPlanCommandK0sUpdate) DeepCopyInto(out *AutopilotPlanCommandK0sUpdate) { *out = *in in.Targets.DeepCopyInto(&out.Targets) + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutopilotPlanCommandK0sUpdate. @@ -92,6 +96,7 @@ func (in *AutopilotPlanSpec) DeepCopyInto(out *AutopilotPlanSpec) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutopilotPlanSpec. @@ -110,6 +115,7 @@ func (in *ControlNode) DeepCopyInto(out *ControlNode) { in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) out.TypeMeta = in.TypeMeta in.Status.DeepCopyInto(&out.Status) + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlNode. @@ -142,6 +148,7 @@ func (in *ControlNodeList) DeepCopyInto(out *ControlNodeList) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlNodeList. @@ -170,6 +177,7 @@ func (in *ControlNodeStatus) DeepCopyInto(out *ControlNodeStatus) { *out = make([]v1.NodeAddress, len(*in)) copy(*out, *in) } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlNodeStatus. @@ -190,6 +198,7 @@ func (in *PeriodicUpgradeStrategy) DeepCopyInto(out *PeriodicUpgradeStrategy) { *out = make([]string, len(*in)) copy(*out, *in) } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PeriodicUpgradeStrategy. @@ -209,6 +218,7 @@ func (in *Plan) DeepCopyInto(out *Plan) { 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 Plan. @@ -242,6 +252,7 @@ func (in *PlanCommand) DeepCopyInto(out *PlanCommand) { *out = new(PlanCommandAirgapUpdate) (*in).DeepCopyInto(*out) } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlanCommand. @@ -265,6 +276,7 @@ func (in *PlanCommandAirgapUpdate) DeepCopyInto(out *PlanCommandAirgapUpdate) { } } in.Workers.DeepCopyInto(&out.Workers) + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlanCommandAirgapUpdate. @@ -287,6 +299,7 @@ func (in *PlanCommandAirgapUpdateStatus) DeepCopyInto(out *PlanCommandAirgapUpda (*in)[i].DeepCopyInto(&(*out)[i]) } } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlanCommandAirgapUpdateStatus. @@ -310,6 +323,7 @@ func (in *PlanCommandK0sUpdate) DeepCopyInto(out *PlanCommandK0sUpdate) { } } in.Targets.DeepCopyInto(&out.Targets) + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlanCommandK0sUpdate. @@ -339,6 +353,7 @@ func (in *PlanCommandK0sUpdateStatus) DeepCopyInto(out *PlanCommandK0sUpdateStat (*in)[i].DeepCopyInto(&(*out)[i]) } } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlanCommandK0sUpdateStatus. @@ -364,6 +379,7 @@ func (in *PlanCommandStatus) DeepCopyInto(out *PlanCommandStatus) { *out = new(PlanCommandAirgapUpdateStatus) (*in).DeepCopyInto(*out) } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlanCommandStatus. @@ -381,6 +397,7 @@ func (in *PlanCommandTarget) DeepCopyInto(out *PlanCommandTarget) { *out = *in in.Discovery.DeepCopyInto(&out.Discovery) out.Limits = in.Limits + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlanCommandTarget. @@ -406,6 +423,7 @@ func (in *PlanCommandTargetDiscovery) DeepCopyInto(out *PlanCommandTargetDiscove *out = new(PlanCommandTargetDiscoverySelector) **out = **in } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlanCommandTargetDiscovery. @@ -421,6 +439,7 @@ func (in *PlanCommandTargetDiscovery) DeepCopy() *PlanCommandTargetDiscovery { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PlanCommandTargetDiscoverySelector) DeepCopyInto(out *PlanCommandTargetDiscoverySelector) { *out = *in + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlanCommandTargetDiscoverySelector. @@ -441,6 +460,7 @@ func (in *PlanCommandTargetDiscoveryStatic) DeepCopyInto(out *PlanCommandTargetD *out = make([]string, len(*in)) copy(*out, *in) } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlanCommandTargetDiscoveryStatic. @@ -456,6 +476,7 @@ func (in *PlanCommandTargetDiscoveryStatic) DeepCopy() *PlanCommandTargetDiscove // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PlanCommandTargetLimits) DeepCopyInto(out *PlanCommandTargetLimits) { *out = *in + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlanCommandTargetLimits. @@ -472,6 +493,7 @@ func (in *PlanCommandTargetLimits) DeepCopy() *PlanCommandTargetLimits { func (in *PlanCommandTargetStatus) DeepCopyInto(out *PlanCommandTargetStatus) { *out = *in in.LastUpdatedTimestamp.DeepCopyInto(&out.LastUpdatedTimestamp) + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlanCommandTargetStatus. @@ -489,6 +511,7 @@ func (in *PlanCommandTargets) DeepCopyInto(out *PlanCommandTargets) { *out = *in in.Controllers.DeepCopyInto(&out.Controllers) in.Workers.DeepCopyInto(&out.Workers) + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlanCommandTargets. @@ -513,6 +536,7 @@ func (in *PlanList) DeepCopyInto(out *PlanList) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlanList. @@ -541,6 +565,7 @@ func (in PlanPlatformResourceURLMap) DeepCopyInto(out *PlanPlatformResourceURLMa for key, val := range *in { (*out)[key] = val } + return } } @@ -557,6 +582,7 @@ func (in PlanPlatformResourceURLMap) DeepCopy() PlanPlatformResourceURLMap { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PlanResourceURL) DeepCopyInto(out *PlanResourceURL) { *out = *in + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlanResourceURL. @@ -579,6 +605,7 @@ func (in *PlanSpec) DeepCopyInto(out *PlanSpec) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlanSpec. @@ -601,6 +628,7 @@ func (in *PlanStatus) DeepCopyInto(out *PlanStatus) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlanStatus. @@ -619,6 +647,7 @@ func (in *UpdateConfig) DeepCopyInto(out *UpdateConfig) { in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) out.TypeMeta = in.TypeMeta in.Spec.DeepCopyInto(&out.Spec) + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpdateConfig. @@ -651,6 +680,7 @@ func (in *UpdateConfigList) DeepCopyInto(out *UpdateConfigList) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpdateConfigList. @@ -676,6 +706,7 @@ func (in *UpdateSpec) DeepCopyInto(out *UpdateSpec) { *out = *in in.UpgradeStrategy.DeepCopyInto(&out.UpgradeStrategy) in.PlanSpec.DeepCopyInto(&out.PlanSpec) + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpdateSpec. @@ -692,6 +723,7 @@ func (in *UpdateSpec) DeepCopy() *UpdateSpec { func (in *UpgradeStrategy) DeepCopyInto(out *UpgradeStrategy) { *out = *in in.Periodic.DeepCopyInto(&out.Periodic) + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpgradeStrategy. diff --git a/pkg/apis/etcd/v1beta1/doc.go b/pkg/apis/etcd/v1beta1/doc.go index f422789cc866..2ba8e463e79c 100644 --- a/pkg/apis/etcd/v1beta1/doc.go +++ b/pkg/apis/etcd/v1beta1/doc.go @@ -13,6 +13,7 @@ // limitations under the License. // +k8s:defaulter-gen=TypeMeta +// +k8s:deepcopy-gen=package // +groupName=etcd.k0sproject.io // +kubebuilder:object:generate=true diff --git a/pkg/apis/etcd/v1beta1/types.go b/pkg/apis/etcd/v1beta1/types.go index 76f9359f1f66..7e4992c9bd2a 100644 --- a/pkg/apis/etcd/v1beta1/types.go +++ b/pkg/apis/etcd/v1beta1/types.go @@ -31,6 +31,7 @@ import ( // +kubebuilder:printcolumn:name="Member ID",type=string,JSONPath=`.status.memberID` // +kubebuilder:printcolumn:name="Joined",type=string,JSONPath=`.status.conditions[?(@.type=="Joined")].status` // +kubebuilder:printcolumn:name="Reconcile Status",type=string,JSONPath=`.status.reconcileStatus` +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +genclient // +genclient:onlyVerbs=create,delete,list,get,watch,update,updateStatus,patch // +genclient:nonNamespaced @@ -145,6 +146,7 @@ func (s *Status) SetCondition(t ConditionType, status ConditionStatus, msg strin // // +kubebuilder:object:root=true // +kubebuilder:resource:scope=Cluster +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type EtcdMemberList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` diff --git a/pkg/apis/etcd/v1beta1/zz_generated.deepcopy.go b/pkg/apis/etcd/v1beta1/zz_generated.deepcopy.go index ed750a3de436..4477520508fb 100644 --- a/pkg/apis/etcd/v1beta1/zz_generated.deepcopy.go +++ b/pkg/apis/etcd/v1beta1/zz_generated.deepcopy.go @@ -1,4 +1,5 @@ //go:build !ignore_autogenerated +// +build !ignore_autogenerated /* Copyright k0s authors @@ -16,7 +17,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by controller-gen. DO NOT EDIT. +// Code generated by deepcopy-gen. DO NOT EDIT. package v1beta1 @@ -31,6 +32,7 @@ func (in *EtcdMember) DeepCopyInto(out *EtcdMember) { in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Status.DeepCopyInto(&out.Status) out.Spec = in.Spec + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EtcdMember. @@ -63,6 +65,7 @@ func (in *EtcdMemberList) DeepCopyInto(out *EtcdMemberList) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EtcdMemberList. @@ -86,6 +89,7 @@ func (in *EtcdMemberList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *EtcdMemberSpec) DeepCopyInto(out *EtcdMemberSpec) { *out = *in + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EtcdMemberSpec. @@ -102,6 +106,7 @@ func (in *EtcdMemberSpec) DeepCopy() *EtcdMemberSpec { func (in *JoinCondition) DeepCopyInto(out *JoinCondition) { *out = *in in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JoinCondition. @@ -124,6 +129,7 @@ func (in *Status) DeepCopyInto(out *Status) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Status. diff --git a/pkg/apis/helm/v1beta1/chart_types.go b/pkg/apis/helm/v1beta1/chart_types.go index 3c63f75f7290..44142a7e4f2d 100644 --- a/pkg/apis/helm/v1beta1/chart_types.go +++ b/pkg/apis/helm/v1beta1/chart_types.go @@ -68,8 +68,8 @@ type ChartStatus struct { } // +kubebuilder:object:root=true -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:subresource:status +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +genclient // +genclient:onlyVerbs=create,delete,list,get,watch,update // Chart is the Schema for the charts API diff --git a/pkg/apis/helm/v1beta1/doc.go b/pkg/apis/helm/v1beta1/doc.go index bd8b8cb432b9..71d0bdf8620f 100644 --- a/pkg/apis/helm/v1beta1/doc.go +++ b/pkg/apis/helm/v1beta1/doc.go @@ -15,6 +15,7 @@ limitations under the License. */ // +k8s:defaulter-gen=TypeMeta +// +k8s:deepcopy-gen=package // +groupName=helm.k0sproject.io // +kubebuilder:object:generate=true diff --git a/pkg/apis/helm/v1beta1/zz_generated.deepcopy.go b/pkg/apis/helm/v1beta1/zz_generated.deepcopy.go index 447f2669c4c1..49e2d89dbc9c 100644 --- a/pkg/apis/helm/v1beta1/zz_generated.deepcopy.go +++ b/pkg/apis/helm/v1beta1/zz_generated.deepcopy.go @@ -1,4 +1,5 @@ //go:build !ignore_autogenerated +// +build !ignore_autogenerated /* Copyright k0s authors @@ -16,7 +17,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by controller-gen. DO NOT EDIT. +// Code generated by deepcopy-gen. DO NOT EDIT. package v1beta1 @@ -31,6 +32,7 @@ func (in *Chart) DeepCopyInto(out *Chart) { in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) out.Spec = in.Spec out.Status = in.Status + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Chart. @@ -63,6 +65,7 @@ func (in *ChartList) DeepCopyInto(out *ChartList) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChartList. @@ -86,6 +89,7 @@ func (in *ChartList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ChartSpec) DeepCopyInto(out *ChartSpec) { *out = *in + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChartSpec. @@ -101,6 +105,7 @@ func (in *ChartSpec) DeepCopy() *ChartSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ChartStatus) DeepCopyInto(out *ChartStatus) { *out = *in + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChartStatus. diff --git a/pkg/apis/k0s/v1beta1/clusterconfig_types.go b/pkg/apis/k0s/v1beta1/clusterconfig_types.go index 579911480692..4b670b8b94a3 100644 --- a/pkg/apis/k0s/v1beta1/clusterconfig_types.go +++ b/pkg/apis/k0s/v1beta1/clusterconfig_types.go @@ -65,6 +65,7 @@ type ClusterConfigStatus struct { // +kubebuilder:subresource:status // +genclient // +genclient:onlyVerbs=create,delete,list,get,watch,update +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type ClusterConfig struct { metav1.ObjectMeta `json:"metadata,omitempty"` metav1.TypeMeta `json:",omitempty,inline"` @@ -144,8 +145,10 @@ var _ Validateable = (*SchedulerSpec)(nil) func (*SchedulerSpec) Validate() []error { return nil } -// +kubebuilder:object:root=true // ClusterConfigList contains a list of ClusterConfig +// +// +kubebuilder:object:root=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type ClusterConfigList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` diff --git a/pkg/apis/k0s/v1beta1/doc.go b/pkg/apis/k0s/v1beta1/doc.go index 4ad7fddbb8d2..55b0df8cded3 100644 --- a/pkg/apis/k0s/v1beta1/doc.go +++ b/pkg/apis/k0s/v1beta1/doc.go @@ -15,6 +15,7 @@ limitations under the License. */ // +k8s:defaulter-gen=TypeMeta +// +k8s:deepcopy-gen=package // +groupName=k0s.k0sproject.io // +kubebuilder:object:generate=true diff --git a/pkg/apis/k0s/v1beta1/zz_generated.deepcopy.go b/pkg/apis/k0s/v1beta1/zz_generated.deepcopy.go index df19e82d6a45..71bf4ed5190c 100644 --- a/pkg/apis/k0s/v1beta1/zz_generated.deepcopy.go +++ b/pkg/apis/k0s/v1beta1/zz_generated.deepcopy.go @@ -1,4 +1,5 @@ //go:build !ignore_autogenerated +// +build !ignore_autogenerated /* Copyright k0s authors @@ -16,12 +17,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by controller-gen. DO NOT EDIT. +// Code generated by deepcopy-gen. DO NOT EDIT. package v1beta1 import ( - "k8s.io/apimachinery/pkg/runtime" + runtime "k8s.io/apimachinery/pkg/runtime" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -39,6 +40,7 @@ func (in *APISpec) DeepCopyInto(out *APISpec) { *out = make([]string, len(*in)) copy(*out, *in) } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APISpec. @@ -74,6 +76,7 @@ func (in *CaResponse) DeepCopyInto(out *CaResponse) { *out = make([]byte, len(*in)) copy(*out, *in) } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CaResponse. @@ -96,6 +99,7 @@ func (in *Calico) DeepCopyInto(out *Calico) { (*out)[key] = val } } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Calico. @@ -114,6 +118,7 @@ func (in *CalicoImageSpec) DeepCopyInto(out *CalicoImageSpec) { out.CNI = in.CNI out.Node = in.Node out.KubeControllers = in.KubeControllers + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CalicoImageSpec. @@ -130,6 +135,7 @@ func (in *CalicoImageSpec) DeepCopy() *CalicoImageSpec { func (in *Chart) DeepCopyInto(out *Chart) { *out = *in out.Timeout = in.Timeout + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Chart. @@ -148,6 +154,7 @@ func (in ChartsSettings) DeepCopyInto(out *ChartsSettings) { in := &in *out = make(ChartsSettings, len(*in)) copy(*out, *in) + return } } @@ -176,6 +183,7 @@ func (in *ClusterConfig) DeepCopyInto(out *ClusterConfig) { *out = new(ClusterConfigStatus) **out = **in } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterConfig. @@ -208,6 +216,7 @@ func (in *ClusterConfigList) DeepCopyInto(out *ClusterConfigList) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterConfigList. @@ -231,6 +240,7 @@ func (in *ClusterConfigList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterConfigStatus) DeepCopyInto(out *ClusterConfigStatus) { *out = *in + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterConfigStatus. @@ -256,6 +266,7 @@ func (in *ClusterExtensions) DeepCopyInto(out *ClusterExtensions) { *out = new(HelmExtensions) (*in).DeepCopyInto(*out) } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterExtensions. @@ -279,6 +290,7 @@ func (in *ClusterImages) DeepCopyInto(out *ClusterImages) { out.Pause = in.Pause out.Calico = in.Calico out.KubeRouter = in.KubeRouter + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterImages. @@ -358,6 +370,7 @@ func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSpec. @@ -378,6 +391,7 @@ func (in *ClusterTelemetry) DeepCopyInto(out *ClusterTelemetry) { *out = new(bool) **out = **in } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterTelemetry. @@ -398,6 +412,7 @@ func (in *ControlPlaneLoadBalancingSpec) DeepCopyInto(out *ControlPlaneLoadBalan *out = new(KeepalivedSpec) (*in).DeepCopyInto(*out) } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneLoadBalancingSpec. @@ -420,6 +435,7 @@ func (in *ControllerManagerSpec) DeepCopyInto(out *ControllerManagerSpec) { (*out)[key] = val } } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControllerManagerSpec. @@ -435,6 +451,7 @@ func (in *ControllerManagerSpec) DeepCopy() *ControllerManagerSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DualStack) DeepCopyInto(out *DualStack) { *out = *in + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DualStack. @@ -460,6 +477,7 @@ func (in *EnvoyProxy) DeepCopyInto(out *EnvoyProxy) { *out = new(int32) **out = **in } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvoyProxy. @@ -487,6 +505,7 @@ func (in *EtcdConfig) DeepCopyInto(out *EtcdConfig) { (*out)[key] = val } } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EtcdConfig. @@ -502,6 +521,7 @@ func (in *EtcdConfig) DeepCopy() *EtcdConfig { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *EtcdRequest) DeepCopyInto(out *EtcdRequest) { *out = *in + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EtcdRequest. @@ -523,6 +543,7 @@ func (in *EtcdResponse) DeepCopyInto(out *EtcdResponse) { *out = make([]string, len(*in)) copy(*out, *in) } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EtcdResponse. @@ -543,6 +564,7 @@ func (in *ExternalCluster) DeepCopyInto(out *ExternalCluster) { *out = make([]string, len(*in)) copy(*out, *in) } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalCluster. @@ -563,6 +585,7 @@ func (in *FeatureGate) DeepCopyInto(out *FeatureGate) { *out = make([]string, len(*in)) copy(*out, *in) } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeatureGate. @@ -583,6 +606,7 @@ func (in FeatureGates) DeepCopyInto(out *FeatureGates) { for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } + return } } @@ -611,6 +635,7 @@ func (in *HelmExtensions) DeepCopyInto(out *HelmExtensions) { *out = make(ChartsSettings, len(*in)) copy(*out, *in) } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmExtensions. @@ -626,6 +651,7 @@ func (in *HelmExtensions) DeepCopy() *HelmExtensions { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ImageSpec) DeepCopyInto(out *ImageSpec) { *out = *in + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageSpec. @@ -646,6 +672,7 @@ func (in *InstallSpec) DeepCopyInto(out *InstallSpec) { *out = new(SystemUser) **out = **in } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstallSpec. @@ -673,6 +700,7 @@ func (in *KeepalivedSpec) DeepCopyInto(out *KeepalivedSpec) { *out = make(VirtualServers, len(*in)) copy(*out, *in) } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KeepalivedSpec. @@ -688,6 +716,7 @@ func (in *KeepalivedSpec) DeepCopy() *KeepalivedSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *KineConfig) DeepCopyInto(out *KineConfig) { *out = *in + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KineConfig. @@ -703,6 +732,7 @@ func (in *KineConfig) DeepCopy() *KineConfig { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *KonnectivitySpec) DeepCopyInto(out *KonnectivitySpec) { *out = *in + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KonnectivitySpec. @@ -725,6 +755,7 @@ func (in *KubeProxy) DeepCopyInto(out *KubeProxy) { *out = make([]string, len(*in)) copy(*out, *in) } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeProxy. @@ -752,6 +783,7 @@ func (in *KubeProxyIPTablesConfiguration) DeepCopyInto(out *KubeProxyIPTablesCon } out.SyncPeriod = in.SyncPeriod out.MinSyncPeriod = in.MinSyncPeriod + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeProxyIPTablesConfiguration. @@ -777,6 +809,7 @@ func (in *KubeProxyIPVSConfiguration) DeepCopyInto(out *KubeProxyIPVSConfigurati out.TCPTimeout = in.TCPTimeout out.TCPFinTimeout = in.TCPFinTimeout out.UDPTimeout = in.UDPTimeout + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeProxyIPVSConfiguration. @@ -804,6 +837,7 @@ func (in *KubeRouter) DeepCopyInto(out *KubeRouter) { (*out)[key] = val } } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeRouter. @@ -821,6 +855,7 @@ func (in *KubeRouterImageSpec) DeepCopyInto(out *KubeRouterImageSpec) { *out = *in out.CNI = in.CNI out.CNIInstaller = in.CNIInstaller + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeRouterImageSpec. @@ -862,6 +897,7 @@ func (in *Network) DeepCopyInto(out *Network) { *out = new(ControlPlaneLoadBalancingSpec) (*in).DeepCopyInto(*out) } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Network. @@ -882,6 +918,7 @@ func (in *NodeLocalLoadBalancing) DeepCopyInto(out *NodeLocalLoadBalancing) { *out = new(EnvoyProxy) (*in).DeepCopyInto(*out) } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeLocalLoadBalancing. @@ -902,6 +939,7 @@ func (in RepositoriesSettings) DeepCopyInto(out *RepositoriesSettings) { for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } + return } } @@ -923,6 +961,7 @@ func (in *Repository) DeepCopyInto(out *Repository) { *out = new(bool) **out = **in } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Repository. @@ -945,6 +984,7 @@ func (in *SchedulerSpec) DeepCopyInto(out *SchedulerSpec) { (*out)[key] = val } } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SchedulerSpec. @@ -960,6 +1000,7 @@ func (in *SchedulerSpec) DeepCopy() *SchedulerSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *StorageExtension) DeepCopyInto(out *StorageExtension) { *out = *in + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageExtension. @@ -985,6 +1026,7 @@ func (in *StorageSpec) DeepCopyInto(out *StorageSpec) { *out = new(KineConfig) **out = **in } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageSpec. @@ -1000,6 +1042,7 @@ func (in *StorageSpec) DeepCopy() *StorageSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SystemUser) DeepCopyInto(out *SystemUser) { *out = *in + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SystemUser. @@ -1020,6 +1063,7 @@ func (in *VRRPInstance) DeepCopyInto(out *VRRPInstance) { *out = make([]string, len(*in)) copy(*out, *in) } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VRRPInstance. @@ -1040,6 +1084,7 @@ func (in VRRPInstances) DeepCopyInto(out *VRRPInstances) { for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } + return } } @@ -1057,6 +1102,7 @@ func (in VRRPInstances) DeepCopy() VRRPInstances { func (in *VirtualServer) DeepCopyInto(out *VirtualServer) { *out = *in out.DelayLoop = in.DelayLoop + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualServer. @@ -1075,6 +1121,7 @@ func (in VirtualServers) DeepCopyInto(out *VirtualServers) { in := &in *out = make(VirtualServers, len(*in)) copy(*out, *in) + return } } @@ -1096,6 +1143,7 @@ func (in *WorkerProfile) DeepCopyInto(out *WorkerProfile) { *out = new(runtime.RawExtension) (*in).DeepCopyInto(*out) } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkerProfile. @@ -1116,6 +1164,7 @@ func (in WorkerProfiles) DeepCopyInto(out *WorkerProfiles) { for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } + return } }