MCPcopy Create free account
hub / github.com/devfile/devworkspace-operator / init

Function init

main.go:69–95  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

67)
68
69func init() {
70 // Figure out if we're running on OpenShift
71 err := infrastructure.Initialize()
72 if err != nil {
73 setupLog.Error(err, "could not determine cluster type")
74 os.Exit(1)
75 }
76
77 utilruntime.Must(clientgoscheme.AddToScheme(scheme))
78
79 utilruntime.Must(controllerv1alpha1.AddToScheme(scheme))
80 utilruntime.Must(dwv1.AddToScheme(scheme))
81 utilruntime.Must(dwv2.AddToScheme(scheme))
82
83 if infrastructure.IsOpenShift() {
84 utilruntime.Must(routev1.Install(scheme))
85 utilruntime.Must(templatev1.Install(scheme))
86 utilruntime.Must(oauthv1.Install(scheme))
87 // Enable controller to manage SCCs in OpenShift; permissions to do this are not requested
88 // by default and must be added by a cluster-admin.
89 utilruntime.Must(securityv1.Install(scheme))
90 // Enable controller to read cluster-wide proxy on OpenShift
91 utilruntime.Must(configv1.AddToScheme(scheme))
92 }
93
94 // +kubebuilder:scaffold:scheme
95}
96
97func main() {
98 var metricsAddr string

Callers

nothing calls this directly

Calls 3

InitializeFunction · 0.92
IsOpenShiftFunction · 0.92
ErrorMethod · 0.45

Tested by

no test coverage detected