import ( runtimeScheme "k8s.io/kubernetes/pkg/runtime/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/example/exampleapi/pkg/apis/example" ) func init() { _ = example.AddToScheme(runtimeScheme.Scheme) metav1.AddToGroupVersion(runtimeScheme.Scheme, example.GroupVersion) runtimeScheme.AddGeneratedConversionFuncs( &example.Pod{}, &examplev1alpha1.Pod{}, &examplev1beta1.Pod{}, ) }
import ( runtimeScheme "k8s.io/kubernetes/pkg/runtime/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/api/core/v1" ) func init() { metav1.AddToGroupVersion(runtimeScheme.Scheme, v1.SchemeGroupVersion) runtimeScheme.AddGeneratedConversionFuncs( &v1.PersistentVolumeClaim{}, &v1beta1.PersistentVolumeClaim{}, ) }In this example, we are adding the core v1 API group to the runtime scheme and registering the generated conversion functions for the `PersistentVolumeClaim` type between the v1 and v1beta1 versions. Overall, the `AddGeneratedConversionFuncs` function is useful for registering generated conversion functions between versioned types in the Kubernetes runtime Scheme.