You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -1006,30 +978,23 @@ func (r *NamespaceScopeReconciler) getValidatedNamespaces(ctx context.Context, i
1006
978
validatedNs=append(validatedNs, nsMem)
1007
979
continue
1008
980
}
1009
-
// Check if operator has target namespace admin permission
1010
-
ifr.checkNamespaceAdminAuth(ctx, nsMem) {
1011
-
// Check if operator has permission to get namespace resource
1012
-
ifr.checkGetNSAuth(ctx) {
1013
-
ns:=&corev1.Namespace{}
1014
-
key:= types.NamespacedName{Name: nsMem}
1015
-
iferr:=r.Client.Get(ctx, key, ns); err!=nil {
1016
-
iferrors.IsNotFound(err) {
1017
-
klog.Infof("Namespace %s does not exist and will be ignored", nsMem)
1018
-
continue
1019
-
}
1020
-
returnnil, err
1021
-
}
1022
-
ifns.Status.Phase==corev1.NamespaceTerminating {
1023
-
klog.Infof("Namespace %s is terminating. Ignore this namespace", nsMem)
981
+
// Check if operator has permission to get namespace resource
982
+
ifr.checkGetNSAuth(ctx) {
983
+
ns:=&corev1.Namespace{}
984
+
key:= types.NamespacedName{Name: nsMem}
985
+
iferr:=r.Client.Get(ctx, key, ns); err!=nil {
986
+
iferrors.IsNotFound(err) {
987
+
klog.Infof("Namespace %s does not exist and will be ignored", nsMem)
1024
988
continue
1025
989
}
990
+
returnnil, err
991
+
}
992
+
ifns.Status.Phase==corev1.NamespaceTerminating {
993
+
klog.Infof("Namespace %s is terminating. Ignore this namespace", nsMem)
994
+
continue
1026
995
}
1027
-
validatedNs=append(validatedNs, nsMem)
1028
-
} else {
1029
-
klog.Infof("ibm-namespace-scope-operator doesn't have admin permission in namespace %s", nsMem)
1030
-
klog.Infof("NOTE: Please refer to https://ibm.biz/cs_namespace_operator to authorize ibm-namespace-scope-operator permissions to namespace %s", nsMem)
1031
-
r.Recorder.Eventf(instance, corev1.EventTypeWarning, "Forbidden", "ibm-namespace-scope-operator doesn't have admin permission in namespace %s. NOTE: Refer to https://ibm.biz/cs_namespace_operator to authorize ibm-namespace-scope-operator permissions to namespace %s", nsMem, nsMem)
0 commit comments