Actually Create secret for IAP for testing
@@ -45,6 +45,7 @@ func TestBackendConfigNegatives(t *testing.T) {
desc string
svcAnnotations map[string]string
backendConfig *backendconfigv1beta1.BackendConfig
+ secretName string
expectedMsg string
}{
{
@@ -70,7 +71,8 @@ func TestBackendConfigNegatives(t *testing.T) {
EnableCDN(true).
SetIAPConfig(true, "bar").
Build(),
- expectedMsg: "is not valid",
+ secretName: "bar",
+ expectedMsg: "iap and cdn cannot be enabled at the same time",
},
} {
tc := tc // Capture tc as we are running this in parallel.
@@ -84,6 +86,16 @@ func TestBackendConfigNegatives(t *testing.T) {
t.Logf("Backend config %s/%s created", s.Namespace, tc.backendConfig.Name)
}
+ if tc.secretName != "" {
+ if _, err := e2e.CreateSecret(s, tc.secretName,
+ map[string][]byte{
+ "client_id": []byte("my-id"),
+ "client_secret": []byte("my-secret"),
+ }); err != nil {
+ t.Fatalf("Error creating secret %q: %v", tc.secretName, err)
+ }
+ }
+
if _, _, err := e2e.CreateEchoService(s, "service-1", tc.svcAnnotations); err != nil {
t.Fatalf("e2e.CreateEchoService(s, service-1, %q) = _, _, %v, want _, _, nil", tc.svcAnnotations, err)
}
