()
| 67 | ) |
| 68 | |
| 69 | func 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 | |
| 97 | func main() { |
| 98 | var metricsAddr string |
nothing calls this directly
no test coverage detected