|
|
@@ -236,12 +236,11 @@ func ClusterProviderPushAllowsRemoteNamespaceOverride(f *framework.Framework, ha
|
|
|
Name: "push-remote-override",
|
|
|
AuthScope: esv1.AuthenticationScopeManifestNamespace,
|
|
|
})
|
|
|
- Expect(runtime).NotTo(BeNil(), "cluster provider push harness returned nil runtime")
|
|
|
+ applyClusterProviderPushSecret(tc, runtime, "push-remote-override-remote")
|
|
|
if !runtime.SupportsRemoteNamespaceOverrides() {
|
|
|
Skip(fmt.Sprintf("provider %q does not support remote namespace override hooks", runtime.ClusterProviderName))
|
|
|
}
|
|
|
overrideNamespace := runtime.CreateWritableRemoteScope("push-remote-override-target")
|
|
|
- applyClusterProviderPushSecret(tc, runtime, "push-remote-override-remote")
|
|
|
tc.PushSecret.Spec.Data[0].Metadata = pushSecretMetadataWithRemoteNamespace(overrideNamespace)
|
|
|
tc.VerifyPushSecretOutcome = func(ps *esv1alpha1.PushSecret, _ esv1.SecretsClient) {
|
|
|
waitForPushSecretStatus(tc.Framework, ps.Namespace, ps.Name, corev1.ConditionTrue)
|
|
|
@@ -332,11 +331,10 @@ func clusterProviderPushRecoveryCase(f *framework.Framework, harness ClusterProv
|
|
|
Name: name,
|
|
|
AuthScope: authScope,
|
|
|
})
|
|
|
- Expect(runtime).NotTo(BeNil(), "cluster provider push harness returned nil runtime")
|
|
|
+ applyClusterProviderPushSecret(tc, runtime, fmt.Sprintf("%s-remote", name))
|
|
|
if !runtime.SupportsAuthLifecycle() {
|
|
|
Skip(fmt.Sprintf("provider %q does not support auth lifecycle recovery hooks", runtime.ClusterProviderName))
|
|
|
}
|
|
|
- applyClusterProviderPushSecret(tc, runtime, fmt.Sprintf("%s-remote", name))
|
|
|
tc.PushSecret.Spec.RefreshInterval = &metav1.Duration{Duration: time.Hour}
|
|
|
runtime.BreakAuth()
|
|
|
}
|
|
|
@@ -353,6 +351,10 @@ func clusterProviderPushRecoveryCase(f *framework.Framework, harness ClusterProv
|
|
|
}
|
|
|
|
|
|
func applyClusterProviderPushSecret(tc *framework.TestCase, runtime *ClusterProviderPushRuntime, remoteSecretName string) {
|
|
|
+ if runtime == nil {
|
|
|
+ panic("cluster provider push harness returned nil runtime")
|
|
|
+ }
|
|
|
+
|
|
|
tc.PushSecret.ObjectMeta.Name = fmt.Sprintf("%s-push-secret", remoteSecretName)
|
|
|
tc.PushSecret.Spec.SecretStoreRefs = []esv1alpha1.PushSecretStoreRef{{
|
|
|
Name: runtime.ClusterProviderName,
|