Skip to content

Commit

Permalink
Use shortname prefixed name in internal encryption secret
Browse files Browse the repository at this point in the history
  • Loading branch information
kabicin committed Sep 16, 2024
1 parent 3240426 commit ce9b00f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions internal/controller/ltpa_keys_sharing.go
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ func (r *ReconcileOpenLiberty) generateLTPAKeys(instance *olv1.OpenLibertyApplic
ConfigMapName: ltpaKeysCreationScriptConfigMap.Name,
JobRequestConfigMapName: ltpaJobRequest.Name,
FileName: lutils.LTPAKeysFileName,
EncryptionKeySecretName: lutils.PasswordEncryptionKeyRootName + passwordEncryptionMetadata.Name + "-internal",
EncryptionKeySecretName: lutils.LocalPasswordEncryptionKeyRootName + passwordEncryptionMetadata.Name + "-internal",
EncryptionKeySharingEnabled: r.isUsingPasswordEncryptionKeySharing(instance, passwordEncryptionMetadata), // fix LTPA to use the default password encryption key (no suffix)
}
lutils.CustomizeLTPAKeysJob(generateLTPAKeysJob, instance, ltpaConfig, r.GetClient())
Expand Down Expand Up @@ -734,7 +734,7 @@ func (r *ReconcileOpenLiberty) generateLTPAConfig(instance *olv1.OpenLibertyAppl
ConfigMapName: ltpaConfigCreationScriptConfigMap.Name,
JobRequestConfigMapName: ltpaJobRequest.Name,
FileName: lutils.LTPAKeysFileName,
EncryptionKeySecretName: lutils.PasswordEncryptionKeyRootName + passwordEncryptionMetadata.Name + "-internal",
EncryptionKeySecretName: lutils.LocalPasswordEncryptionKeyRootName + passwordEncryptionMetadata.Name + "-internal",
EncryptionKeySharingEnabled: r.isUsingPasswordEncryptionKeySharing(instance, passwordEncryptionMetadata), // fix LTPA to use the default password encryption key (no suffix)
}
lutils.CustomizeLTPAConfigJob(generateLTPAConfigJob, instance, ltpaConfig, r.GetClient())
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/password_encryption_key_sharing.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func (r *ReconcileOpenLiberty) isUsingPasswordEncryptionKeySharing(instance *olv

// Returns the Secret that contains the password encryption key used internally by the operator
func (r *ReconcileOpenLiberty) hasInternalEncryptionKeySecret(instance *olv1.OpenLibertyApplication, passwordEncryptionMetadata *lutils.PasswordEncryptionMetadata) (*corev1.Secret, error) {
return r.getSecret(instance, lutils.PasswordEncryptionKeyRootName+passwordEncryptionMetadata.Name+"-internal")
return r.getSecret(instance, lutils.LocalPasswordEncryptionKeyRootName+passwordEncryptionMetadata.Name+"-internal")
}

// Returns the Secret that contains the password encryption key provided by the user
Expand Down
1 change: 1 addition & 0 deletions utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const overridesMountPath = "/config/configDropins/overrides"
const ManagedEncryptionServerXML = "-managed-encryption-server-xml"
const ManagedEncryptionMountServerXML = "-managed-encryption-mount-server-xml"
const PasswordEncryptionKeyRootName = "wlp-password-encryption-key"
const LocalPasswordEncryptionKeyRootName = "olo-wlp-password-encryption-key"
const EncryptionKeyXMLFileName = "encryptionKey.xml"
const EncryptionKeyMountXMLFileName = "encryptionKeyMount.xml"

Expand Down

0 comments on commit ce9b00f

Please sign in to comment.