From 0ce06930209d82c7d4dcbff441b11891405d5f67 Mon Sep 17 00:00:00 2001 From: Fiona Waters Date: Thu, 15 Jun 2023 12:12:51 +0100 Subject: [PATCH 1/5] Updating error log output --- controllers/appwrapper_controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/appwrapper_controller.go b/controllers/appwrapper_controller.go index 1581c38..64281a2 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.Infof("Error getting instascale-ocm-secret from namespace %v - Error : %v", r.ConfigsNamespace, err) } ocmToken = string(instascaleOCMSecret.Data["token"]) } From 4a0d07d4cc2a781202ccebdf523aa50cdda48773 Mon Sep 17 00:00:00 2001 From: Fiona Waters Date: Thu, 15 Jun 2023 12:13:27 +0100 Subject: [PATCH 2/5] updating rbacs --- deployment/instascale-clusterrole.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/deployment/instascale-clusterrole.yaml b/deployment/instascale-clusterrole.yaml index fb431cc..cb0faec 100644 --- a/deployment/instascale-clusterrole.yaml +++ b/deployment/instascale-clusterrole.yaml @@ -50,3 +50,10 @@ rules: - update - delete - patch + +- apiGroups: + - "" + resources: + - secrets + verbs: + - get From 8e45da2a077902919017209976c57dcdc0fe2e0a Mon Sep 17 00:00:00 2001 From: Fiona Waters Date: Thu, 15 Jun 2023 14:18:48 +0100 Subject: [PATCH 3/5] updating to specify required secret --- deployment/instascale-clusterrole.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/deployment/instascale-clusterrole.yaml b/deployment/instascale-clusterrole.yaml index cb0faec..db6de7d 100644 --- a/deployment/instascale-clusterrole.yaml +++ b/deployment/instascale-clusterrole.yaml @@ -53,6 +53,8 @@ rules: - apiGroups: - "" + resourceNames: + - instascale-ocm-secret resources: - secrets verbs: From 780da7735bd4f0adc7858e143eadc2f780260271 Mon Sep 17 00:00:00 2001 From: Fiona Waters Date: Mon, 19 Jun 2023 14:13:04 +0100 Subject: [PATCH 4/5] adding clusterversions --- deployment/instascale-clusterrole.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/deployment/instascale-clusterrole.yaml b/deployment/instascale-clusterrole.yaml index db6de7d..498a02b 100644 --- a/deployment/instascale-clusterrole.yaml +++ b/deployment/instascale-clusterrole.yaml @@ -59,3 +59,11 @@ rules: - secrets verbs: - get + +- apiGroups: + - config.openshift.io + resources: + - clusterversions + verbs: + - get + - list From fde1918a3d6e01677c152a81e85e85674c4c536a Mon Sep 17 00:00:00 2001 From: Fiona Waters Date: Wed, 21 Jun 2023 10:07:01 +0100 Subject: [PATCH 5/5] updating to use Errorf --- controllers/appwrapper_controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/appwrapper_controller.go b/controllers/appwrapper_controller.go index 64281a2..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 - Error : %v", r.ConfigsNamespace, err) + klog.Errorf("Error getting instascale-ocm-secret from namespace %v - Error : %v", r.ConfigsNamespace, err) } ocmToken = string(instascaleOCMSecret.Data["token"]) }