From 2fa5c70b98890a9504959ff30b0f7d0b7fae6ae0 Mon Sep 17 00:00:00 2001 From: Erik Godding Boye Date: Sat, 14 Dec 2024 11:34:36 +0100 Subject: [PATCH] Introduce conversion Signed-off-by: Erik Godding Boye --- .../crd-trust-manager.io_clusterbundles.yaml | 2 +- .../crds/trust-manager.io_clusterbundles.yaml | 2 +- make/02_mod.mk | 11 + pkg/api/{v1alpha1 => v1alpha2}/doc.go | 2 +- pkg/api/{v1alpha1 => v1alpha2}/register.go | 4 +- .../types_cluster_bundle.go | 2 +- .../zz_generated.deepcopy.go | 2 +- pkg/apis/trust/v1alpha1/doc.go | 2 +- .../trust/v1alpha1/zz_generated.conversion.go | 390 ++++++++++++++++++ 9 files changed, 409 insertions(+), 8 deletions(-) rename pkg/api/{v1alpha1 => v1alpha2}/doc.go (97%) rename pkg/api/{v1alpha1 => v1alpha2}/register.go (98%) rename pkg/api/{v1alpha1 => v1alpha2}/types_cluster_bundle.go (99%) rename pkg/api/{v1alpha1 => v1alpha2}/zz_generated.deepcopy.go (99%) create mode 100644 pkg/apis/trust/v1alpha1/zz_generated.conversion.go diff --git a/deploy/charts/trust-manager/templates/crd-trust-manager.io_clusterbundles.yaml b/deploy/charts/trust-manager/templates/crd-trust-manager.io_clusterbundles.yaml index 10a04220..1f61da6b 100644 --- a/deploy/charts/trust-manager/templates/crd-trust-manager.io_clusterbundles.yaml +++ b/deploy/charts/trust-manager/templates/crd-trust-manager.io_clusterbundles.yaml @@ -39,7 +39,7 @@ spec: jsonPath: .metadata.creationTimestamp name: Age type: date - name: v1alpha1 + name: v1alpha2 schema: openAPIV3Schema: properties: diff --git a/deploy/crds/trust-manager.io_clusterbundles.yaml b/deploy/crds/trust-manager.io_clusterbundles.yaml index 2bfef74a..cf365dbd 100644 --- a/deploy/crds/trust-manager.io_clusterbundles.yaml +++ b/deploy/crds/trust-manager.io_clusterbundles.yaml @@ -35,7 +35,7 @@ spec: jsonPath: .metadata.creationTimestamp name: Age type: date - name: v1alpha1 + name: v1alpha2 schema: openAPIV3Schema: properties: diff --git a/make/02_mod.mk b/make/02_mod.mk index 816d1c88..0a0ca615 100644 --- a/make/02_mod.mk +++ b/make/02_mod.mk @@ -59,3 +59,14 @@ release-debian-trust-package: @echo "RELEASE_OCI_PACKAGE_DEBIAN_TAG=$(oci_package_debian_image_tag)" >> "$(GITHUB_OUTPUT)" @echo "Release complete!" + +.PHONY: generate-conversion +## Generate code for converting between Bundle and ClusterBundle API +## @category Generate/ Verify +generate-conversion: | $(NEEDS_CONVERSION-GEN) + rm -rf ./pkg/apis/trust/v1alpha1/zz_generated.conversion.go + + $(CONVERSION-GEN) \ + --go-header-file=$(go_header_file) \ + --output-file=zz_generated.conversion.go \ + ./pkg/apis/trust/v1alpha1 diff --git a/pkg/api/v1alpha1/doc.go b/pkg/api/v1alpha2/doc.go similarity index 97% rename from pkg/api/v1alpha1/doc.go rename to pkg/api/v1alpha2/doc.go index 5cae1d25..9f45675d 100644 --- a/pkg/api/v1alpha1/doc.go +++ b/pkg/api/v1alpha2/doc.go @@ -16,4 +16,4 @@ limitations under the License. // +kubebuilder:object:generate=true // +groupName=trust-manager.io -package v1alpha1 +package v1alpha2 diff --git a/pkg/api/v1alpha1/register.go b/pkg/api/v1alpha2/register.go similarity index 98% rename from pkg/api/v1alpha1/register.go rename to pkg/api/v1alpha2/register.go index 1d5af00c..39055785 100644 --- a/pkg/api/v1alpha1/register.go +++ b/pkg/api/v1alpha2/register.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha1 +package v1alpha2 import ( "fmt" @@ -28,7 +28,7 @@ import ( ) // SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: api.GroupName, Version: "v1alpha1"} +var SchemeGroupVersion = schema.GroupVersion{Group: api.GroupName, Version: "v1alpha2"} // Resource takes an unqualified resource and returns a Group qualified GroupResource func Resource(resource string) schema.GroupResource { diff --git a/pkg/api/v1alpha1/types_cluster_bundle.go b/pkg/api/v1alpha2/types_cluster_bundle.go similarity index 99% rename from pkg/api/v1alpha1/types_cluster_bundle.go rename to pkg/api/v1alpha2/types_cluster_bundle.go index 49d619a1..1ca1815f 100644 --- a/pkg/api/v1alpha1/types_cluster_bundle.go +++ b/pkg/api/v1alpha2/types_cluster_bundle.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha1 +package v1alpha2 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/api/v1alpha1/zz_generated.deepcopy.go b/pkg/api/v1alpha2/zz_generated.deepcopy.go similarity index 99% rename from pkg/api/v1alpha1/zz_generated.deepcopy.go rename to pkg/api/v1alpha2/zz_generated.deepcopy.go index 37f9083c..cf2e049b 100644 --- a/pkg/api/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/api/v1alpha2/zz_generated.deepcopy.go @@ -18,7 +18,7 @@ limitations under the License. // Code generated by controller-gen. DO NOT EDIT. -package v1alpha1 +package v1alpha2 import ( "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/apis/trust/v1alpha1/doc.go b/pkg/apis/trust/v1alpha1/doc.go index 4da2a5b4..34168d90 100644 --- a/pkg/apis/trust/v1alpha1/doc.go +++ b/pkg/apis/trust/v1alpha1/doc.go @@ -16,5 +16,5 @@ limitations under the License. // +kubebuilder:object:generate=true // +groupName=trust.cert-manager.io -// +k8s:conversion-gen=github.com/cert-manager/trust-manager/pkg/api/v1alpha1 +// +k8s:conversion-gen=github.com/cert-manager/trust-manager/pkg/api/v1alpha2 package v1alpha1 diff --git a/pkg/apis/trust/v1alpha1/zz_generated.conversion.go b/pkg/apis/trust/v1alpha1/zz_generated.conversion.go new file mode 100644 index 00000000..18448b3c --- /dev/null +++ b/pkg/apis/trust/v1alpha1/zz_generated.conversion.go @@ -0,0 +1,390 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The cert-manager 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 conversion-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + unsafe "unsafe" + + v1alpha2 "github.com/cert-manager/trust-manager/pkg/api/v1alpha2" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + conversion "k8s.io/apimachinery/pkg/conversion" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +func init() { + localSchemeBuilder.Register(RegisterConversions) +} + +// RegisterConversions adds conversion functions to the given scheme. +// Public to allow building arbitrary schemes. +func RegisterConversions(s *runtime.Scheme) error { + if err := s.AddGeneratedConversionFunc((*AdditionalFormats)(nil), (*v1alpha2.AdditionalFormats)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_AdditionalFormats_To_v1alpha2_AdditionalFormats(a.(*AdditionalFormats), b.(*v1alpha2.AdditionalFormats), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha2.AdditionalFormats)(nil), (*AdditionalFormats)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_AdditionalFormats_To_v1alpha1_AdditionalFormats(a.(*v1alpha2.AdditionalFormats), b.(*AdditionalFormats), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*BundleCondition)(nil), (*v1alpha2.BundleCondition)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_BundleCondition_To_v1alpha2_BundleCondition(a.(*BundleCondition), b.(*v1alpha2.BundleCondition), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha2.BundleCondition)(nil), (*BundleCondition)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_BundleCondition_To_v1alpha1_BundleCondition(a.(*v1alpha2.BundleCondition), b.(*BundleCondition), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*BundleSource)(nil), (*v1alpha2.BundleSource)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_BundleSource_To_v1alpha2_BundleSource(a.(*BundleSource), b.(*v1alpha2.BundleSource), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha2.BundleSource)(nil), (*BundleSource)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_BundleSource_To_v1alpha1_BundleSource(a.(*v1alpha2.BundleSource), b.(*BundleSource), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*BundleSpec)(nil), (*v1alpha2.BundleSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_BundleSpec_To_v1alpha2_BundleSpec(a.(*BundleSpec), b.(*v1alpha2.BundleSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha2.BundleSpec)(nil), (*BundleSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_BundleSpec_To_v1alpha1_BundleSpec(a.(*v1alpha2.BundleSpec), b.(*BundleSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*BundleStatus)(nil), (*v1alpha2.BundleStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_BundleStatus_To_v1alpha2_BundleStatus(a.(*BundleStatus), b.(*v1alpha2.BundleStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha2.BundleStatus)(nil), (*BundleStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_BundleStatus_To_v1alpha1_BundleStatus(a.(*v1alpha2.BundleStatus), b.(*BundleStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*BundleTarget)(nil), (*v1alpha2.BundleTarget)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_BundleTarget_To_v1alpha2_BundleTarget(a.(*BundleTarget), b.(*v1alpha2.BundleTarget), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha2.BundleTarget)(nil), (*BundleTarget)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_BundleTarget_To_v1alpha1_BundleTarget(a.(*v1alpha2.BundleTarget), b.(*BundleTarget), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*JKS)(nil), (*v1alpha2.JKS)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_JKS_To_v1alpha2_JKS(a.(*JKS), b.(*v1alpha2.JKS), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha2.JKS)(nil), (*JKS)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_JKS_To_v1alpha1_JKS(a.(*v1alpha2.JKS), b.(*JKS), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*KeySelector)(nil), (*v1alpha2.KeySelector)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_KeySelector_To_v1alpha2_KeySelector(a.(*KeySelector), b.(*v1alpha2.KeySelector), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha2.KeySelector)(nil), (*KeySelector)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_KeySelector_To_v1alpha1_KeySelector(a.(*v1alpha2.KeySelector), b.(*KeySelector), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*PKCS12)(nil), (*v1alpha2.PKCS12)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_PKCS12_To_v1alpha2_PKCS12(a.(*PKCS12), b.(*v1alpha2.PKCS12), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha2.PKCS12)(nil), (*PKCS12)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_PKCS12_To_v1alpha1_PKCS12(a.(*v1alpha2.PKCS12), b.(*PKCS12), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*SourceObjectKeySelector)(nil), (*v1alpha2.SourceObjectKeySelector)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_SourceObjectKeySelector_To_v1alpha2_SourceObjectKeySelector(a.(*SourceObjectKeySelector), b.(*v1alpha2.SourceObjectKeySelector), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha2.SourceObjectKeySelector)(nil), (*SourceObjectKeySelector)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_SourceObjectKeySelector_To_v1alpha1_SourceObjectKeySelector(a.(*v1alpha2.SourceObjectKeySelector), b.(*SourceObjectKeySelector), scope) + }); err != nil { + return err + } + return nil +} + +func autoConvert_v1alpha1_AdditionalFormats_To_v1alpha2_AdditionalFormats(in *AdditionalFormats, out *v1alpha2.AdditionalFormats, s conversion.Scope) error { + out.JKS = (*v1alpha2.JKS)(unsafe.Pointer(in.JKS)) + out.PKCS12 = (*v1alpha2.PKCS12)(unsafe.Pointer(in.PKCS12)) + return nil +} + +// Convert_v1alpha1_AdditionalFormats_To_v1alpha2_AdditionalFormats is an autogenerated conversion function. +func Convert_v1alpha1_AdditionalFormats_To_v1alpha2_AdditionalFormats(in *AdditionalFormats, out *v1alpha2.AdditionalFormats, s conversion.Scope) error { + return autoConvert_v1alpha1_AdditionalFormats_To_v1alpha2_AdditionalFormats(in, out, s) +} + +func autoConvert_v1alpha2_AdditionalFormats_To_v1alpha1_AdditionalFormats(in *v1alpha2.AdditionalFormats, out *AdditionalFormats, s conversion.Scope) error { + out.JKS = (*JKS)(unsafe.Pointer(in.JKS)) + out.PKCS12 = (*PKCS12)(unsafe.Pointer(in.PKCS12)) + return nil +} + +// Convert_v1alpha2_AdditionalFormats_To_v1alpha1_AdditionalFormats is an autogenerated conversion function. +func Convert_v1alpha2_AdditionalFormats_To_v1alpha1_AdditionalFormats(in *v1alpha2.AdditionalFormats, out *AdditionalFormats, s conversion.Scope) error { + return autoConvert_v1alpha2_AdditionalFormats_To_v1alpha1_AdditionalFormats(in, out, s) +} + +func autoConvert_v1alpha1_BundleCondition_To_v1alpha2_BundleCondition(in *BundleCondition, out *v1alpha2.BundleCondition, s conversion.Scope) error { + out.Type = in.Type + out.Status = v1.ConditionStatus(in.Status) + out.LastTransitionTime = in.LastTransitionTime + out.Reason = in.Reason + out.Message = in.Message + out.ObservedGeneration = in.ObservedGeneration + return nil +} + +// Convert_v1alpha1_BundleCondition_To_v1alpha2_BundleCondition is an autogenerated conversion function. +func Convert_v1alpha1_BundleCondition_To_v1alpha2_BundleCondition(in *BundleCondition, out *v1alpha2.BundleCondition, s conversion.Scope) error { + return autoConvert_v1alpha1_BundleCondition_To_v1alpha2_BundleCondition(in, out, s) +} + +func autoConvert_v1alpha2_BundleCondition_To_v1alpha1_BundleCondition(in *v1alpha2.BundleCondition, out *BundleCondition, s conversion.Scope) error { + out.Type = in.Type + out.Status = v1.ConditionStatus(in.Status) + out.LastTransitionTime = in.LastTransitionTime + out.Reason = in.Reason + out.Message = in.Message + out.ObservedGeneration = in.ObservedGeneration + return nil +} + +// Convert_v1alpha2_BundleCondition_To_v1alpha1_BundleCondition is an autogenerated conversion function. +func Convert_v1alpha2_BundleCondition_To_v1alpha1_BundleCondition(in *v1alpha2.BundleCondition, out *BundleCondition, s conversion.Scope) error { + return autoConvert_v1alpha2_BundleCondition_To_v1alpha1_BundleCondition(in, out, s) +} + +func autoConvert_v1alpha1_BundleSource_To_v1alpha2_BundleSource(in *BundleSource, out *v1alpha2.BundleSource, s conversion.Scope) error { + out.ConfigMap = (*v1alpha2.SourceObjectKeySelector)(unsafe.Pointer(in.ConfigMap)) + out.Secret = (*v1alpha2.SourceObjectKeySelector)(unsafe.Pointer(in.Secret)) + out.InLine = (*string)(unsafe.Pointer(in.InLine)) + out.UseDefaultCAs = (*bool)(unsafe.Pointer(in.UseDefaultCAs)) + return nil +} + +// Convert_v1alpha1_BundleSource_To_v1alpha2_BundleSource is an autogenerated conversion function. +func Convert_v1alpha1_BundleSource_To_v1alpha2_BundleSource(in *BundleSource, out *v1alpha2.BundleSource, s conversion.Scope) error { + return autoConvert_v1alpha1_BundleSource_To_v1alpha2_BundleSource(in, out, s) +} + +func autoConvert_v1alpha2_BundleSource_To_v1alpha1_BundleSource(in *v1alpha2.BundleSource, out *BundleSource, s conversion.Scope) error { + out.ConfigMap = (*SourceObjectKeySelector)(unsafe.Pointer(in.ConfigMap)) + out.Secret = (*SourceObjectKeySelector)(unsafe.Pointer(in.Secret)) + out.InLine = (*string)(unsafe.Pointer(in.InLine)) + out.UseDefaultCAs = (*bool)(unsafe.Pointer(in.UseDefaultCAs)) + return nil +} + +// Convert_v1alpha2_BundleSource_To_v1alpha1_BundleSource is an autogenerated conversion function. +func Convert_v1alpha2_BundleSource_To_v1alpha1_BundleSource(in *v1alpha2.BundleSource, out *BundleSource, s conversion.Scope) error { + return autoConvert_v1alpha2_BundleSource_To_v1alpha1_BundleSource(in, out, s) +} + +func autoConvert_v1alpha1_BundleSpec_To_v1alpha2_BundleSpec(in *BundleSpec, out *v1alpha2.BundleSpec, s conversion.Scope) error { + out.Sources = *(*[]v1alpha2.BundleSource)(unsafe.Pointer(&in.Sources)) + if err := Convert_v1alpha1_BundleTarget_To_v1alpha2_BundleTarget(&in.Target, &out.Target, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha1_BundleSpec_To_v1alpha2_BundleSpec is an autogenerated conversion function. +func Convert_v1alpha1_BundleSpec_To_v1alpha2_BundleSpec(in *BundleSpec, out *v1alpha2.BundleSpec, s conversion.Scope) error { + return autoConvert_v1alpha1_BundleSpec_To_v1alpha2_BundleSpec(in, out, s) +} + +func autoConvert_v1alpha2_BundleSpec_To_v1alpha1_BundleSpec(in *v1alpha2.BundleSpec, out *BundleSpec, s conversion.Scope) error { + out.Sources = *(*[]BundleSource)(unsafe.Pointer(&in.Sources)) + if err := Convert_v1alpha2_BundleTarget_To_v1alpha1_BundleTarget(&in.Target, &out.Target, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha2_BundleSpec_To_v1alpha1_BundleSpec is an autogenerated conversion function. +func Convert_v1alpha2_BundleSpec_To_v1alpha1_BundleSpec(in *v1alpha2.BundleSpec, out *BundleSpec, s conversion.Scope) error { + return autoConvert_v1alpha2_BundleSpec_To_v1alpha1_BundleSpec(in, out, s) +} + +func autoConvert_v1alpha1_BundleStatus_To_v1alpha2_BundleStatus(in *BundleStatus, out *v1alpha2.BundleStatus, s conversion.Scope) error { + out.Conditions = *(*[]v1alpha2.BundleCondition)(unsafe.Pointer(&in.Conditions)) + out.DefaultCAPackageVersion = (*string)(unsafe.Pointer(in.DefaultCAPackageVersion)) + return nil +} + +// Convert_v1alpha1_BundleStatus_To_v1alpha2_BundleStatus is an autogenerated conversion function. +func Convert_v1alpha1_BundleStatus_To_v1alpha2_BundleStatus(in *BundleStatus, out *v1alpha2.BundleStatus, s conversion.Scope) error { + return autoConvert_v1alpha1_BundleStatus_To_v1alpha2_BundleStatus(in, out, s) +} + +func autoConvert_v1alpha2_BundleStatus_To_v1alpha1_BundleStatus(in *v1alpha2.BundleStatus, out *BundleStatus, s conversion.Scope) error { + out.Conditions = *(*[]BundleCondition)(unsafe.Pointer(&in.Conditions)) + out.DefaultCAPackageVersion = (*string)(unsafe.Pointer(in.DefaultCAPackageVersion)) + return nil +} + +// Convert_v1alpha2_BundleStatus_To_v1alpha1_BundleStatus is an autogenerated conversion function. +func Convert_v1alpha2_BundleStatus_To_v1alpha1_BundleStatus(in *v1alpha2.BundleStatus, out *BundleStatus, s conversion.Scope) error { + return autoConvert_v1alpha2_BundleStatus_To_v1alpha1_BundleStatus(in, out, s) +} + +func autoConvert_v1alpha1_BundleTarget_To_v1alpha2_BundleTarget(in *BundleTarget, out *v1alpha2.BundleTarget, s conversion.Scope) error { + out.ConfigMap = (*v1alpha2.KeySelector)(unsafe.Pointer(in.ConfigMap)) + out.Secret = (*v1alpha2.KeySelector)(unsafe.Pointer(in.Secret)) + out.AdditionalFormats = (*v1alpha2.AdditionalFormats)(unsafe.Pointer(in.AdditionalFormats)) + out.NamespaceSelector = (*v1.LabelSelector)(unsafe.Pointer(in.NamespaceSelector)) + return nil +} + +// Convert_v1alpha1_BundleTarget_To_v1alpha2_BundleTarget is an autogenerated conversion function. +func Convert_v1alpha1_BundleTarget_To_v1alpha2_BundleTarget(in *BundleTarget, out *v1alpha2.BundleTarget, s conversion.Scope) error { + return autoConvert_v1alpha1_BundleTarget_To_v1alpha2_BundleTarget(in, out, s) +} + +func autoConvert_v1alpha2_BundleTarget_To_v1alpha1_BundleTarget(in *v1alpha2.BundleTarget, out *BundleTarget, s conversion.Scope) error { + out.ConfigMap = (*KeySelector)(unsafe.Pointer(in.ConfigMap)) + out.Secret = (*KeySelector)(unsafe.Pointer(in.Secret)) + out.AdditionalFormats = (*AdditionalFormats)(unsafe.Pointer(in.AdditionalFormats)) + out.NamespaceSelector = (*v1.LabelSelector)(unsafe.Pointer(in.NamespaceSelector)) + return nil +} + +// Convert_v1alpha2_BundleTarget_To_v1alpha1_BundleTarget is an autogenerated conversion function. +func Convert_v1alpha2_BundleTarget_To_v1alpha1_BundleTarget(in *v1alpha2.BundleTarget, out *BundleTarget, s conversion.Scope) error { + return autoConvert_v1alpha2_BundleTarget_To_v1alpha1_BundleTarget(in, out, s) +} + +func autoConvert_v1alpha1_JKS_To_v1alpha2_JKS(in *JKS, out *v1alpha2.JKS, s conversion.Scope) error { + if err := Convert_v1alpha1_KeySelector_To_v1alpha2_KeySelector(&in.KeySelector, &out.KeySelector, s); err != nil { + return err + } + out.Password = (*string)(unsafe.Pointer(in.Password)) + return nil +} + +// Convert_v1alpha1_JKS_To_v1alpha2_JKS is an autogenerated conversion function. +func Convert_v1alpha1_JKS_To_v1alpha2_JKS(in *JKS, out *v1alpha2.JKS, s conversion.Scope) error { + return autoConvert_v1alpha1_JKS_To_v1alpha2_JKS(in, out, s) +} + +func autoConvert_v1alpha2_JKS_To_v1alpha1_JKS(in *v1alpha2.JKS, out *JKS, s conversion.Scope) error { + if err := Convert_v1alpha2_KeySelector_To_v1alpha1_KeySelector(&in.KeySelector, &out.KeySelector, s); err != nil { + return err + } + out.Password = (*string)(unsafe.Pointer(in.Password)) + return nil +} + +// Convert_v1alpha2_JKS_To_v1alpha1_JKS is an autogenerated conversion function. +func Convert_v1alpha2_JKS_To_v1alpha1_JKS(in *v1alpha2.JKS, out *JKS, s conversion.Scope) error { + return autoConvert_v1alpha2_JKS_To_v1alpha1_JKS(in, out, s) +} + +func autoConvert_v1alpha1_KeySelector_To_v1alpha2_KeySelector(in *KeySelector, out *v1alpha2.KeySelector, s conversion.Scope) error { + out.Key = in.Key + return nil +} + +// Convert_v1alpha1_KeySelector_To_v1alpha2_KeySelector is an autogenerated conversion function. +func Convert_v1alpha1_KeySelector_To_v1alpha2_KeySelector(in *KeySelector, out *v1alpha2.KeySelector, s conversion.Scope) error { + return autoConvert_v1alpha1_KeySelector_To_v1alpha2_KeySelector(in, out, s) +} + +func autoConvert_v1alpha2_KeySelector_To_v1alpha1_KeySelector(in *v1alpha2.KeySelector, out *KeySelector, s conversion.Scope) error { + out.Key = in.Key + return nil +} + +// Convert_v1alpha2_KeySelector_To_v1alpha1_KeySelector is an autogenerated conversion function. +func Convert_v1alpha2_KeySelector_To_v1alpha1_KeySelector(in *v1alpha2.KeySelector, out *KeySelector, s conversion.Scope) error { + return autoConvert_v1alpha2_KeySelector_To_v1alpha1_KeySelector(in, out, s) +} + +func autoConvert_v1alpha1_PKCS12_To_v1alpha2_PKCS12(in *PKCS12, out *v1alpha2.PKCS12, s conversion.Scope) error { + if err := Convert_v1alpha1_KeySelector_To_v1alpha2_KeySelector(&in.KeySelector, &out.KeySelector, s); err != nil { + return err + } + out.Password = (*string)(unsafe.Pointer(in.Password)) + return nil +} + +// Convert_v1alpha1_PKCS12_To_v1alpha2_PKCS12 is an autogenerated conversion function. +func Convert_v1alpha1_PKCS12_To_v1alpha2_PKCS12(in *PKCS12, out *v1alpha2.PKCS12, s conversion.Scope) error { + return autoConvert_v1alpha1_PKCS12_To_v1alpha2_PKCS12(in, out, s) +} + +func autoConvert_v1alpha2_PKCS12_To_v1alpha1_PKCS12(in *v1alpha2.PKCS12, out *PKCS12, s conversion.Scope) error { + if err := Convert_v1alpha2_KeySelector_To_v1alpha1_KeySelector(&in.KeySelector, &out.KeySelector, s); err != nil { + return err + } + out.Password = (*string)(unsafe.Pointer(in.Password)) + return nil +} + +// Convert_v1alpha2_PKCS12_To_v1alpha1_PKCS12 is an autogenerated conversion function. +func Convert_v1alpha2_PKCS12_To_v1alpha1_PKCS12(in *v1alpha2.PKCS12, out *PKCS12, s conversion.Scope) error { + return autoConvert_v1alpha2_PKCS12_To_v1alpha1_PKCS12(in, out, s) +} + +func autoConvert_v1alpha1_SourceObjectKeySelector_To_v1alpha2_SourceObjectKeySelector(in *SourceObjectKeySelector, out *v1alpha2.SourceObjectKeySelector, s conversion.Scope) error { + out.Name = in.Name + out.Selector = (*v1.LabelSelector)(unsafe.Pointer(in.Selector)) + out.Key = in.Key + out.IncludeAllKeys = in.IncludeAllKeys + return nil +} + +// Convert_v1alpha1_SourceObjectKeySelector_To_v1alpha2_SourceObjectKeySelector is an autogenerated conversion function. +func Convert_v1alpha1_SourceObjectKeySelector_To_v1alpha2_SourceObjectKeySelector(in *SourceObjectKeySelector, out *v1alpha2.SourceObjectKeySelector, s conversion.Scope) error { + return autoConvert_v1alpha1_SourceObjectKeySelector_To_v1alpha2_SourceObjectKeySelector(in, out, s) +} + +func autoConvert_v1alpha2_SourceObjectKeySelector_To_v1alpha1_SourceObjectKeySelector(in *v1alpha2.SourceObjectKeySelector, out *SourceObjectKeySelector, s conversion.Scope) error { + out.Name = in.Name + out.Selector = (*v1.LabelSelector)(unsafe.Pointer(in.Selector)) + out.Key = in.Key + out.IncludeAllKeys = in.IncludeAllKeys + return nil +} + +// Convert_v1alpha2_SourceObjectKeySelector_To_v1alpha1_SourceObjectKeySelector is an autogenerated conversion function. +func Convert_v1alpha2_SourceObjectKeySelector_To_v1alpha1_SourceObjectKeySelector(in *v1alpha2.SourceObjectKeySelector, out *SourceObjectKeySelector, s conversion.Scope) error { + return autoConvert_v1alpha2_SourceObjectKeySelector_To_v1alpha1_SourceObjectKeySelector(in, out, s) +}