From a9cf9b0bf34c4889d2cef166251d4e3b8153a485 Mon Sep 17 00:00:00 2001 From: Austin Abro Date: Tue, 1 Oct 2024 19:59:45 +0000 Subject: [PATCH 1/3] change test back and remove docs warnings Signed-off-by: Austin Abro --- examples/podinfo-flux/zarf.yaml | 14 +++++++------- src/test/external/ext_out_cluster_test.go | 17 ++++++----------- src/test/external/registries.yaml | 4 ---- 3 files changed, 13 insertions(+), 22 deletions(-) delete mode 100644 src/test/external/registries.yaml diff --git a/examples/podinfo-flux/zarf.yaml b/examples/podinfo-flux/zarf.yaml index 4ab41b360e..7c234e3a02 100644 --- a/examples/podinfo-flux/zarf.yaml +++ b/examples/podinfo-flux/zarf.yaml @@ -11,14 +11,14 @@ components: - name: flux-install namespace: flux files: - - https://github.com/fluxcd/flux2/releases/download/v2.3.0/install.yaml + - https://github.com/fluxcd/flux2/releases/download/v2.4.0/install.yaml images: - - ghcr.io/fluxcd/helm-controller:v1.0.1 - - ghcr.io/fluxcd/image-automation-controller:v0.38.0 - - ghcr.io/fluxcd/image-reflector-controller:v0.32.0 - - ghcr.io/fluxcd/kustomize-controller:v1.3.0 - - ghcr.io/fluxcd/notification-controller:v1.3.0 - - ghcr.io/fluxcd/source-controller:v1.3.0 + - ghcr.io/fluxcd/helm-controller:v1.1.0 + - ghcr.io/fluxcd/image-automation-controller:v0.39.0 + - ghcr.io/fluxcd/image-reflector-controller:v0.33.0 + - ghcr.io/fluxcd/kustomize-controller:v1.4.0 + - ghcr.io/fluxcd/notification-controller:v1.4.0 + - ghcr.io/fluxcd/source-controller:v1.4.1 - name: podinfo-via-flux-git description: Example deployment via flux (git) using the famous podinfo example diff --git a/src/test/external/ext_out_cluster_test.go b/src/test/external/ext_out_cluster_test.go index ea0aa85023..2f4fbbfa2a 100644 --- a/src/test/external/ext_out_cluster_test.go +++ b/src/test/external/ext_out_cluster_test.go @@ -30,7 +30,6 @@ const ( subnet = "172.31.0.0/16" gateway = "172.31.0.1" giteaIP = "172.31.0.99" - registryIP = "172.31.0.10" giteaHost = "gitea.localhost" registryHost = "registry.localhost" clusterName = "zarf-external-test" @@ -45,9 +44,7 @@ var outClusterCredentialArgs = []string{ "--git-url=http://" + giteaHost + ":3000", "--registry-push-username=" + registryUser, "--registry-push-password=" + commonPassword, - // TODO @AustinAbro321 once flux updates to a version of helm using ORAS v1.2.5 or greater we can switch back - // to using the registry host rather than creating an IP https://github.com/helm/helm/pull/12998 - "--registry-url=" + registryIP + ":5000"} + "--registry-url=k3d-" + registryHost + ":5000"} type ExtOutClusterTestSuite struct { suite.Suite @@ -61,7 +58,7 @@ func (suite *ExtOutClusterTestSuite) SetupSuite() { // NOTE(mkcp): We dogsled these errors because some of these commands will error if they don't cleanup a resource, // which is ok. A better solution would be checking for none or unexpected kinds of errors. _ = exec.CmdWithPrint("k3d", "cluster", "delete", clusterName) // TODO(mkcp): intentionally ignored, mark nolint - _ = exec.CmdWithPrint("docker", "rm", "-f", "k3d-"+registryHost) // TODO(mkcp): intentionally ignored, mark nolint + _ = exec.CmdWithPrint("k3d", "registry", "delete", registryHost) // TODO(mkcp): intentionally ignored, mark nolint _ = exec.CmdWithPrint("docker", "compose", "down") // TODO(mkcp): intentionally ignored, mark nolint _ = exec.CmdWithPrint("docker", "network", "remove", network) // TODO(mkcp): intentionally ignored, mark nolint @@ -70,12 +67,12 @@ func (suite *ExtOutClusterTestSuite) SetupSuite() { suite.NoError(err, "unable to create the k3d registry") // Install a k3d-managed registry server to act as the 'remote' container registry - err = exec.CmdWithPrint("docker", "run", "-d", "--restart=always", "-p", "5000:5000", "--name", "k3d-"+registryHost, "registry:2.8.3") + err = exec.CmdWithPrint("k3d", "registry", "create", registryHost, "--port", "5000") suite.NoError(err, "unable to create the k3d registry") // Create a k3d cluster with the proper networking and aliases - err = exec.CmdWithPrint("k3d", "cluster", "create", clusterName, "--registry-config", "registries.yaml", - "--host-alias", registryIP+":"+registryHost, "--host-alias", giteaIP+":"+giteaHost, "--network", network) + err = exec.CmdWithPrint("k3d", "cluster", "create", clusterName, "--registry-use", + "k3d-"+registryHost+":5000", "--host-alias", giteaIP+":"+giteaHost, "--network", network) suite.NoError(err, "unable to create the k3d cluster") // Install a gitea server via docker compose to act as the 'remote' git server @@ -90,8 +87,6 @@ func (suite *ExtOutClusterTestSuite) SetupSuite() { // Connect gitea to the k3d network err = exec.CmdWithPrint("docker", "network", "connect", "--ip", giteaIP, network, giteaHost) suite.NoError(err, "unable to connect the gitea-server to k3d") - err = exec.CmdWithPrint("docker", "network", "connect", "--ip", registryIP, network, "k3d-"+registryHost) - suite.NoError(err, "unable to connect the registry-server to k3d") } func (suite *ExtOutClusterTestSuite) TearDownSuite() { @@ -102,7 +97,7 @@ func (suite *ExtOutClusterTestSuite) TearDownSuite() { err = exec.CmdWithPrint("docker", "compose", "down") suite.NoError(err, "unable to teardown the gitea-server") - err = exec.CmdWithPrint("docker", "rm", "-f", "k3d-"+registryHost) + err = exec.CmdWithPrint("k3d", "registry", "delete", registryHost) suite.NoError(err, "unable to teardown the k3d registry") err = exec.CmdWithPrint("docker", "network", "remove", network) diff --git a/src/test/external/registries.yaml b/src/test/external/registries.yaml deleted file mode 100644 index 8e7ac32100..0000000000 --- a/src/test/external/registries.yaml +++ /dev/null @@ -1,4 +0,0 @@ -mirrors: - "172.31.0.10:5000": - endpoint: - - http://172.31.0.10:5000 From d15243d1ce56c51c196260e4f855936556962a76 Mon Sep 17 00:00:00 2001 From: Austin Abro Date: Tue, 1 Oct 2024 20:00:31 +0000 Subject: [PATCH 2/3] remove caution block in example Signed-off-by: Austin Abro --- examples/podinfo-flux/zarf.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/examples/podinfo-flux/zarf.yaml b/examples/podinfo-flux/zarf.yaml index 7c234e3a02..6e94a715d0 100644 --- a/examples/podinfo-flux/zarf.yaml +++ b/examples/podinfo-flux/zarf.yaml @@ -108,6 +108,4 @@ x-mdx: | The Zarf agent will only automatically add the `insecure` key if the internal registry is used. If you are using a http registry outside of the cluster you will need to manually add this key. - Due to an upstream bug, HelmRepositories with an insecure registry must use IP address instead of a hostname. This is not an issue with the internal Zarf registry, which is always an IP address, but will cause Flux HelmRepositories to break if Zarf is using an external http registry with a hostname. - ::: From 9529d49220402a7cde878c4ec1f5ec8cb756552b Mon Sep 17 00:00:00 2001 From: Austin Abro Date: Tue, 1 Oct 2024 20:02:50 +0000 Subject: [PATCH 3/3] agent explaination Signed-off-by: Austin Abro --- site/src/content/docs/ref/init-package.mdx | 6 ------ 1 file changed, 6 deletions(-) diff --git a/site/src/content/docs/ref/init-package.mdx b/site/src/content/docs/ref/init-package.mdx index 1af8d3d18e..db35cd2330 100644 --- a/site/src/content/docs/ref/init-package.mdx +++ b/site/src/content/docs/ref/init-package.mdx @@ -157,12 +157,6 @@ The `zarf-agent` modifies the following [flux](https://fluxcd.io/flux/) resource > Support for mutating OCIRepository and HelmRepository objects is in [`alpha`](/roadmap#alpha) and should be tested on non-production clusters before being deployed to production clusters. -:::caution - -Due to a bug in helm, HelmRepositories with an insecure registry must use IP address instead of a hostname. This is not an issue with the internal Zarf registry, which is always an IP address, but will cause Flux HelmRepositories to break if Zarf is using an external http registry with a hostname. - -::: - The `zarf-agent` modifies [ArgoCD applications](https://argo-cd.readthedocs.io/en/stable/user-guide/application-specification/) & [ArgoCD Repositories](https://argo-cd.readthedocs.io/en/stable/user-guide/private-repositories/) objects to point to the local Git Server. > Support for mutating `Application` and `Repository` objects in ArgoCD is in [`beta`](/roadmap#beta) and should be tested on non-production clusters before being deployed to production clusters.