parameterstore_managed.go 5.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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 aws
  14. import (
  15. // nolint
  16. . "github.com/onsi/ginkgo/v2"
  17. "github.com/external-secrets/external-secrets-e2e/framework"
  18. "github.com/external-secrets/external-secrets-e2e/framework/addon"
  19. awscommon "github.com/external-secrets/external-secrets-e2e/suites/provider/cases/aws"
  20. "github.com/external-secrets/external-secrets-e2e/suites/provider/cases/common"
  21. )
  22. // here we use the global eso instance
  23. // that uses the service account in the default namespace
  24. // which was created by terraform.
  25. var _ = Describe("[awsmanaged] IRSA via referenced service account", Label("aws", "parameterstore", "managed"), Ordered, func() {
  26. f := framework.New("eso-aws-ps-managed")
  27. prov := NewFromEnv(f)
  28. // nolint
  29. DescribeTable("sync secrets",
  30. framework.TableFuncWithExternalSecret(f,
  31. prov),
  32. framework.Compose(awscommon.WithReferencedIRSA, f, common.SimpleDataSync, awscommon.UseClusterSecretStore),
  33. framework.Compose(awscommon.WithReferencedIRSA, f, common.NestedJSONWithGJSON, awscommon.UseClusterSecretStore),
  34. framework.Compose(awscommon.WithReferencedIRSA, f, common.JSONDataFromSync, awscommon.UseClusterSecretStore),
  35. framework.Compose(awscommon.WithReferencedIRSA, f, common.JSONDataWithProperty, awscommon.UseClusterSecretStore),
  36. framework.Compose(awscommon.WithReferencedIRSA, f, common.JSONDataWithTemplate, awscommon.UseClusterSecretStore),
  37. framework.Compose(awscommon.WithReferencedIRSA, f, common.DockerJSONConfig, awscommon.UseClusterSecretStore),
  38. framework.Compose(awscommon.WithReferencedIRSA, f, common.DataPropertyDockerconfigJSON, awscommon.UseClusterSecretStore),
  39. framework.Compose(awscommon.WithReferencedIRSA, f, common.SSHKeySync, awscommon.UseClusterSecretStore),
  40. framework.Compose(awscommon.WithReferencedIRSA, f, common.SSHKeySyncDataProperty, awscommon.UseClusterSecretStore),
  41. framework.Compose(awscommon.WithReferencedIRSA, f, common.SyncWithoutTargetName, awscommon.UseClusterSecretStore),
  42. framework.Compose(awscommon.WithReferencedIRSA, f, common.JSONDataWithoutTargetName, awscommon.UseClusterSecretStore),
  43. framework.Compose(awscommon.WithReferencedIRSA, f, FindByName, awscommon.UseClusterSecretStore),
  44. framework.Compose(awscommon.WithReferencedIRSA, f, FindByNameWithPath, awscommon.UseClusterSecretStore),
  45. framework.Compose(awscommon.WithReferencedIRSA, f, FindByTag, awscommon.UseClusterSecretStore),
  46. framework.Compose(awscommon.WithReferencedIRSA, f, FindByTagWithPath, awscommon.UseClusterSecretStore),
  47. )
  48. })
  49. // here we create a central eso instance in the default namespace
  50. // that mounts the service account which was created by terraform.
  51. var _ = Describe("[awsmanaged] with mounted IRSA", Label("aws", "parameterstore", "managed"), Ordered, func() {
  52. f := framework.New("eso-aws-ps-irsa-managed")
  53. prov := NewFromEnv(f)
  54. // each test case gets its own ESO instance
  55. BeforeEach(func() {
  56. f.Install(addon.NewESO(
  57. addon.WithControllerClass(f.BaseName),
  58. addon.WithServiceAccount(prov.ServiceAccountName),
  59. addon.WithReleaseName(f.Namespace.Name),
  60. addon.WithNamespace("default"),
  61. addon.WithoutWebhook(),
  62. addon.WithoutCertController(),
  63. ))
  64. })
  65. // nolint
  66. DescribeTable("sync secrets",
  67. framework.TableFuncWithExternalSecret(f,
  68. prov),
  69. framework.Compose(awscommon.WithMountedIRSA, f, common.SimpleDataSync, awscommon.UseMountedIRSAStore),
  70. framework.Compose(awscommon.WithMountedIRSA, f, common.NestedJSONWithGJSON, awscommon.UseMountedIRSAStore),
  71. framework.Compose(awscommon.WithMountedIRSA, f, common.JSONDataFromSync, awscommon.UseMountedIRSAStore),
  72. framework.Compose(awscommon.WithMountedIRSA, f, common.JSONDataWithProperty, awscommon.UseMountedIRSAStore),
  73. framework.Compose(awscommon.WithMountedIRSA, f, common.JSONDataWithTemplate, awscommon.UseMountedIRSAStore),
  74. framework.Compose(awscommon.WithMountedIRSA, f, common.DockerJSONConfig, awscommon.UseMountedIRSAStore),
  75. framework.Compose(awscommon.WithMountedIRSA, f, common.DataPropertyDockerconfigJSON, awscommon.UseMountedIRSAStore),
  76. framework.Compose(awscommon.WithMountedIRSA, f, common.SSHKeySync, awscommon.UseMountedIRSAStore),
  77. framework.Compose(awscommon.WithMountedIRSA, f, common.SSHKeySyncDataProperty, awscommon.UseMountedIRSAStore),
  78. framework.Compose(awscommon.WithMountedIRSA, f, common.SyncWithoutTargetName, awscommon.UseMountedIRSAStore),
  79. framework.Compose(awscommon.WithMountedIRSA, f, common.JSONDataWithoutTargetName, awscommon.UseMountedIRSAStore),
  80. framework.Compose(awscommon.WithMountedIRSA, f, FindByName, awscommon.UseMountedIRSAStore),
  81. framework.Compose(awscommon.WithMountedIRSA, f, FindByNameWithPath, awscommon.UseMountedIRSAStore),
  82. framework.Compose(awscommon.WithMountedIRSA, f, FindByTag, awscommon.UseMountedIRSAStore),
  83. framework.Compose(awscommon.WithMountedIRSA, f, FindByTagWithPath, awscommon.UseMountedIRSAStore),
  84. )
  85. })