-
Notifications
You must be signed in to change notification settings - Fork 60
[patch] Rename Facilities MREF AES Keystore Secret for gitops #2597
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
e19f1b8
f3f1da7
65682f2
7f6a8a9
c0f12a6
6cc4010
fa31f02
6133f9a
8d56846
9dc7028
a7dd8de
98a6e77
8301b55
4a14f96
a3ab1c7
be575cb
b967e13
0ac0d06
40f21fe
d93ec6b
87f94ad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -425,7 +425,7 @@ function gitops_suite_app_config() { | |
| if [[ -n "${ICN}" ]]; then | ||
| echo "✓ ICN successfully resolved: ${ICN}" | ||
| echo " This ICN will be used for customer-level secrets:" | ||
| echo " - ibm-customer/${ICN}/facilities/manage-mref-keystore-password" | ||
| echo " - ibm-customer/${ICN}/facilities/{workspace_id}-facilities-vs--sn" | ||
| echo " - ibm-customer/${ICN}/<app>/..." | ||
| else | ||
| echo "⚠ WARNING: ICN not available - customer-level secrets cannot be used" | ||
|
|
@@ -626,11 +626,10 @@ function gitops_suite_app_config() { | |
|
|
||
| # Set customer-level secret path (without trailing separator) | ||
| export FACILITIES_VAULT_SECRET="ibm-customer${SECRETS_KEY_SEPERATOR}${ICN}${SECRETS_KEY_SEPERATOR}facilities" | ||
| export FACILITIES_LIBERTY_EXTENSIONS_SECRET="ibm-customer${SECRETS_KEY_SEPERATOR}${ICN}${SECRETS_KEY_SEPERATOR}facilities" | ||
| export FACILITIES_LIBERTY_EXTENSIONS_SECRET="${ACCOUNT_ID}${SECRETS_KEY_SEPERATOR}${CLUSTER_ID}${SECRETS_KEY_SEPERATOR}${MAS_INSTANCE_ID}${SECRETS_KEY_SEPERATOR}facilities" | ||
|
|
||
| # Get user-provided secret name from app spec (if any) | ||
| USER_PROVIDED_VAULT_SECRET=$(yq eval '.mas_appws_spec.settings.vaultSecret.secretName // ""' ${MAS_APPWS_SPEC_YAML_RESOLVED}) | ||
| USER_PROVIDED_LIBERTY_SECRET=$(yq eval '.mas_appws_spec.settings.libertyExtensionXML.secretName // ""' ${MAS_APPWS_SPEC_YAML_RESOLVED}) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we are not using the provided liberty secret name?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, the liberty secret name is taken directly from CR and validated against the format
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The following is the slack thread is where the Gitops issue was reported, it might help put things better into context: https://ibm-mas.slack.com/archives/C0161LRJWDU/p1788890475858589 |
||
|
|
||
| # Handle vault secret name | ||
| if [[ -n "${USER_PROVIDED_VAULT_SECRET}" ]]; then | ||
|
|
@@ -640,25 +639,29 @@ function gitops_suite_app_config() { | |
| echo "- Verifying user-provided secret exists..." | ||
| else | ||
| # No user-provided name - use customer-level default | ||
| export FACILITIES_VAULT_SECRET_NAME="manage-mref-keystore-password" | ||
| export FACILITIES_VAULT_SECRET_NAME="${MAS_WORKSPACE_ID}-facilities-vs--sn" | ||
| echo "- Using customer-level vault secret name: ${FACILITIES_VAULT_SECRET_NAME}" | ||
| local FACILITIES_AWS_SECRET_NAME="${MAS_WORKSPACE_ID}-facilities-vs--sn" | ||
|
|
||
| # Ensure customer-level secret exists | ||
| manage_customer_mref_password "${ICN}" "${ACCOUNT_ID}" "${CLUSTER_ID}" "${MAS_INSTANCE_ID}" "${SECRETS_KEY_SEPERATOR}" | ||
| manage_customer_mref_password "${ICN}" "${ACCOUNT_ID}" "${CLUSTER_ID}" "${MAS_INSTANCE_ID}" "${MAS_WORKSPACE_ID}" "${SECRETS_KEY_SEPERATOR}" | ||
| if [[ $? -ne 0 ]]; then | ||
| echo "ERROR: Failed to create/retrieve customer-level MREF password" | ||
| exit 1 | ||
| fi | ||
| fi | ||
|
|
||
| # Verify vault secret exists | ||
| sm_verify_secret_exists "${FACILITIES_VAULT_SECRET}${SECRETS_KEY_SEPERATOR}${FACILITIES_VAULT_SECRET_NAME}" "password" | ||
| sm_verify_secret_exists "${FACILITIES_VAULT_SECRET}${SECRETS_KEY_SEPERATOR}${FACILITIES_AWS_SECRET_NAME:-${FACILITIES_VAULT_SECRET_NAME}}" "pwd" | ||
|
|
||
| # Handle liberty extensions secret name | ||
| if [[ -n "${USER_PROVIDED_LIBERTY_SECRET}" ]]; then | ||
| export FACILITIES_LIBERTY_EXTENSIONS_SECRET_NAME="${USER_PROVIDED_LIBERTY_SECRET}" | ||
| echo "- Using user-provided liberty extensions secret name: ${FACILITIES_LIBERTY_EXTENSIONS_SECRET_NAME}" | ||
| # Verify liberty secret exists | ||
| export FACILITIES_LIBERTY_EXTENSIONS_SECRET_NAME=$(yq eval '.mas_appws_spec.settings.libertyExtensionXML.secretName // ""' ${MAS_APPWS_SPEC_YAML_RESOLVED}) | ||
| if [[ -n "${FACILITIES_LIBERTY_EXTENSIONS_SECRET_NAME}" ]]; then | ||
| if [[ "${FACILITIES_LIBERTY_EXTENSIONS_SECRET_NAME}" != "${MAS_WORKSPACE_ID}-facilities-lexml--sn" ]]; then | ||
| echo "Error: Secret name ${FACILITIES_LIBERTY_EXTENSIONS_SECRET_NAME} does not match ${MAS_WORKSPACE_ID}-facilities-lexml--sn" | ||
| exit 1 | ||
| fi | ||
| echo "- Using liberty extensions secret name: ${FACILITIES_LIBERTY_EXTENSIONS_SECRET_NAME}" | ||
| sm_verify_secret_exists "${FACILITIES_LIBERTY_EXTENSIONS_SECRET}${SECRETS_KEY_SEPERATOR}${FACILITIES_LIBERTY_EXTENSIONS_SECRET_NAME}" "b64_xml" | ||
| fi | ||
| fi # end if [[ "${MAS_APP_ID}" == "facilities" ]] | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why was the FACILITIES_LIBERTY_EXTENSIONS_SECRET changed? it isn't mentioned in the issue or PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
main-facilities-lexml--snwas restored to instance level due to issues in the Gitops pipeline, therefore FACILITIES_LIBERTY_EXTENSIONS_SECRET also needed to be restored to instance level for correct pathing in AWS