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

Add CRUD support for spaces groups #466

Merged
merged 3 commits into from
Apr 18, 2024

Conversation

RedbackThomson
Copy link
Member

@RedbackThomson RedbackThomson commented Apr 16, 2024

Description of your changes

Rebased on top of #457

Add support for up group create/list/get/delete using the selected spaces kubeconfig.

I have:

  • Read and followed Upbound's contribution process.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR, as appropriate.

How has this code been tested

$ go run ./cmd/up group list
NAME   PROTECTED

$ go run ./cmd/up group create nick-unprotected
nick-unprotected created
$ go run ./cmd/up group create nick-protected --deletion-protection
nick-protected created
$ go run ./cmd/up group list
NAME               PROTECTED
nick-protected     true
nick-unprotected   false

$ go run ./cmd/up group get nick-protected
NAME             PROTECTED
nick-protected   true

$ go run ./cmd/up group delete nick-protected
up: error: group.deleteCmd.Run(): Deletion protection is enabled on the specified group. Use '--force' to delete anyway.
exit status 1
$ go run ./cmd/up group delete nick-protected --force
nick-protected deleted
$ go run ./cmd/up group delete nick-unprotected
nick-unprotected deleted

@RedbackThomson RedbackThomson changed the title Group crud Add CRUD support for spaces groups Apr 16, 2024
Get getCmd `cmd:"" help:"Get a group."`

Short bool `short:"s" env:"UP_SHORT" name:"short" help:"Short output."`
KubeContext string `env:"UP_CONTEXT" default:"upbound" name:"context" help:"Kubernetes context to operate on."`
Copy link
Contributor

Choose a reason for hiding this comment

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

is this one used?

I think we have to uniformely wire this through into GetCurrentContext(ctx).

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe also an idea, as we get more and more CRUD commands, we could create some common set of flags for CRUD.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually neither of these other CLI args are used - I was just looking over that myself. What is the purpose of this arg, anyway? Just another way to override the current context of the kubeconfig?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, another way to override the kubeconfig/context.

cmd/up/group/delete.go Outdated Show resolved Hide resolved
@RedbackThomson RedbackThomson merged commit f5a4c2f into upbound:main Apr 18, 2024
6 checks passed
@RedbackThomson RedbackThomson deleted the group-crud branch April 18, 2024 19:46
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.

None yet

2 participants