diff --git a/controllers/appwrapper_controller.go b/controllers/appwrapper_controller.go index 1581c38..86c35e8 100644 --- a/controllers/appwrapper_controller.go +++ b/controllers/appwrapper_controller.go @@ -169,7 +169,7 @@ func (r *AppWrapperReconciler) SetupWithManager(mgr ctrl.Manager) error { if !useMachineSets { instascaleOCMSecret, err := kubeClient.CoreV1().Secrets(r.ConfigsNamespace).Get(context.Background(), "instascale-ocm-secret", metav1.GetOptions{}) if err != nil { - klog.Infof("Error getting instascale-ocm-secret from namespace %v", r.ConfigsNamespace) + klog.Errorf("Error getting instascale-ocm-secret from namespace %v - Error : %v", r.ConfigsNamespace, err) } ocmToken = string(instascaleOCMSecret.Data["token"]) } diff --git a/deployment/instascale-clusterrole.yaml b/deployment/instascale-clusterrole.yaml index fb431cc..498a02b 100644 --- a/deployment/instascale-clusterrole.yaml +++ b/deployment/instascale-clusterrole.yaml @@ -50,3 +50,20 @@ rules: - update - delete - patch + +- apiGroups: + - "" + resourceNames: + - instascale-ocm-secret + resources: + - secrets + verbs: + - get + +- apiGroups: + - config.openshift.io + resources: + - clusterversions + verbs: + - get + - list