Skip to content

removed GCloud-specific docker registry secret creation#77

Open
henzigo wants to merge 1 commit intojg/sf-graceful-shutdownfrom
jg/gcloud
Open

removed GCloud-specific docker registry secret creation#77
henzigo wants to merge 1 commit intojg/sf-graceful-shutdownfrom
jg/gcloud

Conversation

@henzigo
Copy link
Copy Markdown
Member

@henzigo henzigo commented Apr 15, 2026

No description provided.

@henzigo henzigo changed the title improved probes and graceful shutdown for storefront removed GCloud-specific docker registry secret creation Apr 15, 2026
@henzigo henzigo requested a review from Copilot April 15, 2026 18:14
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes the Google Cloud–specific branch for creating the Kubernetes docker registry secret during deploy, standardizing secret creation on the CI registry credentials.

Changes:

  • Removed GCLOUD_DEPLOY conditional logic and always create the dockerregistry secret using ${CI_REGISTRY} + ${DEPLOY_REGISTER_USER}/${DEPLOY_REGISTER_PASSWORD}.
  • Documented the change in the v5.0.0 → v5.1.0 upgrade notes.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
deploy/parts/deploy.sh Drops GCloud-only secret creation path and unifies docker-registry secret creation.
UPGRADE.md Adds an upgrade note referencing the change.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread deploy/parts/deploy.sh
else
runCommand "ERROR" "kubectl create secret docker-registry dockerregistry --docker-server=${CI_REGISTRY} --docker-username=${DEPLOY_REGISTER_USER} --docker-password=${DEPLOY_REGISTER_PASSWORD} -n ${PROJECT_NAME}"
fi
runCommand "ERROR" "kubectl create secret docker-registry dockerregistry --docker-server=${CI_REGISTRY} --docker-username=${DEPLOY_REGISTER_USER} --docker-password=${DEPLOY_REGISTER_PASSWORD} -n ${PROJECT_NAME}"
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI_REGISTRY is now required for all deployments (the GCloud branch was removed), but it is not validated at the top like the other required env vars. Add assertVariable "CI_REGISTRY" (or otherwise ensure it’s always set) so the script fails early with a clear message rather than running kubectl ... --docker-server=.

Copilot uses AI. Check for mistakes.
Comment thread deploy/parts/deploy.sh
else
runCommand "ERROR" "kubectl create secret docker-registry dockerregistry --docker-server=${CI_REGISTRY} --docker-username=${DEPLOY_REGISTER_USER} --docker-password=${DEPLOY_REGISTER_PASSWORD} -n ${PROJECT_NAME}"
fi
runCommand "ERROR" "kubectl create secret docker-registry dockerregistry --docker-server=${CI_REGISTRY} --docker-username=${DEPLOY_REGISTER_USER} --docker-password=${DEPLOY_REGISTER_PASSWORD} -n ${PROJECT_NAME}"
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

runCommand executes commands via eval (see deploy/functions.sh), but this kubectl create secret command interpolates DEPLOY_REGISTER_USER/DEPLOY_REGISTER_PASSWORD/CI_REGISTRY without shell-escaping. If any value contains spaces/shell metacharacters, the command can break or be exploited. Quote/escape these arguments (or avoid eval for command execution).

Suggested change
runCommand "ERROR" "kubectl create secret docker-registry dockerregistry --docker-server=${CI_REGISTRY} --docker-username=${DEPLOY_REGISTER_USER} --docker-password=${DEPLOY_REGISTER_PASSWORD} -n ${PROJECT_NAME}"
printf -v ESCAPED_CI_REGISTRY '%q' "${CI_REGISTRY}"
printf -v ESCAPED_DEPLOY_REGISTER_USER '%q' "${DEPLOY_REGISTER_USER}"
printf -v ESCAPED_DEPLOY_REGISTER_PASSWORD '%q' "${DEPLOY_REGISTER_PASSWORD}"
printf -v ESCAPED_PROJECT_NAME '%q' "${PROJECT_NAME}"
runCommand "ERROR" "kubectl create secret docker-registry dockerregistry --docker-server=${ESCAPED_CI_REGISTRY} --docker-username=${ESCAPED_DEPLOY_REGISTER_USER} --docker-password=${ESCAPED_DEPLOY_REGISTER_PASSWORD} -n ${ESCAPED_PROJECT_NAME}"

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants