install.go 2.0 KB

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