Unverified Commit fa834d9a authored by Travis Nielsen's avatar Travis Nielsen
Browse files

nfs: set correct owner reference name for garbage collection


The owner reference for the NFS custom resource was using the namespace
instead of the name. This causes the k8s garbage collector to remove the
nfs resources in some scenarios such as restarting etcd.
Signed-off-by: default avatarTravis Nielsen <tnielsen@redhat.com>
Showing with 3 additions and 3 deletions
+3 -3
......@@ -101,16 +101,16 @@ func newNfsServer(c *nfsv1alpha1.NFSServer, context *clusterd.Context) *nfsServe
context: context,
namespace: c.Namespace,
spec: c.Spec,
ownerRef: nfsOwnerRef(c.Namespace, string(c.UID)),
ownerRef: nfsOwnerRef(c.Name, string(c.UID)),
}
}
func nfsOwnerRef(namespace, nfsServerID string) metav1.OwnerReference {
func nfsOwnerRef(name, nfsServerID string) metav1.OwnerReference {
blockOwner := true
return metav1.OwnerReference{
APIVersion: fmt.Sprintf("%s/%s", NFSResource.Group, NFSResource.Version),
Kind: NFSResource.Kind,
Name: namespace,
Name: name,
UID: types.UID(nfsServerID),
BlockOwnerDeletion: &blockOwner,
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment