Skip to content

add finalizer directly to the GPUCluster manifest#2673

Closed
tariq1890 wants to merge 1 commit into
mainfrom
add-finalizer-to-manifest
Closed

add finalizer directly to the GPUCluster manifest#2673
tariq1890 wants to merge 1 commit into
mainfrom
add-finalizer-to-manifest

Conversation

@tariq1890

Copy link
Copy Markdown
Contributor

This PR adds the finaliser inline to the GPUCluster resource manifests. This is done for readability reasons and it also shaves off an kube client UPDATE call

@tariq1890
tariq1890 force-pushed the add-finalizer-to-manifest branch 2 times, most recently from 93d90be to 758abd2 Compare July 24, 2026 18:07
@coveralls

coveralls commented Jul 24, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 33.481%. remained the same — add-finalizer-to-manifest into main

if !instance.DeletionTimestamp.IsZero() {
return r.reconcileDelete(ctx, instance)
}
if !controllerutil.ContainsFinalizer(instance, gpuClusterFinalizer) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If a user doesn't specify finalizer by default, we should add it. So we should keep this logic as it is and just add finalizer by default in our templates.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that's fair. I was thinking about this just after pushing the commit

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Addressed your comment. Please check now

Signed-off-by: Tariq Ibrahim <tibrahim@nvidia.com>
@tariq1890
tariq1890 force-pushed the add-finalizer-to-manifest branch from 758abd2 to dc6ebca Compare July 24, 2026 18:47
"name": "gpu-cluster"
"name": "gpu-cluster",
"finalizers": [
"gpucluster.nvidia.com/dra-resourceclaim"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is somewhat of a behavior change. We're pre-adding the finalizer instead of adding it after the operator's first reconcile. If the operator never comes up during helm install, you cannot delete this CR without manually removing the finalizer. I'd rather have one way to add and remove the finalizer. Not a strong opinion, but I'm not entirely sure this change is worth it.

This also means we need to maintain this finalizer in multiple places instead of a single constant in the controller.

@rahulait

Copy link
Copy Markdown
Contributor

I agree with @rajathagasthya here. If we are testing things with DRA and operator fails to come up, cleaning of gpucluster resource would require manually removing the finalizer, which is not great.

@tariq1890

Copy link
Copy Markdown
Contributor Author

Thanks for the reviews. I agree with the comments. Closing...

@tariq1890 tariq1890 closed this Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants