azure_managed.go 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. Licensed under the Apache License, Version 2.0 (the "License");
  3. you may not use this file except in compliance with the License.
  4. You may obtain a copy of the License at
  5. http://www.apache.org/licenses/LICENSE-2.0
  6. Unless required by applicable law or agreed to in writing, software
  7. distributed under the License is distributed on an "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. limitations under the License.
  10. */
  11. package azure
  12. import (
  13. // nolint
  14. . "github.com/onsi/ginkgo/v2"
  15. // nolint
  16. // . "github.com/onsi/gomega"
  17. "github.com/external-secrets/external-secrets-e2e/framework"
  18. "github.com/external-secrets/external-secrets-e2e/framework/addon"
  19. "github.com/external-secrets/external-secrets-e2e/suites/provider/cases/common"
  20. esv1 "github.com/external-secrets/external-secrets/apis/externalsecrets/v1"
  21. )
  22. const (
  23. withPodID = "sync secrets with workload identity"
  24. )
  25. // Deploys eso to the default namespace
  26. // that uses the service account provisioned by terraform
  27. // to test workload-identity authentication.
  28. var _ = Describe("[azuremanaged] with pod identity", Label("azure", "keyvault", "managed", "workload-identity"), func() {
  29. f := framework.New("eso-azuremanaged")
  30. prov := newFromWorkloadIdentity(f)
  31. // each test case gets its own ESO instance
  32. BeforeEach(func() {
  33. f.Install(addon.NewESO(
  34. addon.WithControllerClass(f.BaseName),
  35. addon.WithReleaseName(f.Namespace.Name),
  36. addon.WithNamespace("external-secrets-operator"),
  37. addon.WithServiceAccount("external-secrets-operator"),
  38. addon.WithoutWebhook(),
  39. addon.WithoutCertController(),
  40. ))
  41. })
  42. DescribeTable("sync secrets",
  43. framework.TableFuncWithExternalSecret(f,
  44. prov),
  45. // uses pod id
  46. framework.Compose(withPodID, f, common.SimpleDataSync, usePodIDESReference),
  47. framework.Compose(withPodID, f, common.JSONDataWithProperty, usePodIDESReference),
  48. framework.Compose(withPodID, f, common.JSONDataFromSync, usePodIDESReference),
  49. framework.Compose(withPodID, f, common.NestedJSONWithGJSON, usePodIDESReference),
  50. framework.Compose(withPodID, f, common.JSONDataWithTemplate, usePodIDESReference),
  51. framework.Compose(withPodID, f, common.DockerJSONConfig, usePodIDESReference),
  52. framework.Compose(withPodID, f, common.DataPropertyDockerconfigJSON, usePodIDESReference),
  53. framework.Compose(withPodID, f, common.SSHKeySync, usePodIDESReference),
  54. framework.Compose(withPodID, f, common.SSHKeySyncDataProperty, usePodIDESReference),
  55. framework.Compose(withPodID, f, common.SyncWithoutTargetName, usePodIDESReference),
  56. framework.Compose(withPodID, f, common.JSONDataWithoutTargetName, usePodIDESReference),
  57. )
  58. })
  59. func usePodIDESReference(tc *framework.TestCase) {
  60. tc.ExternalSecret.Spec.SecretStoreRef.Kind = esv1.ClusterSecretStoreKind
  61. }