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

delete api command line #907

Open
fanux opened this issue Jul 31, 2019 · 22 comments
Open

delete api command line #907

fanux opened this issue Jul 31, 2019 · 22 comments
Assignees
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/backlog Higher priority than priority/awaiting-more-evidence.

Comments

@fanux
Copy link

fanux commented Jul 31, 2019

/kind feature

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

@fanux fanux added the kind/feature Categorizes issue or PR as related to a new feature. label Jul 31, 2019
@droot droot added the priority/backlog Higher priority than priority/awaiting-more-evidence. label Aug 1, 2019
@hpandeycodeit
Copy link

/assign

@DirectXMan12
Copy link
Contributor

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.

@fanux
Copy link
Author

fanux commented Aug 6, 2019

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

It caused my code not clean...

@DirectXMan12
Copy link
Contributor

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?

@Adirio
Copy link
Contributor

Adirio commented Oct 21, 2019

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.

@DirectXMan12
Copy link
Contributor

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

@fejta-bot
Copy link

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

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 4, 2020
@camilamacedo86
Copy link
Member

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.

@ryanzhang-oss
Copy link

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.

@Adirio
Copy link
Contributor

Adirio commented Mar 5, 2020

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.

@ryanzhang-oss
Copy link

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?

@fanux
Copy link
Author

fanux commented Mar 7, 2020

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

@DirectXMan12
Copy link
Contributor

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.

@fejta-bot
Copy link

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

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Apr 13, 2020
@fejta-bot
Copy link

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

@k8s-ci-robot
Copy link
Contributor

@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.

@pbxqdown
Copy link

pbxqdown commented Jan 7, 2022

Maybe some detailed documents can at least make it easier for people to delete an generated API manually.

@ryanzhang-oss
Copy link

ryanzhang-oss commented Jan 8, 2022 via email

@ShavaShav
Copy link

Is there still no way to delete a CRD?

@cesarandr
Copy link

Would also need a feature like this or at least some documentation on what to delete manually.
Is one of those things available at this time?

@meter-peter
Copy link

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.

Indeed kubebuilder create API is unable to finish. The problem is solved by adding --force

@camilamacedo86 camilamacedo86 added the lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. label May 13, 2024
@camilamacedo86 camilamacedo86 removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label May 13, 2024
@camilamacedo86
Copy link
Member

camilamacedo86 commented May 13, 2024

I think it would be nice we add delete commands for all interfaces and not only create api one
We can easily just warning when is not possible revert/delete something if that is the case so users a aware of.
+1 for this I think we can plan those changes

It might be a nice good first issue for who is looking for something within a L size and already pushed a couple of PRs.

Following the details

@camilamacedo86 camilamacedo86 added help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. labels May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
Development

No branches or pull requests