azure_managed.go 2.8 KB

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