Skip to content

Comments

Added the support for clusterID for the pre-created namespaces flows in CLI #1907

Merged
rujhan-arora-astronomer merged 5 commits intogh_7572from
gh_7590
Aug 11, 2025
Merged

Added the support for clusterID for the pre-created namespaces flows in CLI #1907
rujhan-arora-astronomer merged 5 commits intogh_7572from
gh_7590

Conversation

@rujhan-arora-astronomer
Copy link
Contributor

@rujhan-arora-astronomer rujhan-arora-astronomer commented Aug 4, 2025

Description

Currently, the CLI fetches the list of available pre-created namespaces and applies filters based on the Houston configmap. This approach is problematic for 1.0 because it doesn't account for feature flags or specific configurations that may be enabled on a per-cluster basis.

As a result, a user might see a list of pre-created namespaces that is not accurate for their target environment.
This PR resolves this issue by ensuring that whenever the CLI requests a list of pre-created namespaces, it passes the relevant clusterId ID. The backend API can then use this ID to evaluate cluster-specific feature flags and return a precise, filtered list of pre-created namespaces that are actually available for that cluster.

🎟 Issue(s)

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

🧪 Functional Testing

Locally
Unit tests

📸 Screenshots

Screenshot 2025-08-04 at 3 36 31 PM Screenshot 2025-08-04 at 4 46 45 PM Screenshot 2025-08-04 at 4 46 55 PM

📋 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

@rujhan-arora-astronomer
Copy link
Contributor Author

@neel-astro I think the CodeOwners file is correct, but it didn't tag the mentioned folks. Do I need to change something?

@jeremybeard
Copy link
Contributor

@rujhan-arora-astronomer It won't apply until the codeowners change is merged

deploymentCreateExample = `
# Create new deployment with Celery executor (default: celery without params).
$ astro deployment create --label=new-deployment-name --executor=celery
$ astro deployment create --label=new-deployment-name --executor=celery --cluster-id=123(mandatory for Software release 1.0.0 and above)
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need to put them on brackets ??

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They don't need to add in brackets. Where do you see it?

Choose a reason for hiding this comment

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

I think what Vishnu is saying that in the cli, you see (mandatory for Software release 1.0.0 and above) in the examples section of the command. Do we need it there? We can add this information (cluster ID is mandatory) in the helper of this command.

Copy link
Contributor

Choose a reason for hiding this comment

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

since the cli itself makes the field as required explicity adding in the command examples might not make sense

Comment on lines 176 to 179
if houstonVersion >= "1.0.0" {
cmd.Flags().StringVarP(&clusterID, "cluster-id", "", "", "Set cluster ID to create deployment in (mandatory for Software release 1.0.0 and above)")
_ = cmd.MarkFlagRequired("cluster-id")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

with this if we set a clusterId and any create deployment we initiate it will use the set clusterId right

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this clusterId will be used for that create call

Copy link
Contributor

Choose a reason for hiding this comment

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

do workspace admin will able to make this call like set clusterId

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Anyone can pass the cluster ID in this command. We don't have RBACs at the CLI level.

Copy link

@karankhanchandani karankhanchandani left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. LGTM. Can you please resolve the conversations before merging?

@rujhan-arora-astronomer
Copy link
Contributor Author

Screenshot 2025-08-11 at 9 25 31 PM

@rujhan-arora-astronomer rujhan-arora-astronomer merged commit 8d1570c into gh_7572 Aug 11, 2025
3 of 4 checks passed
@rujhan-arora-astronomer rujhan-arora-astronomer deleted the gh_7590 branch August 11, 2025 16:24
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.

4 participants