|
137 | 137 | import static oracle.kubernetes.operator.helpers.StepContextConstants.OPSS_WALLETFILE_VOLUME;
|
138 | 138 | import static oracle.kubernetes.operator.helpers.StepContextConstants.SECRETS_VOLUME;
|
139 | 139 | import static oracle.kubernetes.operator.helpers.StepContextConstants.WDTCONFIGMAP_MOUNT_PATH;
|
| 140 | +import static oracle.kubernetes.operator.helpers.StepContextConstants.WDT_MODEL_ENCRYPTION_PASSPHRASE_MOUNT_PATH; |
| 141 | +import static oracle.kubernetes.operator.helpers.StepContextConstants.WDT_MODEL_ENCRYPTION_PASSPHRASE_VOLUME; |
140 | 142 | import static oracle.kubernetes.operator.tuning.TuningParameters.DOMAIN_PRESENCE_RECHECK_INTERVAL_SECONDS;
|
141 | 143 | import static oracle.kubernetes.weblogic.domain.model.AuxiliaryImage.AUXILIARY_IMAGE_DEFAULT_SOURCE_WDT_INSTALL_HOME;
|
142 | 144 | import static oracle.kubernetes.weblogic.domain.model.AuxiliaryImage.AUXILIARY_IMAGE_INTERNAL_VOLUME_NAME;
|
@@ -497,6 +499,24 @@ void whenJobCreatedWithInitializeDomainOnPVDefined_hasSecretsVolumeAndMounts() {
|
497 | 499 | .mountPath(OPSS_KEY_MOUNT_PATH).readOnly(true)));
|
498 | 500 | }
|
499 | 501 |
|
| 502 | + @Test |
| 503 | + void whenJobCreatedWithInitDomainOnPVWithModelEncryption_hasSecretsVolumeAndMounts() { |
| 504 | + getConfigurator().withInitializeDomainOnPVModelEncryptionSecret("encryptedSecret"); |
| 505 | + testSupport.defineResources(createSecret("encryptedSecret")); |
| 506 | + |
| 507 | + List<V1Job> jobs = runStepsAndGetJobs(); |
| 508 | + V1Job job = jobs.get(0); |
| 509 | + |
| 510 | + assertThat(getJobPodSpec(job).getVolumes(), |
| 511 | + hasItem(new V1Volume().name(WDT_MODEL_ENCRYPTION_PASSPHRASE_VOLUME).secret( |
| 512 | + new V1SecretVolumeSource().secretName("encryptedSecret").optional(true).defaultMode(420)))); |
| 513 | + assertThat(getCreatedPodSpecContainers(jobs).get(0).getVolumeMounts(), |
| 514 | + hasItem(new V1VolumeMount().name(WDT_MODEL_ENCRYPTION_PASSPHRASE_VOLUME) |
| 515 | + .mountPath(WDT_MODEL_ENCRYPTION_PASSPHRASE_MOUNT_PATH).readOnly(true))); |
| 516 | + |
| 517 | + } |
| 518 | + |
| 519 | + |
500 | 520 | private V1Secret createSecret(String name) {
|
501 | 521 | return new V1Secret().metadata(new V1ObjectMeta().name(name).namespace(NS));
|
502 | 522 | }
|
|
0 commit comments