From 5b8288dd4c3170045e48f4236e260139ac9ff629 Mon Sep 17 00:00:00 2001 From: Lucas Rodriguez Date: Fri, 16 Feb 2024 18:23:23 -0600 Subject: [PATCH] Revert storageclass checks for git server and seed registry --- packages/gitea/zarf.yaml | 6 ----- packages/zarf-registry/zarf.yaml | 9 ------- src/test/e2e/20_zarf_init_test.go | 43 ------------------------------- 3 files changed, 58 deletions(-) diff --git a/packages/gitea/zarf.yaml b/packages/gitea/zarf.yaml index ab48a3e25f..f58fe4900e 100644 --- a/packages/gitea/zarf.yaml +++ b/packages/gitea/zarf.yaml @@ -66,12 +66,6 @@ components: actions: onDeploy: before: - - description: Check that the cluster has the specified storage class - maxTotalSeconds: 3 - wait: - cluster: - kind: storageclass - name: "\"${ZARF_STORAGE_CLASS}\"" - cmd: ./zarf internal update-gitea-pvc --no-progress setVariables: - name: GIT_SERVER_CREATE_PVC diff --git a/packages/zarf-registry/zarf.yaml b/packages/zarf-registry/zarf.yaml index 18dc05dbbd..38a13006c1 100644 --- a/packages/zarf-registry/zarf.yaml +++ b/packages/zarf-registry/zarf.yaml @@ -111,15 +111,6 @@ components: images: # The seed image (or images) that will be injected (see zarf-config.toml) - "###ZARF_PKG_TMPL_REGISTRY_IMAGE_DOMAIN######ZARF_PKG_TMPL_REGISTRY_IMAGE###:###ZARF_PKG_TMPL_REGISTRY_IMAGE_TAG###" - actions: - onDeploy: - before: - - description: Check that the cluster has the specified storage class - maxTotalSeconds: 3 - wait: - cluster: - kind: storageclass - name: "\"${ZARF_STORAGE_CLASS}\"" - name: zarf-registry description: | diff --git a/src/test/e2e/20_zarf_init_test.go b/src/test/e2e/20_zarf_init_test.go index 86f127fc83..fb1934561b 100644 --- a/src/test/e2e/20_zarf_init_test.go +++ b/src/test/e2e/20_zarf_init_test.go @@ -12,7 +12,6 @@ import ( "encoding/json" - "github.com/defenseunicorns/zarf/src/pkg/utils" "github.com/defenseunicorns/zarf/src/types" "github.com/stretchr/testify/require" ) @@ -50,8 +49,6 @@ func TestZarfInit(t *testing.T) { require.Contains(t, stdErr, expectedErrorMessage) } - initWithoutStorageClass(t) - if !e2e.ApplianceMode { // throw a pending pod into the cluster to ensure we can properly ignore them when selecting images _, _, err := e2e.Kubectl("apply", "-f", "https://raw.githubusercontent.com/kubernetes/website/main/content/en/examples/pods/pod-with-node-affinity.yaml") @@ -127,43 +124,3 @@ func checkLogForSensitiveState(t *testing.T, logText string, zarfState types.Zar require.NotContains(t, logText, zarfState.RegistryInfo.Secret) require.NotContains(t, logText, zarfState.LoggingSecret) } - -// Verify `zarf init` produces an error when there is no storage class in cluster. -func initWithoutStorageClass(t *testing.T) { - /* - Exit early if testing with Zarf-deployed k3s cluster. - This is a chicken-egg problem because we can't interact with a cluster that Zarf hasn't created yet. - Zarf deploys k3s with the Rancher local-path storage class out of the box, - so we don't expect any problems with no storage class in this case. - */ - if e2e.ApplianceMode { - return - } - - jsonPathQuery := `{range .items[?(@.metadata.annotations.storageclass\.kubernetes\.io/is-default-class=="true")]}{.metadata.name}{end}` - defaultStorageClassName, _, err := e2e.Kubectl("get", "storageclass", "-o=jsonpath="+jsonPathQuery) - require.NoError(t, err) - require.NotEmpty(t, defaultStorageClassName) - - storageClassYaml, _, err := e2e.Kubectl("get", "storageclass", defaultStorageClassName, "-o=yaml") - require.NoError(t, err) - - storageClassFileName := "storage-class.yaml" - - err = utils.WriteFile(storageClassFileName, []byte(storageClassYaml)) - require.NoError(t, err) - defer e2e.CleanFiles(storageClassFileName) - - _, _, err = e2e.Kubectl("delete", "storageclass", defaultStorageClassName) - require.NoError(t, err) - - _, stdErr, err := e2e.Zarf("init", "--confirm") - require.Error(t, err, stdErr) - require.Contains(t, stdErr, "unable to run component before action: command \"Check that the cluster has the specified storage class\"") - - _, _, err = e2e.Zarf("destroy", "--confirm") - require.NoError(t, err) - - _, _, err = e2e.Kubectl("apply", "-f", storageClassFileName) - require.NoError(t, err) -}