Skip to content

Commit 2c71b83

Browse files
author
Tom Barnes
committed
Fix bug in override secrets. Each one needs to be mounted with its secret name in the path (.../secret-name).
1 parent fee8195 commit 2c71b83

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,8 @@ private V1Container createContainer(TuningParameters tuningParameters) {
235235
List<String> configOverrideSecrets = getConfigOverrideSecrets();
236236
for (String secretName : configOverrideSecrets) {
237237
container.addVolumeMountsItem(
238-
readOnlyVolumeMount(secretName + "-volume", OVERRIDE_SECRETS_MOUNT_PATH));
238+
readOnlyVolumeMount(
239+
secretName + "-volume", OVERRIDE_SECRETS_MOUNT_PATH + '/' + secretName));
239240
}
240241
return container;
241242
}

operator/src/main/resources/scripts/introspectDomain.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,13 @@ def __init__(self, env):
789789

790790

791791
def addSecretsFromDirectory(self, secret_path, secret_name):
792+
if not os.path.isdir(secret_path):
793+
# The operator pod somehow put a file where we
794+
# only expected to find a directory mount.
795+
self.env.addError("Internal Error: Secret path'"
796+
+ secret_path + "'" +
797+
+ " is not a directory.")
798+
return
792799
for the_file in os.listdir(secret_path):
793800
the_file_path = os.path.join(secret_path, the_file)
794801
if os.path.isfile(the_file_path):

0 commit comments

Comments
 (0)