Skip to content

Commit 34e8d32

Browse files
committed
Skip Proxy update test on HyperShift cluster
Signed-off-by: chiragkyal <ckyal@redhat.com>
1 parent ef7e84c commit 34e8d32

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

test/e2e/trustmanager_test.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -828,6 +828,15 @@ var _ = Describe("TrustManager", Ordered, Label("Platform:Generic", "Feature:Tru
828828
const openshiftConfigNS = "openshift-config"
829829
const userCABundleName = "user-ca-bundle"
830830

831+
By("checking if Proxy/cluster is writable (skipped on HyperShift/HostedCluster)")
832+
proxy, err := configClient.Proxies().Get(ctx, "cluster", metav1.GetOptions{})
833+
Expect(err).ShouldNot(HaveOccurred())
834+
_, err = configClient.Proxies().Update(ctx, proxy, metav1.UpdateOptions{DryRun: []string{metav1.DryRunAll}})
835+
if apierrors.IsForbidden(err) || apierrors.IsInvalid(err) {
836+
Skip("Proxy/cluster is immutable on this cluster (likely HyperShift): " + err.Error())
837+
}
838+
Expect(err).ShouldNot(HaveOccurred())
839+
831840
createTrustManager(ctx, newTrustManagerCR().WithDefaultCAPackage(v1alpha1.DefaultCAPackagePolicyEnabled))
832841

833842
// --- Capture baseline state ---
@@ -862,7 +871,7 @@ var _ = Describe("TrustManager", Ordered, Label("Platform:Generic", "Feature:Tru
862871
// --- Save original Proxy and user-ca-bundle state for cleanup ---
863872

864873
By("saving original Proxy trustedCA and user-ca-bundle state")
865-
proxy, err := configClient.Proxies().Get(ctx, "cluster", metav1.GetOptions{})
874+
proxy, err = configClient.Proxies().Get(ctx, "cluster", metav1.GetOptions{})
866875
Expect(err).ShouldNot(HaveOccurred())
867876
originalTrustedCAName := proxy.Spec.TrustedCA.Name
868877

0 commit comments

Comments
 (0)