Changed requiredSecrets to defaultSecrets
This commit is contained in:
@@ -109,7 +109,7 @@ mkdir -p "${DEST_APP_DIR}"
|
||||
# Step 1: Copy manifest.yaml from repository first
|
||||
MANIFEST_FILE="${SOURCE_APP_DIR}/manifest.yaml"
|
||||
if [ -f "${MANIFEST_FILE}" ]; then
|
||||
# manifest.yaml is allowed to have gomplate variables in the defaultConfig and requiredSecrets sections.
|
||||
# manifest.yaml is allowed to have gomplate variables in the defaultConfig and defaultSecrets sections.
|
||||
# We need to use gomplate to process these variables before using yq.
|
||||
echo "Processing app manifest."
|
||||
DEST_MANIFEST="${DEST_APP_DIR}/manifest.yaml"
|
||||
@@ -155,7 +155,7 @@ if yq eval '.defaultConfig' "${DEST_MANIFEST}" | grep -q -v '^null$'; then
|
||||
fi
|
||||
|
||||
# Scaffold required secrets into .wildcloud/secrets.yaml if they don't exist
|
||||
if yq eval '.requiredSecrets' "${DEST_MANIFEST}" | grep -q -v '^null$'; then
|
||||
if yq eval '.defaultSecrets' "${DEST_MANIFEST}" | grep -q -v '^null$'; then
|
||||
|
||||
# Ensure .wildcloud/secrets.yaml exists
|
||||
if [ ! -f "${SECRETS_FILE}" ]; then
|
||||
@@ -174,7 +174,7 @@ if yq eval '.requiredSecrets' "${DEST_MANIFEST}" | grep -q -v '^null$'; then
|
||||
random_secret=$(openssl rand -base64 32 | tr -d "=+/" | cut -c1-32)
|
||||
yq eval ".${secret_path} = \"${random_secret}\"" -i "${SECRETS_FILE}"
|
||||
fi
|
||||
done < <(yq eval '.requiredSecrets[]' "${DEST_MANIFEST}")
|
||||
done < <(yq eval '.defaultSecrets[]' "${DEST_MANIFEST}")
|
||||
echo "Required secrets declared in app manifest added to '${SECRETS_FILE}'."
|
||||
fi
|
||||
|
||||
|
||||
@@ -63,14 +63,14 @@ deploy_secrets() {
|
||||
local app_name="$1"
|
||||
local target_namespace="${2:-${app_name}}" # Default to app name if not specified
|
||||
|
||||
# Check if app has a manifest with requiredSecrets
|
||||
# Check if app has a manifest with defaultSecrets
|
||||
local manifest_file="apps/${app_name}/manifest.yaml"
|
||||
if [ ! -f "${manifest_file}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Check if there are required secrets defined
|
||||
if ! yq eval '.requiredSecrets' "${manifest_file}" | grep -q -v '^null$'; then
|
||||
if ! yq eval '.defaultSecrets' "${manifest_file}" | grep -q -v '^null$'; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
@@ -89,7 +89,7 @@ deploy_secrets() {
|
||||
echo "Error: Required secret '${secret_path}' not found in ${SECRETS_FILE} for app '${app_name}'"
|
||||
exit 1
|
||||
fi
|
||||
done < <(yq eval '.requiredSecrets[]' "${manifest_file}")
|
||||
done < <(yq eval '.defaultSecrets[]' "${manifest_file}")
|
||||
|
||||
# Create/update app secret in cluster
|
||||
if [ -n "${secret_data}" ]; then
|
||||
|
||||
Reference in New Issue
Block a user