File: register.go

package info (click to toggle)
golang-github-openshift-api 4.0%2Bgit20190508.81d064c-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 14,040 kB
  • sloc: sh: 171; makefile: 32
file content (66 lines) | stat: -rw-r--r-- 1,779 bytes parent folder | download
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package v1

import (
	configv1 "github.com/openshift/api/config/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/apimachinery/pkg/runtime/schema"
)

var (
	GroupName     = "operator.openshift.io"
	GroupVersion  = schema.GroupVersion{Group: GroupName, Version: "v1"}
	schemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, configv1.Install)
	// Install is a function which adds this version to a scheme
	Install = schemeBuilder.AddToScheme

	// SchemeGroupVersion generated code relies on this name
	// Deprecated
	SchemeGroupVersion = GroupVersion
	// AddToScheme exists solely to keep the old generators creating valid code
	// DEPRECATED
	AddToScheme = schemeBuilder.AddToScheme
)

// Resource generated code relies on this being here, but it logically belongs to the group
// DEPRECATED
func Resource(resource string) schema.GroupResource {
	return schema.GroupResource{Group: GroupName, Resource: resource}
}

func addKnownTypes(scheme *runtime.Scheme) error {
	metav1.AddToGroupVersion(scheme, GroupVersion)

	scheme.AddKnownTypes(GroupVersion,
		&Authentication{},
		&AuthenticationList{},
		&DNS{},
		&DNSList{},
		&Console{},
		&ConsoleList{},
		&Etcd{},
		&EtcdList{},
		&KubeAPIServer{},
		&KubeAPIServerList{},
		&KubeControllerManager{},
		&KubeControllerManagerList{},
		&KubeScheduler{},
		&KubeSchedulerList{},
		&Network{},
		&NetworkList{},
		&OpenShiftAPIServer{},
		&OpenShiftAPIServerList{},
		&OpenShiftControllerManager{},
		&OpenShiftControllerManagerList{},
		&ServiceCA{},
		&ServiceCAList{},
		&ServiceCatalogAPIServer{},
		&ServiceCatalogAPIServerList{},
		&ServiceCatalogControllerManager{},
		&ServiceCatalogControllerManagerList{},
		&IngressController{},
		&IngressControllerList{},
	)

	return nil
}