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: iam destroy #946

Merged
merged 69 commits into from
Feb 24, 2023
Merged

cli: iam destroy #946

merged 69 commits into from
Feb 24, 2023

Conversation

miampf
Copy link
Contributor

@miampf miampf commented Jan 11, 2023

Proposed change(s)

  • Add the new iam destroy subcommand to destroy IAM configuration with the Constellation CLI
  • Rename the DestroyCluster function in terraform.go to Destroy

This change will allow users to delete their IAM configurations using the constellation CLI instead of the terraform CLI.

Checklist

  • Update docs
  • Add labels (e.g., for changelog category)
  • Link to Milestone

@CLAassistant
Copy link

CLAassistant commented Jan 11, 2023

CLA assistant check
All committers have signed the CLA.

@netlify
Copy link

netlify bot commented Jan 11, 2023

Deploy Preview for constellation-docs canceled.

Name Link
🔨 Latest commit 82c0eaa
🔍 Latest deploy log https://app.netlify.com/sites/constellation-docs/deploys/63f888be169bb50008e1b25f

@miampf miampf added the feature This introduces new functionality label Jan 18, 2023
@miampf miampf added this to the v.2.5.0 milestone Jan 18, 2023
@3u13r 3u13r modified the milestones: v.2.5.0, v2.6.0 Jan 23, 2023
@miampf miampf marked this pull request as ready for review January 27, 2023 17:10
cli/internal/cloudcmd/iam.go Outdated Show resolved Hide resolved
cli/internal/cloudcmd/iam.go Outdated Show resolved Hide resolved
cli/internal/cmd/iamdestroy.go Outdated Show resolved Hide resolved
cli/internal/cmd/iamdestroy.go Outdated Show resolved Hide resolved
cli/internal/cmd/iamdestroy.go Outdated Show resolved Hide resolved
cli/internal/terraform/terraform.go Outdated Show resolved Hide resolved
cli/internal/cmd/iam.go Outdated Show resolved Hide resolved
cli/internal/cmd/iamcreateaws.go Outdated Show resolved Hide resolved
cli/internal/cmd/iamcreateazure.go Outdated Show resolved Hide resolved
cli/internal/cmd/iamcreategcp.go Outdated Show resolved Hide resolved
cli/internal/cmd/iamdestroy.go Outdated Show resolved Hide resolved
cli/internal/cmd/iamdestroy.go Show resolved Hide resolved
cli/internal/cmd/iamdestroy.go Outdated Show resolved Hide resolved
docs/docs/workflows/config.md Outdated Show resolved Hide resolved
Copy link
Member

@katexochen katexochen left a comment

Choose a reason for hiding this comment

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

Some things left to do:

  • Check if there is a running cluster. We should ensure that we call constellation terminate before we allow a IAM destroy. You can use the files that are deleted in cmd/terminate.go as indicator.
  • Only ask user once for confirmation. We should check for the gcpServiceAccountKey before asking the user for confirmation, and state that the file will be deleted there.
  • We should add some debug output like the other commands have.
  • Deletion of the gcpKey file can be done directly in the cmd package, no need to have a method for that in cloudcmd. Maybe make the cloudcmd func return the gcpKey directly

cli/internal/cmd/iamdestroy.go Outdated Show resolved Hide resolved
cli/internal/cmd/iamdestroy.go Outdated Show resolved Hide resolved
cli/internal/cmd/iamdestroy.go Outdated Show resolved Hide resolved
cli/internal/cmd/iamdestroy.go Outdated Show resolved Hide resolved
cli/internal/cmd/iamdestroy_test.go Outdated Show resolved Hide resolved
cli/internal/cmd/iamdestroy_test.go Outdated Show resolved Hide resolved
cli/internal/cmd/cloud_test.go Show resolved Hide resolved
@thomasten thomasten closed this Jan 30, 2023
@thomasten thomasten reopened this Jan 30, 2023
@katexochen katexochen self-assigned this Feb 1, 2023
Copy link
Member

@daniel-weisse daniel-weisse left a comment

Choose a reason for hiding this comment

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

Looks good to me

Just a heads up: cli/internal/cmd/iam.go has undergone some changes (mainly the removal of createiam<CSP>.go files so there will be merge conflicts

@katexochen katexochen mentioned this pull request Feb 6, 2023
2 tasks
cli/internal/cloudcmd/iam.go Outdated Show resolved Hide resolved
cli/internal/cloudcmd/iam.go Outdated Show resolved Hide resolved
cli/internal/cloudcmd/iam.go Outdated Show resolved Hide resolved
cli/internal/cloudcmd/iam.go Outdated Show resolved Hide resolved
cli/internal/cloudcmd/iam.go Outdated Show resolved Hide resolved
cli/internal/cmd/iamdestroy.go Outdated Show resolved Hide resolved
cli/internal/cmd/iamdestroy.go Outdated Show resolved Hide resolved
cli/internal/cmd/iamdestroy_test.go Outdated Show resolved Hide resolved
cli/internal/cmd/iamdestroy_test.go Outdated Show resolved Hide resolved
cli/internal/cmd/iamdestroy_test.go Show resolved Hide resolved
@katexochen
Copy link
Member

Please rebase before working on the changes requested. 🐳

Copy link
Member

@katexochen katexochen left a comment

Choose a reason for hiding this comment

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

lgtm! 🐳

@miampf miampf merged commit 5137e9f into main Feb 24, 2023
@miampf miampf deleted the feat/iam-destroy-user branch February 24, 2023 10:36
miampf added a commit that referenced this pull request Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This introduces new functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants