Add explicit conversion functions for types referenced across packages

Signed-off-by: James Munnelly <jmunnelly@apple.com>
This commit is contained in:
James Munnelly
2021-10-21 15:43:50 +01:00
parent b3159537e1
commit f3b22eae99
8 changed files with 159 additions and 0 deletions
+1
View File
@@ -3,6 +3,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = [
"conversion.go",
"defaults.go",
"doc.go",
"register.go",
+36
View File
@@ -0,0 +1,36 @@
/*
Copyright 2021 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.
*/
package v1
import (
"k8s.io/apimachinery/pkg/conversion"
"github.com/jetstack/cert-manager/internal/apis/acme"
v1 "github.com/jetstack/cert-manager/pkg/apis/acme/v1"
)
// Convert_acme_ACMEIssuer_To_v1_ACMEIssuer is explicitly defined to avoid issues in conversion-gen
// when referencing types in other API groups.
func Convert_acme_ACMEIssuer_To_v1_ACMEIssuer(in *acme.ACMEIssuer, out *v1.ACMEIssuer, s conversion.Scope) error {
return autoConvert_acme_ACMEIssuer_To_v1_ACMEIssuer(in, out, s)
}
// Convert_v1_ACMEIssuer_To_acme_ACMEIssuer is explicitly defined to avoid issues in conversion-gen
// when referencing types in other API groups.
func Convert_v1_ACMEIssuer_To_acme_ACMEIssuer(in *v1.ACMEIssuer, out *acme.ACMEIssuer, s conversion.Scope) error {
return autoConvert_v1_ACMEIssuer_To_acme_ACMEIssuer(in, out, s)
}
+12
View File
@@ -82,3 +82,15 @@ func Convert_acme_OrderSpec_To_v1alpha2_OrderSpec(in *acme.OrderSpec, out *v1alp
return nil
}
// Convert_acme_ACMEIssuer_To_v1alpha2_ACMEIssuer is explicitly defined to avoid issues in conversion-gen
// when referencing types in other API groups.
func Convert_acme_ACMEIssuer_To_v1alpha2_ACMEIssuer(in *acme.ACMEIssuer, out *v1alpha2.ACMEIssuer, s conversion.Scope) error {
return autoConvert_acme_ACMEIssuer_To_v1alpha2_ACMEIssuer(in, out, s)
}
// Convert_v1alpha2_ACMEIssuer_To_acme_ACMEIssuer is explicitly defined to avoid issues in conversion-gen
// when referencing types in other API groups.
func Convert_v1alpha2_ACMEIssuer_To_acme_ACMEIssuer(in *v1alpha2.ACMEIssuer, out *acme.ACMEIssuer, s conversion.Scope) error {
return autoConvert_v1alpha2_ACMEIssuer_To_acme_ACMEIssuer(in, out, s)
}
+12
View File
@@ -82,3 +82,15 @@ func Convert_acme_OrderSpec_To_v1alpha3_OrderSpec(in *acme.OrderSpec, out *v1alp
return nil
}
// Convert_acme_ACMEIssuer_To_v1alpha3_ACMEIssuer is explicitly defined to avoid issues in conversion-gen
// when referencing types in other API groups.
func Convert_acme_ACMEIssuer_To_v1alpha3_ACMEIssuer(in *acme.ACMEIssuer, out *v1alpha3.ACMEIssuer, s conversion.Scope) error {
return autoConvert_acme_ACMEIssuer_To_v1alpha3_ACMEIssuer(in, out, s)
}
// Convert_v1alpha3_ACMEIssuer_To_acme_ACMEIssuer is explicitly defined to avoid issues in conversion-gen
// when referencing types in other API groups.
func Convert_v1alpha3_ACMEIssuer_To_acme_ACMEIssuer(in *v1alpha3.ACMEIssuer, out *acme.ACMEIssuer, s conversion.Scope) error {
return autoConvert_v1alpha3_ACMEIssuer_To_acme_ACMEIssuer(in, out, s)
}
+1
View File
@@ -3,6 +3,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = [
"conversion.go",
"defaults.go",
"doc.go",
"register.go",
+36
View File
@@ -0,0 +1,36 @@
/*
Copyright 2021 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.
*/
package v1beta1
import (
"k8s.io/apimachinery/pkg/conversion"
"github.com/jetstack/cert-manager/internal/apis/acme"
"github.com/jetstack/cert-manager/pkg/apis/acme/v1beta1"
)
// Convert_acme_ACMEIssuer_To_v1beta1_ACMEIssuer is explicitly defined to avoid issues in conversion-gen
// when referencing types in other API groups.
func Convert_acme_ACMEIssuer_To_v1beta1_ACMEIssuer(in *acme.ACMEIssuer, out *v1beta1.ACMEIssuer, s conversion.Scope) error {
return autoConvert_acme_ACMEIssuer_To_v1beta1_ACMEIssuer(in, out, s)
}
// Convert_v1beta1_ACMEIssuer_To_acme_ACMEIssuer is explicitly defined to avoid issues in conversion-gen
// when referencing types in other API groups.
func Convert_v1beta1_ACMEIssuer_To_acme_ACMEIssuer(in *v1beta1.ACMEIssuer, out *acme.ACMEIssuer, s conversion.Scope) error {
return autoConvert_v1beta1_ACMEIssuer_To_acme_ACMEIssuer(in, out, s)
}
+1
View File
@@ -3,6 +3,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = [
"conversion.go",
"defaults.go",
"doc.go",
"register.go",
+60
View File
@@ -0,0 +1,60 @@
/*
Copyright 2021 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.
*/
package v1
import (
"k8s.io/apimachinery/pkg/conversion"
"github.com/jetstack/cert-manager/internal/apis/meta"
"github.com/jetstack/cert-manager/pkg/apis/meta/v1"
)
// Convert_meta_LocalObjectReference_To_v1_LocalObjectReference is explicitly defined to avoid issues in conversion-gen
// when referencing types in other API groups.
func Convert_meta_LocalObjectReference_To_v1_LocalObjectReference(in *meta.LocalObjectReference, out *v1.LocalObjectReference, s conversion.Scope) error {
return autoConvert_meta_LocalObjectReference_To_v1_LocalObjectReference(in, out, s)
}
// Convert_v1_LocalObjectReference_To_meta_LocalObjectReference is explicitly defined to avoid issues in conversion-gen
// when referencing types in other API groups.
func Convert_v1_LocalObjectReference_To_meta_LocalObjectReference(in *v1.LocalObjectReference, out *meta.LocalObjectReference, s conversion.Scope) error {
return autoConvert_v1_LocalObjectReference_To_meta_LocalObjectReference(in, out, s)
}
// Convert_meta_ObjectReference_To_v1_ObjectReference is explicitly defined to avoid issues in conversion-gen
// when referencing types in other API groups.
func Convert_meta_ObjectReference_To_v1_ObjectReference(in *meta.ObjectReference, out *v1.ObjectReference, s conversion.Scope) error {
return autoConvert_meta_ObjectReference_To_v1_ObjectReference(in, out, s)
}
// Convert_v1_ObjectReference_To_meta_ObjectReference is explicitly defined to avoid issues in conversion-gen
// when referencing types in other API groups.
func Convert_v1_ObjectReference_To_meta_ObjectReference(in *v1.ObjectReference, out *meta.ObjectReference, s conversion.Scope) error {
return autoConvert_v1_ObjectReference_To_meta_ObjectReference(in, out, s)
}
// Convert_meta_SecretKeySelector_To_v1_SecretKeySelector is explicitly defined to avoid issues in conversion-gen
// when referencing types in other API groups.
func Convert_meta_SecretKeySelector_To_v1_SecretKeySelector(in *meta.SecretKeySelector, out *v1.SecretKeySelector, s conversion.Scope) error {
return autoConvert_meta_SecretKeySelector_To_v1_SecretKeySelector(in, out, s)
}
// Convert_v1_SecretKeySelector_To_meta_SecretKeySelector is explicitly defined to avoid issues in conversion-gen
// when referencing types in other API groups.
func Convert_v1_SecretKeySelector_To_meta_SecretKeySelector(in *v1.SecretKeySelector, out *meta.SecretKeySelector, s conversion.Scope) error {
return autoConvert_v1_SecretKeySelector_To_meta_SecretKeySelector(in, out, s)
}