Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 deletions test/e2e/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -2058,25 +2058,40 @@ func EnsureGlobalPullSecret(t *testing.T, ctx context.Context, mgmtClient crclie
mgmtSecret.Data[corev1.DockerConfigJsonKey] = modifiedData
g.Expect(mgmtClient.Update(ctx, mgmtSecret)).To(Succeed(), "failed to update management-cluster pull secret")

// Wait for openshift-config/pull-secret in the guest cluster to pick up the change
// Wait for openshift-config/pull-secret in the guest cluster to pick up the change.
// Propagation path: mgmt Secret → HO syncs to CP namespace → HCCO reconciles to guest.
// Log each stage so failures can be triaged (OCPBUGS-98465).
cpNamespace := manifests.HostedControlPlaneNamespace(entryHostedCluster.Namespace, entryHostedCluster.Name)
t.Log("Waiting for openshift-config/pull-secret to update in guest cluster")
g.Eventually(func() bool {
secret := &corev1.Secret{}
if err := guestClient.Get(ctx, crclient.ObjectKey{Name: "pull-secret", Namespace: "openshift-config"}, secret); err != nil {
// Stage 1: check if HO synced the pull secret to the CP namespace
cpSecret := &corev1.Secret{}
if err := mgmtClient.Get(ctx, crclient.ObjectKey{Name: "pull-secret", Namespace: cpNamespace}, cpSecret); err != nil {
t.Logf("CP namespace pull-secret not readable: %v", err)
} else {
cpHasDummy := bytes.Contains(cpSecret.Data[corev1.DockerConfigJsonKey], []byte("e2e-dummy.example.com"))
t.Logf("CP namespace %s/pull-secret has dummy entry: %v", cpNamespace, cpHasDummy)
}

// Stage 2: check if HCCO propagated to the guest cluster
guestSecret := &corev1.Secret{}
if err := guestClient.Get(ctx, crclient.ObjectKey{Name: "pull-secret", Namespace: "openshift-config"}, guestSecret); err != nil {
t.Logf("guest openshift-config/pull-secret not readable: %v", err)
return false
}
return bytes.Contains(secret.Data[corev1.DockerConfigJsonKey], []byte("e2e-dummy.example.com"))
}, 150*time.Second, 5*time.Second).Should(BeTrue(), "openshift-config/pull-secret did not propagate dummy entry")
return bytes.Contains(guestSecret.Data[corev1.DockerConfigJsonKey], []byte("e2e-dummy.example.com"))
}, 5*time.Minute, 10*time.Second).Should(BeTrue(), "openshift-config/pull-secret did not propagate dummy entry")

// Wait for kube-system/original-pull-secret to pick up the change (globalps controller path)
t.Log("Waiting for kube-system/original-pull-secret to update in guest cluster")
g.Eventually(func() bool {
secret := hccomanifests.OriginalPullSecret()
if err := guestClient.Get(ctx, crclient.ObjectKey{Name: secret.Name, Namespace: secret.Namespace}, secret); err != nil {
t.Logf("guest kube-system/original-pull-secret not readable: %v", err)
return false
}
return bytes.Contains(secret.Data[corev1.DockerConfigJsonKey], []byte("e2e-dummy.example.com"))
}, 150*time.Second, 5*time.Second).Should(BeTrue(), "kube-system/original-pull-secret did not propagate dummy entry")
}, 5*time.Minute, 10*time.Second).Should(BeTrue(), "kube-system/original-pull-secret did not propagate dummy entry")

// Verify no NodePool rollout was triggered
t.Log("Verifying no NodePool rollout was triggered")
Expand Down