Skip to content

Commit ef9c885

Browse files
doxiaorjeberhard
authored andcommitted
OWLS-73891 part 1: update warning messages and fix a helm upgrade issue (#1253)
* OWLS-73891 part 1 - fix stale domain watcher and add namespace in security check warning messages * More cleanup of stale states associated with a recreated namespace
1 parent 438d8c6 commit ef9c885

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

operator/src/main/java/oracle/kubernetes/operator/Main.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,10 @@ private static void stopNamespaces(Collection<String> namespacesToStop) {
221221
stopping.set(true);
222222
}
223223
isNamespaceStarted.remove(ns);
224+
domainWatchers.remove(ns);
225+
eventWatchers.remove(ns);
226+
podWatchers.remove(ns);
227+
serviceWatchers.remove(ns);
224228
}
225229
}
226230

operator/src/main/java/oracle/kubernetes/operator/helpers/HealthCheckHelper.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public static void performSecurityChecks(
118118

119119
// Validate RBAC or ABAC policies allow service account to perform required operations
120120
AuthorizationProxy ap = new AuthorizationProxy();
121-
LOGGER.info(MessageKeys.VERIFY_ACCESS_START);
121+
LOGGER.info(MessageKeys.VERIFY_ACCESS_START, ns);
122122

123123
if (version.isRulesReviewSupported()) {
124124
boolean rulesReviewSuccessful = true;
@@ -150,7 +150,7 @@ public static void performSecurityChecks(
150150
for (AuthorizationProxy.Operation op : namespaceAccessChecks.get(r)) {
151151

152152
if (!ap.check(op, r, null, AuthorizationProxy.Scope.namespace, ns)) {
153-
LOGGER.warning(MessageKeys.VERIFY_ACCESS_DENIED, op, r.getResource());
153+
LOGGER.warning(MessageKeys.VERIFY_ACCESS_DENIED, op, r.getResource(), ns);
154154
}
155155
}
156156
}
@@ -159,7 +159,7 @@ public static void performSecurityChecks(
159159
for (AuthorizationProxy.Operation op : clusterAccessChecks.get(r)) {
160160

161161
if (!ap.check(op, r, null, AuthorizationProxy.Scope.cluster, null)) {
162-
LOGGER.warning(MessageKeys.VERIFY_ACCESS_DENIED, op, r.getResource());
162+
LOGGER.warning(MessageKeys.VERIFY_ACCESS_DENIED, op, r.getResource(), ns);
163163
}
164164
}
165165
}

operator/src/main/resources/Operator.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ WLSKO-0025=Got exception {0} while trying to retrieve WLS configuration from adm
2727
WLSKO-0026=Fail to parse REST response from WLS. Json response is {0}. Exception is {1}
2828
WLSKO-0027=Service URL is {0}
2929
WLSKO-0028=No servers configured in WebLogic cluster with name {0}
30-
WLSKO-0029=Verifying that operator service account can access required operations on required resources
31-
WLSKO-0030=Access denied for operator service account for operation {0} on resource {1}
30+
WLSKO-0029=Verifying that operator service account can access required operations on required resources in namespace {0}
31+
WLSKO-0030=Access denied for operator service account for operation {0} on resource {1} in namespace {2}
3232
WLSKO-0031=A namespace has not been created for the Oracle WebLogic Server Operator for Kubernetes
3333
WLSKO-0032=A service account has not been created for the Oracle WebLogic Server Operator for Kubernetes
3434
WLSKO-0033=RBAC authorization mode is not enabled for the Kubernetes API server: {0}. To enable RBAC, start the apiserver with --authorization-mode=RBAC

0 commit comments

Comments
 (0)