Skip to content
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

Added the support for --image-name flag in the astro deploy command #1751

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

rujhan-arora-astronomer
Copy link
Contributor

@rujhan-arora-astronomer rujhan-arora-astronomer commented Dec 5, 2024

Description

Added the support for --image-name flag in the astro deploy command. Internally, it will call the updateDeploymentImage API. No image will be pushed to the registry. The command will be like this -
astro deploy --image-name IMAGE_URL --runtime-version IMAGE_RUNTIME_VERSION

🎟 Issue(s)

Related https://github.com/astronomer/issues/issues/6828

🧪 Functional Testing

Tested locally

📸 Screenshots

📋 Checklist

  • Rebased from the main (or release if patching) branch (before testing)
  • Ran make test before taking out of draft
  • Ran make lint before taking out of draft
  • Added/updated applicable tests
  • Tested against Astro-API (if necessary).
  • Tested against Houston-API and Astronomer (if necessary).
  • Communicated to/tagged owners of respective clients potentially impacted by these changes.
  • Updated any related documentation

Copy link
Contributor

@neel-astro neel-astro left a comment

Choose a reason for hiding this comment

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

Left some minor comments, but looks fine otherwise

Comment on lines +438 to +440
if runtimeVersion == "" {
return ErrNoRuntimeVersionPassed
}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: do we need to validate that runtimeVersion is a valid semver and present in updates.astronomer.io? Or does the Houston API do that for us?

if runtimeVersion == "" {
return ErrNoRuntimeVersionPassed
}
if imageName == "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Should we validate that the image being passed is built using the same runtime version as the one being passed on as user input? Or does the Houston API do that for us?

Comment on lines +444 to +451
deploymentIDForCurrentCmd, _, err := getDeploymentIDForCurrentCommandVar(houstonClient, wsID, deploymentID, deploymentID == "")
if err != nil {
return err
}
deploymentID = deploymentIDForCurrentCmd
if deploymentID == "" {
return errInvalidDeploymentID
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
deploymentIDForCurrentCmd, _, err := getDeploymentIDForCurrentCommandVar(houstonClient, wsID, deploymentID, deploymentID == "")
if err != nil {
return err
}
deploymentID = deploymentIDForCurrentCmd
if deploymentID == "" {
return errInvalidDeploymentID
}
deploymentID, _, err := getDeploymentIDForCurrentCommandVar(houstonClient, wsID, deploymentID, deploymentID == "")
if err != nil {
return err
}
if deploymentID == "" {
return errInvalidDeploymentID
}

nit: simplifying the logic

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