-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Add Agent conformance test that uses the global pull secret #31560
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -187,3 +187,51 @@ var _ = g.Describe("[sig-installer][Feature:NoRegistryClusterInstall] Cluster op | |
| }) | ||
| }) | ||
| }) | ||
|
|
||
| var _ = g.Describe("[sig-installer][Feature:NoRegistryClusterInstall] InternalReleaseImage credentials are merged into the global pull secret", func() { | ||
| defer g.GinkgoRecover() | ||
|
|
||
| var oc = exutil.NewCLIWithoutNamespace("no-registry") | ||
| var helper *IRITestHelper | ||
|
|
||
| g.BeforeEach(func() { | ||
| skipIfNoRegistryFeatureUnsupported(oc) | ||
| helper = NewIRITestHelper(oc) | ||
| }) | ||
|
|
||
| g.Context("when the NoRegistryClusterInstall feature is enabled", func() { | ||
| g.It("should allow a workload to pull the release image using the global pull secret [apigroup:machineconfiguration.openshift.io]", func() { | ||
| iri := helper.GetIRI() | ||
| releaseImage := iri.Status.Releases[0].Image | ||
| e2e.Logf("Using OCP release bundle image: %s", releaseImage) | ||
|
|
||
| registryHost := registryHostFromImage(releaseImage) | ||
| e2e.Logf("IRI registry host: %s", registryHost) | ||
|
|
||
| // The MCO template controller merges the IRI registry credentials into the global | ||
| // pull secret (OCPBUGS-85519). Previously these lived only in the kubelet's | ||
| // config.json, so only the kubelet could pull IRI images. | ||
| g.By("Verifying the IRI registry credentials were merged into the global pull secret") | ||
| helper.VerifyGlobalPullSecretHasRegistry(registryHost) | ||
|
|
||
| g.By("Creating test namespace and an image pull secret from the global pull secret") | ||
| ns := helper.CreateSimpleNamespace() | ||
| defer helper.DeleteNamespace(ns) | ||
|
|
||
| pullSecretName := helper.CreateImagePullSecretFromGlobal(ns) | ||
|
|
||
| g.By("Creating a pod that pulls the IRI release image using the global pull secret") | ||
| pod := helper.CreateTestPodWithPullSecret(ns, releaseImage, pullSecretName) | ||
| defer helper.DeleteTestPod(ns, pod.Name) | ||
|
|
||
| g.By("Waiting for the pod to complete successfully") | ||
| err := e2epod.WaitForPodSuccessInNamespace(context.Background(), oc.AdminKubeClient(), pod.Name, ns) | ||
| o.Expect(err).NotTo(o.HaveOccurred(), "Pod should pull the IRI image using the global pull secret and run successfully") | ||
|
|
||
| completedPod, err := oc.AdminKubeClient().CoreV1().Pods(ns).Get(context.Background(), pod.Name, metav1.GetOptions{}) | ||
|
Comment on lines
+228
to
+231
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: printf '%s\n' '--- applicable conventions ---'
for f in /tmp/coderabbit-repo-knowledge/openshift-origin-99a43837/conventions/*.md; do
case "$f" in
*go*|*test*|*extended*) head -80 "$f" ;;
esac
done
printf '%s\n' '--- target symbols and call sites ---'
rg -n -C 4 'context\.Background\(\)|WaitForPodSuccessInNamespace|CoreV1\(\)\.Pods|CoreV1\(\)\.Secrets|func \(.*\)|InternalReleaseImage|Create.*Pod|Create.*Secret' \
test/extended/internalreleaseimage/internalreleaseimage.go \
test/extended/internalreleaseimage/helper.go
printf '%s\n' '--- outlines ---'
ast-grep outline test/extended/internalreleaseimage/internalreleaseimage.go
ast-grep outline test/extended/internalreleaseimage/helper.goRepository: openshift/origin Length of output: 49675 🏁 Script executed: printf '%s\n' '--- test flow and imports ---'
sed -n '1,45p;151,240p' test/extended/internalreleaseimage/internalreleaseimage.go
printf '%s\n' '--- helper implementations ---'
sed -n '1,22p;120,270p' test/extended/internalreleaseimage/helper.go
printf '%s\n' '--- bounded-context patterns in nearby e2e tests ---'
rg -n -C 3 'context\.With(Time|Deadline)|SpecTimeout|NodeTimeout|EventuallyWithOffset|WaitForPodSuccessInNamespace' test/extended -g '*.go' | head -240
printf '%s\n' '--- bound client-go context contract ---'
rg -n -C 3 'func \(.*\) (Get|Create)\(ctx context\.Context|type Interface interface' vendor/k8s.io/client-go/kubernetes/typed/core/v1 vendor/k8s.io/client-go/gentype vendor/k8s.io/apimachinery/pkg/apis/meta/v1 2>/dev/null | head -180Repository: openshift/origin Length of output: 36669 🏁 Script executed: printf '%s\n' '--- pod wait implementation ---'
rg -n -C 8 'func WaitForPodSuccessInNamespace|func WaitForPodSuccessInNamespaceTimeout|PodWaitTimeout' \
vendor/k8s.io/kubernetes/test/e2e/framework/pod vendor/k8s.io/kubernetes/test/e2e/framework
printf '%s\n' '--- request context propagation ---'
sed -n '150,225p' vendor/k8s.io/client-go/gentype/type.go
rg -n -C 6 'func \(.*\) Do\(ctx context\.Context\)|WithContext|Context\(\) context\.Context' \
vendor/k8s.io/client-go/rest vendor/k8s.io/apimachinery/pkg 2>/dev/null | head -180
printf '%s\n' '--- test timeout/context API usage ---'
rg -n -C 4 'g\.It\(.*func\(ctx context\.Context|SpecTimeout|NodeTimeout|context\.WithTimeout\(context\.Background\(\)' \
test/extended/internalreleaseimage test/extended -g '*.go' | head -180Repository: openshift/origin Length of output: 40616 Propagate a bounded context through the pod tests.
📍 Affects 2 files
🤖 Prompt for AI AgentsSource: Path instructions |
||
| o.Expect(err).NotTo(o.HaveOccurred(), "Failed to get completed pod status") | ||
| o.Expect(completedPod.Status.ContainerStatuses).NotTo(o.BeEmpty(), "Pod should have at least one container status") | ||
| e2e.Logf("Workload successfully pulled IRI image using global pull secret (ImageID: %s)", completedPod.Status.ContainerStatuses[0].ImageID) | ||
| }) | ||
| }) | ||
| }) | ||
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.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: openshift/origin
Length of output: 49116
🏁 Script executed:
Repository: openshift/origin
Length of output: 50372
🏁 Script executed:
Repository: openshift/origin
Length of output: 7923
🌐 Web query:
OpenShift Machine Config Operator InternalReleaseImage template controller global pull secret OCPBUGS-85519 reconciliation status💡 Result:
The InternalReleaseImage (IRI) controller in the OpenShift Machine Config Operator (MCO) is responsible for managing internal release bundles on control plane nodes [1][2]. Regarding the interaction with pull secrets, the MCO maintains a mechanism to merge specific authentication credentials—including those for the IRI registry—into the global pull secret [3]. The IRI registry utilizes
htpasswdfor authentication, using theopenshiftusername and a password stored in theinternal-release-image-registry-authsecret [3][4]. The MCO operator-side logic, specifically within the IRI controller and supporting pull secret modules, monitors this authentication secret and merges its contents into the cluster-wide global pull secret [3]. This ensures that the kubelet on nodes can authenticate to the IRI registry when pulling the required release images [3]. The specific reference OCPBUGS-85519 does not appear in public OpenShift bug tracker records or MCO repository logs as a standard bug identifier for this controller. Publicly available tracking for the InternalReleaseImage controller is primarily managed under AGENT-series Jira issues (e.g., AGENT-1326, AGENT-1449, AGENT-1522) [1][3][5]. If you are working within a private environment, OCPBUGS-85519 may refer to a specific internal ticket concerning the reconciliation status or template generation logic for these merged pull secrets. For verification of reconciliation status in such a case, you should check the status of theInternalReleaseImagecustom resource (e.g.,oc get internalreleaseimage -n openshift-machine-config-operator) and ensure the MCO pods are not reporting degraded conditions [5].Citations:
🌐 Web query:
github openshift machine-config-operator PR 5765 pull secret InternalReleaseImage template controller💡 Result:
There is no publicly available pull request numbered 5765 in the openshift/machine-config-operator repository as of August 25, 2026 [1][2]. Regarding the technical components mentioned in your query: InternalReleaseImage Controller: This was introduced to the Machine Config Operator (MCO) to manage InternalReleaseImage resources [3]. It includes support for template generation during cluster installation [3] and registry authentication [4]. Subsequent updates, such as PR
#5483, integrated TLS certificate support for the InternalReleaseImage registry [5]. Pull Secrets: The MCO manages pull secrets by syncing the cluster-wide pull secret (typically located in the openshift-config namespace) and ensuring it is available on nodes [4][6]. The TemplateController is responsible for utilizing this pull secret to generate the necessary MachineConfig templates [6]. If you have a specific reference for PR 5765, it may be in a private repository, have been deleted, or the number might be incorrect. You can verify the current list of pull requests directly on the repository's GitHub page [1].Citations:
🌐 Web query:
github openshift machine-config-operator InternalReleaseImage global pull secret controller code💡 Result:
In the OpenShift Machine Config Operator (MCO), the InternalReleaseImage (IRI) registry requires authentication to manage release bundles. The integration of IRI registry credentials with the global pull secret is a multi-step process involving both the OpenShift installer and the MCO [1][2]. 1. Bootstrap Generation: The installer generates a random password and an htpasswd entry for the IRI registry [2]. These credentials are stored in the internal-release-image-registry-auth secret within the openshift-machine-config-operator namespace [1][2]. 2. Secret Merging Logic: The MCO controller is responsible for merging these IRI-specific credentials into the cluster's global pull secret (typically located at openshift-config/pull-secret) [1][2]. This is primarily handled within the InternalReleaseImage controller [1]. 3. Code Components: - Controller Logic: The controller watches the InternalReleaseImageAuthSecretName (defined as internal-release-image-registry-auth) [1][3]. It reads this secret, threads the credentials into its rendering process, and utilizes a merge function (such as MergeIRIAuthIntoPullSecret) to integrate them into the dockerconfigjson format [1]. - Implementation: The core logic for this operation resides in packages such as pkg/controller/internalreleaseimage/internalreleaseimage_controller.go and pkg/controller/internalreleaseimage/pullsecret.go [1]. These files handle the synchronization, validation, and merging of the registry authentication data to ensure that kubelet and CRI-O can authenticate when pulling images from the IRI registry at its default port (22625) [1][4]. 4. Global Pull Secret Handling: The MCO generally manages the global pull secret by templating it out to nodes, ensuring that the merged secret (containing both original global credentials and the IRI registry auth) is available to the runtime on the host [5][6]. Recent updates have also introduced mechanisms to clone the global pull secret into the MCO namespace for internal management and to support specific operational requirements [7].
Citations:
🏁 Script executed:
Repository: openshift/origin
Length of output: 9462
🏁 Script executed:
Repository: openshift/origin
Length of output: 50372
🏁 Script executed:
Repository: openshift/origin
Length of output: 20291
🏁 Script executed:
Repository: openshift/origin
Length of output: 8691
Remove the global pull-secret assertion.
The template controller merges IRI credentials into rendered MachineConfigs. It does not update
openshift-config/pull-secret. Waiting cannot makeVerifyGlobalPullSecretHasRegistrypass. Assert the credentials in the rendered MachineConfig instead.🤖 Prompt for AI Agents