install.go 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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 flux
  14. import (
  15. "fmt"
  16. "os"
  17. "os/exec"
  18. "path/filepath"
  19. // nolint
  20. . "github.com/onsi/ginkgo/v2"
  21. // nolint
  22. . "github.com/onsi/gomega"
  23. "github.com/external-secrets/external-secrets-e2e/framework/addon"
  24. )
  25. const (
  26. helmChartRevision = "0.0.0-e2e"
  27. fluxManifests = "https://github.com/fluxcd/flux2/releases/download/v2.6.4/install.yaml"
  28. )
  29. func installFlux() {
  30. By("installing flux")
  31. cmd := exec.Command("kubectl", "apply", "-f", fluxManifests)
  32. out, err := cmd.CombinedOutput()
  33. Expect(err).ToNot(HaveOccurred(), string(out))
  34. }
  35. func uninstallFlux() {
  36. By("uninstalling flux")
  37. cmd := exec.Command("kubectl", "delete", "-f", fluxManifests)
  38. out, err := cmd.CombinedOutput()
  39. Expect(err).ToNot(HaveOccurred(), string(out))
  40. }
  41. func installESO() {
  42. By("installing helm http server")
  43. addon.InstallGlobalAddon(&addon.HelmServer{
  44. ChartDir: filepath.Join(addon.AssetDir(), "deploy/charts/external-secrets"),
  45. ChartRevision: helmChartRevision,
  46. })
  47. By("installing eso through flux helmrelease app")
  48. tag := os.Getenv("VERSION")
  49. addon.InstallGlobalAddon(&addon.FluxHelmRelease{
  50. Name: "external-secrets",
  51. Namespace: "flux-system",
  52. TargetNamespace: "external-secrets",
  53. HelmChart: "external-secrets",
  54. HelmRepo: "http://e2e-helmserver.default.svc.cluster.local",
  55. HelmRevision: helmChartRevision,
  56. HelmValues: fmt.Sprintf(`{
  57. "installCRDs": true,
  58. "crds": {
  59. "conversion": {
  60. "enabled": true
  61. }
  62. },
  63. "image": {
  64. "tag": "%s"
  65. },
  66. "webhook": {
  67. "image": {
  68. "tag": "%s"
  69. }
  70. },
  71. "certController": {
  72. "image": {
  73. "tag": "%s"
  74. }
  75. }
  76. }`, tag, tag, tag),
  77. })
  78. }