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

CLI error when no nodepools discovered #1701

Open
1 of 3 tasks
fjmacagno opened this issue Aug 12, 2024 · 0 comments
Open
1 of 3 tasks

CLI error when no nodepools discovered #1701

fjmacagno opened this issue Aug 12, 2024 · 0 comments

Comments

@fjmacagno
Copy link

Describe the bug

In CI we sync a local deployment configuration to Astronomer, and are getting errors running the command

astro deployment update <id> --deployment-file .astro/astro_deployment_template.yaml

We have this line in the config: default_worker_type: m5.xlarge we get the error

Error: worker_type: m5.xlarge does not exist in cluster: aw-usw1-astronomer

If we remove the line, we get

panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/astronomer/astro-cli/cloud/deployment/fromfile.getNodePoolIDFromWorkerType({0x0?, 0x12?}, {0x140006b6b70?, 0x103838f6b?}, {0x0?, 0x102df919c?, 0x140005c9088?})
github.com/astronomer/astro-cli/cloud/deployment/fromfile/fromfile.go:820 +0x78
github.com/astronomer/astro-cli/cloud/deployment/fromfile.createOrUpdateDeployment(0x140000f61a0, {0x140005a2240, 0x19}, {0x140005a2200, 0x1b}, {0x103831adf, 0x6}, 0x140005cb0c8, {0x0, 0x0, ...}, ...)
github.com/astronomer/astro-cli/cloud/deployment/fromfile/fromfile.go:628 +0x18e4
github.com/astronomer/astro-cli/cloud/deployment/fromfile.CreateOrUpdate({0x16d322f9e, 0x25}, {0x103848959, 0x6}, {0x103e19780, 0x1400028ad10}, {0x103e20700, 0x1400028acf0}, {0x103df6398, 0x1400007e050})
github.com/astronomer/astro-cli/cloud/deployment/fromfile/fromfile.go:172 +0x93c
github.com/astronomer/astro-cli/cmd/cloud.deploymentUpdate(0x14000010c08, {0x140000dc420, 0x1, 0x0?}, {0x103df6398, 0x1400007e050})
github.com/astronomer/astro-cli/cmd/cloud/deployment.go:745 +0x8f0
github.com/astronomer/astro-cli/cmd/cloud.newDeploymentUpdateCmd.func1(0x14000010c08?, {0x140000dc420?, 0x4?, 0x10382fbed?})
github.com/astronomer/astro-cli/cmd/cloud/deployment.go:430 +0x28
github.com/spf13/cobra.(*Command).execute(0x14000010c08, {0x140000dc3c0, 0x3, 0x3})
github.com/spf13/[[email protected]](mailto:[email protected])/command.go:940 +0x654
github.com/spf13/cobra.(*Command).ExecuteC(0x140001cdb08)
github.com/spf13/[[email protected]](mailto:[email protected])/command.go:1068 +0x320
github.com/spf13/cobra.(*Command).Execute(0x103e0f3a0?)
github.com/spf13/[[email protected]](mailto:[email protected])/command.go:992 +0x1c
main.main()
github.com/astronomer/astro-cli/main.go:21 +0x38

We have fixed the issue by adding deployment_type: DEDICATED to our deployment, but it seems like there should be a check in the cli for the case where there are no discovered nodepools, which is my guess as to what was happening.

return nodePools[0].Id, nil

What CLI Version did you experience this bug?
1.28.1

This CLI bug is related to which Astronomer Platform?

  • Astro
  • Software
  • None/Unknown

What Operating System is the above CLI installed on?

🪜 Steps To Reproduce

📸 Screenshots

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

No branches or pull requests

1 participant