@@ -78,10 +78,16 @@ To enable clients to encode and decode your API, your types must be able to be r
78
78
By default, Kubebuilder will provide you with a scheme builder like:
79
79
80
80
``` go
81
- import " sigs.k8s.io/controller-runtime/pkg/scheme"
81
+ import (
82
+ " k8s.io/apimachinery/pkg/runtime/schema"
83
+ " sigs.k8s.io/controller-runtime/pkg/scheme"
84
+ )
82
85
83
86
var (
84
- // SchemeBuilder is used to add go types to the GroupVersionKind scheme
87
+ // GroupVersion is group version used to register these objects.
88
+ GroupVersion = schema.GroupVersion {Group: " infrastructure.cluster.x-k8s.io" , Version : " v1alpha1" }
89
+
90
+ // SchemeBuilder is used to add go types to the GroupVersionKind scheme.
85
91
SchemeBuilder = &scheme.Builder {GroupVersion: GroupVersion }
86
92
87
93
// AddToScheme adds the types in this group-version to the given scheme.
@@ -105,10 +111,17 @@ to be imported cleanly into other projects.
105
111
To mitigate this, use the following schemebuilder pattern:
106
112
107
113
``` go
108
- import " k8s.io/apimachinery/pkg/runtime"
114
+ import (
115
+ metav1 " k8s.io/apimachinery/pkg/apis/meta/v1"
116
+ " k8s.io/apimachinery/pkg/runtime"
117
+ " k8s.io/apimachinery/pkg/runtime/schema"
118
+ )
109
119
110
120
var (
111
- // schemeBuilder is used to add go types to the GroupVersionKind scheme.
121
+ // GroupVersion is group version used to register these objects.
122
+ GroupVersion = schema.GroupVersion {Group: " infrastructure.cluster.x-k8s.io" , Version : " v1alpha1" }
123
+
124
+ // SchemeBuilder is used to add go types to the GroupVersionKind scheme.
112
125
schemeBuilder = runtime.NewSchemeBuilder (addKnownTypes)
113
126
114
127
// AddToScheme adds the types in this group-version to the given scheme.
0 commit comments