Skip to content
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

Merged
merged 1 commit into from
May 18, 2024

Conversation

sp98
Copy link
Contributor

@sp98 sp98 commented May 17, 2024

Removed owner reference from Radosnamespace and
subVolumeGroup cleanup resources.

Resolves #14233

Checklist:

  • Commit Message Formatting: Commit titles and messages follow guidelines in the developer guide.
  • Reviewed the developer guide on Submitting a Pull Request
  • Pending release notes updated with breaking and/or notable changes for the next minor release.
  • Documentation has been updated, if necessary.
  • Unit tests have been added, if necessary.
  • Integration tests have been added, if necessary.

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(),
Copy link
Contributor Author

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.

Copy link
Member

@travisn travisn left a 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.

@sp98
Copy link
Contributor Author

sp98 commented May 18, 2024

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.

@travisn travisn merged commit 2555e51 into rook:master May 18, 2024
52 of 53 checks passed
travisn added a commit that referenced this pull request May 30, 2024
core: remove owner refs in resource cleanup jobs (backport #14234)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failed to start clean up jobs for SubvolumeGroup and Radosnamespace resource
2 participants