Skip to content

Conversation

@barkbay
Copy link
Contributor

@barkbay barkbay commented Oct 7, 2019

Fix #1884

@barkbay barkbay added the >bug Something isn't working label Oct 7, 2019
// See https://github.com/elastic/cloud-on-k8s/issues/1884
refs := claim.OwnerReferences
for i := range refs {
refs[i].BlockOwnerDeletion = &f
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is potentially changing other owner references as well? I would have expected you to only change the one we set here. I don't think it matters much, I was just wondering if you had a reason for it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure in which cases we may have several owner references in the template, but my guess is that as long as there is at least one BlockOwnerDeletion set to true then the creation will fail.
So we must take care of all the owner references ?

if err := controllerutil.SetControllerReference(&es, &claim, scheme); err != nil {
return nil, err
}
// Set block owner deletion to false as the statefulset controller might not be able to do that
Copy link
Collaborator

Choose a reason for hiding this comment

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

to do that

Maybe needs half a sentence more. IIUC the statefulset controller cannot handle an owner reference with blockOwnerDeletion:true if it cannot set finalizers on the owning resource

@barkbay barkbay merged commit 6465bd1 into elastic:master Oct 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>bug Something isn't working v1.0.0-beta1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Openshift: Statefulset can't set owner on a PVC

3 participants