/
types.go
45 lines (36 loc) · 1.27 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package testing
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
_ "github.com/openshift/origin/pkg/api/install"
)
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +k8s:deepcopy-gen=true
type TestConfig struct {
metav1.TypeMeta
Item1 string `json:"item1"`
Item2 []string `json:"item2"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +k8s:deepcopy-gen=true
type TestConfigV1 struct {
metav1.TypeMeta
Item1 string `json:"item1"`
Item2 []string `json:"item2"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +k8s:deepcopy-gen=true
type OtherTestConfig2 struct {
metav1.TypeMeta
Thing string `json:"thing"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +k8s:deepcopy-gen=true
type OtherTestConfig2V2 struct {
metav1.TypeMeta
Thing string `json:"thing"`
}
func (obj *TestConfig) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta }
func (obj *TestConfigV1) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta }
func (obj *OtherTestConfig2) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta }
func (obj *OtherTestConfig2V2) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta }