StatefulSet: Always set BlockOwnerDeletion in ControllerRef.

This commit is contained in:
Anthony Yeh
2017-03-02 10:26:30 -08:00
parent 2248187536
commit 6679a5a31f

View File

@@ -233,13 +233,15 @@ func isHealthy(pod *v1.Pod) bool {
// newControllerRef returns an ControllerRef pointing to a given StatefulSet.
func newControllerRef(set *apps.StatefulSet) *metav1.OwnerReference {
blockOwnerDeletion := true
isController := true
return &metav1.OwnerReference{
APIVersion: controllerKind.GroupVersion().String(),
Kind: controllerKind.Kind,
Name: set.Name,
UID: set.UID,
Controller: &isController,
APIVersion: controllerKind.GroupVersion().String(),
Kind: controllerKind.Kind,
Name: set.Name,
UID: set.UID,
BlockOwnerDeletion: &blockOwnerDeletion,
Controller: &isController,
}
}