[ocp4_workload_nvidia_gpu_operator] Fix ClusterPolicy CRD race condition#21
Merged
Conversation
…applying The install_operator role considers installation complete when the CSV reaches Succeeded state. However, the NVIDIA GPU Operator registers its ClusterPolicy CRD after the CSV succeeds, causing a race condition where the ClusterPolicy task fails to resolve nvidia.com/v1.ClusterPolicy. Add an explicit wait for clusterpolicies.nvidia.com CRD availability (30 retries x 10s = 5 min) before applying the ClusterPolicy resource.
wkulhanek
approved these changes
Mar 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Setup NVIDIA GPU Cluster Policytask fails because theclusterpolicies.nvidia.comCRD isn't registered yet when the task runsclusterpolicies.nvidia.comCRD availability before applying theClusterPolicyresourceFailed to find exact match for nvidia.com/v1.ClusterPolicyerrors in deployments where operator initialization is slowRoot Cause
The
install_operatorrole waits for the CSV to reachSucceededstate. However, the NVIDIA GPU Operator registers itsClusterPolicyCRD after the CSV transitions to Succeeded — observed to be ~2 minutes later. Wheninstall_operator_install_csv_ignore_erroristrueand the CSV wait times out, the gap is even larger.This left the
Setup NVIDIA GPU Cluster Policytask attempting to apply a resource whose CRD didn't exist in the API server yet.Changes
roles/ocp4_workload_nvidia_gpu_operator/tasks/workload.ymlWait for NVIDIA GPU Operator ClusterPolicy CRD to be availabletask between the operator install andClusterPolicycreationapiextensions.k8s.io/v1/CustomResourceDefinition/clusterpolicies.nvidia.comwith 30 retries × 10s delay (5 min total)Test plan
openshift-ai-v3-awsCI and verify theSetup NVIDIA GPU Cluster Policytask succeeds without the CRD resolution error