-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
core: remove owner refs in resource cleanup jobs #14234
Conversation
Removed owner reference from Radosnamespace and subVolumeGroup cleanup resources. Signed-off-by: sp98 <sapillai@redhat.com>
@@ -69,9 +69,8 @@ func (c *ResourceCleanup) StartJob(ctx context.Context, clientset kubernetes.Int | |||
podSpec := c.jobTemplateSpec() | |||
job := &batch.Job{ | |||
ObjectMeta: metav1.ObjectMeta{ | |||
Name: jobName, | |||
Namespace: c.resource.GetNamespace(), | |||
OwnerReferences: c.resource.GetOwnerReferences(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@travisn Removing this ownerReference fixes the issue and jobs can start. Tested this on an OCP cluster. Currently, I'm not sure if there are alternate way to fix using the RBAC. But this should be good to unblock testing of this feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without an owner reference, the jobs would typically only be deleted if either explicitly deleted by the user, or if the namespace is deleted. Or is there some other cleanup mechanism in this scenario? It's not critical, just want to know if it's expected to remove the jobs.
Correct. Without this owner reference, the jobs won't be removed when the svg or rns resource gets deleted. User has delete is explicitly. No other cleanup mechanism as of now. Unremoved completed jobs should be an issue in this case. Need to look into this more if there is a better solution for this. |
core: remove owner refs in resource cleanup jobs (backport #14234)
Removed owner reference from Radosnamespace and
subVolumeGroup cleanup resources.
Resolves #14233
Checklist: