Kubebuilder: delete api command line

Created on 31 Jul 2019  路  16Comments  路  Source: kubernetes-sigs/kubebuilder

/kind feature

We need to delete CRD kubebuilder delete api --group infra --version v1 --kind Router

kinfeature lifecyclrotten prioritbacklog

All 16 comments

/assign

It's a lot harder to safely delete things than it is to create them, so I'd like to have a more concrete usecase for this first.

I define a CRD called Subnet, but I think Bridge is more suitable锛宻o I want to delete the old one. But I don't know-how

It caused my code not clean...

right, but it's hard for kubebuilder to know if you've added or modified anything else in the meantime, especially in shared files. Are there cases where git revert or something similar aren't sufficient?

It's a lot harder to safely delete things than it is to create them, so I'd like to have a more concrete usecase for this first.

If you

  • [ ] Delete the api/VERSION/KIND_types.go
  • [ ] Regenerate the api/VERSION/zz_generated.deepcopy.go
  • [ ] Delete the controllers/KIND_controller.go
  • [ ] Remove the corresponding test from controller/suite_test.go
  • [ ] Remove the import, init and setup from main.go
  • [ ] Remove the resources corresponding element from PROJECT

wouldn't you completely delete the API? Only api/VERSION/KIND_types.go and controllers/KIND_controller.go are expected to be modified by the user and those files would be deleted completely. The rest of the files are not expected to be modified, and changing them may mean that kubebuilder create API ... is unable to finish.

people can happily add common types to either of those files, split things off into multiple files, etc afterwards. Scaffolding is a starting point.

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

Hi @DirectXMan12,

By following your comments here shows that we should not move forward with. Am I right? If yes, could we close this one as not accepted/deferred?

Please, let me know if we should try to address this request.

It's a lot harder to safely delete things than it is to create them, so I'd like to have a more concrete usecase for this first.

If you

  • [ ] Delete the api/VERSION/KIND_types.go
  • [ ] Regenerate the api/VERSION/zz_generated.deepcopy.go
  • [ ] Delete the controllers/KIND_controller.go
  • [ ] Remove the corresponding test from controller/suite_test.go
  • [ ] Remove the import, init and setup from main.go
  • [ ] Remove the resources corresponding element from PROJECT

wouldn't you completely delete the API? Only api/VERSION/KIND_types.go and controllers/KIND_controller.go are expected to be modified by the user and those files would be deleted completely. The rest of the files are not expected to be modified, and changing them may mean that kubebuilder create API ... is unable to finish.

It's actually a lot more involved than this, there are a bunch of Kustomize scripts to clean up and more. I guess it's ok as Kubebuilder is mostly a toy tool.

It's actually a lot more involved than this, there are a bunch of Kustomize scripts to clean up and more. I guess it's ok as Kubebuilder is mostly a toy tool.

@ryanzhang-oss you are right that there are more files involved. But toy tool does not describe kubebuilder. It is an scaffolder, it is not a full code generator but an squeleton generator for you to shape to your needs.

It is an scaffolder, it is not a full code generator but an squeleton generator for you to shape to your needs.

Can you imagine using a scaffolding tool that generates tons of human unfriendly files in your production environment that you know every resource you created can't be easily removed later? Not sure what else can I call such a tool, a POC?

@ryanzhang-oss kubebuilder solved many problems but not all, it let us more efficiency锛宎 toy tool is inappropriate I think. But we really hope kubebuilder better.

So, I'm sympathetic with the "I don't know which kustomize files to delete" argument. Those are a bit easier to remove. We can perhaps try to find some way to make that easier. However, under our current setup, undoing code changes is not particularly feasible. Perhaps this'll change in the future. For now, please try not to be antagonistic.

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Was this page helpful?
0 / 5 - 0 ratings