Skip to content

use setControllerReference #3944

Closed Answered by camilamacedo86
Jerry-yz asked this question in Support
Discussion options

You must be logged in to vote

Kubebuilder provides a plugin that scaffolds the codebase to manage and deploy an image on the cluster. For more details, see the deploy image plugin documentation. By checking the testdata dir in the root directory of Kubebilder, you will find various examples. Then, examining the controller scaffolded within this plugin will provide code examples and links to the relevant documentation. See this example.

To understand the ownerRef, check: https://kubernetes.io/docs/tasks/administer-cluster/use-cascading-deletion/

By usingcontrollerutil.SetControllerReference() it will set that the CRD ownerRef to the StatefulSet. So, I would suggest you check:

  • How are you deleting. If the CRD is manual…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by camilamacedo86
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Support
Labels
None yet
2 participants