diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3620558faf..f22ef58fe2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -68,5 +68,6 @@ generate-release: --assets-link "{\"name\":\"zarf\",\"url\":\"https://zarf-public.s3-us-gov-west-1.amazonaws.com/release/$CI_COMMIT_TAG/zarf\"}" --assets-link "{\"name\":\"zarf-mac-apple\",\"url\":\"https://zarf-public.s3-us-gov-west-1.amazonaws.com/release/$CI_COMMIT_TAG/zarf-mac-apple\"}" --assets-link "{\"name\":\"zarf-mac-intel\",\"url\":\"https://zarf-public.s3-us-gov-west-1.amazonaws.com/release/$CI_COMMIT_TAG/zarf-mac-intel\"}" - --assets-link "{\"name\":\"zarf-init.tar.zst\",\"url\":\"https://zarf-public.s3-us-gov-west-1.amazonaws.com/release/$CI_COMMIT_TAG/zarf-init.tar.zst\"}" + --assets-link "{\"name\":\"zarf-init-amd64.tar.zst\",\"url\":\"https://zarf-public.s3-us-gov-west-1.amazonaws.com/release/$CI_COMMIT_TAG/zarf-init-amd64.tar.zst\"}" + --assets-link "{\"name\":\"zarf-init-arm64.tar.zst\",\"url\":\"https://zarf-public.s3-us-gov-west-1.amazonaws.com/release/$CI_COMMIT_TAG/zarf-init-arm64.tar.zst\"}" --assets-link "{\"name\":\"zarf.sha256\",\"url\":\"https://zarf-public.s3-us-gov-west-1.amazonaws.com/release/$CI_COMMIT_TAG/zarf.sha256\"}" diff --git a/Makefile b/Makefile index cb25b6e4d7..5326f4ae94 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,8 @@ ZARF_BIN := ./build/zarf UNAME_S := $(shell uname -s) UNAME_P := $(shell uname -p) +# Need a clean way to map this, arch and uname -a return x86_64 for amd64 +ARCH := amd64 ifneq ($(UNAME_S),Linux) ifeq ($(UNAME_S),Darwin) ZARF_BIN := $(addsuffix -mac,$(ZARF_BIN)) @@ -49,8 +51,9 @@ build-cli-mac: ## Build the Mac CLI build-cli: build-cli-linux build-cli-mac ## Build the CLI init-package: ## Create the zarf init package, macos "brew install coreutils" first - $(ZARF_BIN) package create --confirm - mv zarf-init.tar.zst build + $(ZARF_BIN) package create --confirm --architecture amd64 + $(ZARF_BIN) package create --confirm --architecture arm64 + mv zarf-init-*.tar.zst build cd build && sha256sum -b zarf* > zarf.sha256 ls -lh build @@ -82,26 +85,26 @@ package-example-tiny-kafka: package-example-compose: cd examples/composable-packages && ../../$(ZARF_BIN) package create --confirm && mv zarf-package-* ../../build/ -# TODO: This can be cleaned up a little more when `zarf init` is able to provide the path to the `zarf-init.tar.zst` +# TODO: This can be cleaned up a little more when `zarf init` is able to provide the path to the `zarf-init-.tar.zst` .PHONY: test-new-e2e test-e2e: ## Run e2e tests on a KiND cluster. All dependencies are assumed to be built and in the ./build directory @ #Check to make sure all the packages we need exist @if [ ! -f $(ZARF_BIN) ]; then\ $(MAKE) build-cli;\ fi - @if [ ! -f ./build/zarf-init.tar.zst ]; then\ + @if [ ! -f ./build/zarf-init-$(ARCH).tar.zst ]; then\ $(MAKE) init-package;\ fi - @if [ ! -f ./build/zarf-package-appliance-demo-multi-games.tar.zst ]; then\ + @if [ ! -f ./build/zarf-package-appliance-demo-multi-games-$(ARCH).tar.zst ]; then\ $(MAKE) package-example-game;\ fi - @if [ ! -f ./build/zarf-package-data-injection-demo.tar ]; then\ + @if [ ! -f ./build/zarf-package-data-injection-demo-$(ARCH).tar ]; then\ $(MAKE) package-example-data-injection;\ fi - @if [ ! -f ./build/zarf-package-gitops-service-data.tar.zst ]; then\ + @if [ ! -f ./build/zarf-package-gitops-service-data-$(ARCH).tar.zst ]; then\ $(MAKE) package-example-gitops-data;\ fi - @if [ ! -f ./build/zarf-package-compose-example.tar.zst ]; then\ + @if [ ! -f ./build/zarf-package-compose-example-$(ARCH).tar.zst ]; then\ $(MAKE) package-example-compose;\ fi - cd test/e2e && cp ../../build/zarf-init.tar.zst . && go test ./... -v -timeout 2400s && rm zarf-init.tar.zst + cd test/e2e && cp ../../build/zarf-init-$(ARCH).tar.zst . && go test ./... -v -timeout 2400s && rm zarf-init-$(ARCH).tar.zst diff --git a/cli/cmd/initialize.go b/cli/cmd/initialize.go index b58cc01795..1baa449502 100644 --- a/cli/cmd/initialize.go +++ b/cli/cmd/initialize.go @@ -22,7 +22,7 @@ var initCmd = &cobra.Command{ _, _ = fmt.Fprintln(os.Stderr, zarfLogo) // Continue running package deploy for all components like any other package - config.DeployOptions.PackagePath = config.PackageInitName + config.DeployOptions.PackagePath = fmt.Sprintf("zarf-init-%s.tar.zst", config.GetArch()) // Run everything packager.Deploy() diff --git a/cli/cmd/root.go b/cli/cmd/root.go index d177eef927..84571bdb40 100644 --- a/cli/cmd/root.go +++ b/cli/cmd/root.go @@ -21,12 +21,11 @@ var rootCmd = &cobra.Command{ if zarfLogLevel != "" { setLogLevel(zarfLogLevel) } + config.CliArch = arch }, Short: "Small tool to bundle dependencies with K3s for air-gapped deployments", Args: cobra.MaximumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - config.CliArch = arch - if len(args) > 0 { if strings.Contains(args[0], "zarf-package-") || strings.Contains(args[0], "zarf-init") { config.DeployOptions.PackagePath = args[0] diff --git a/cli/config/config.go b/cli/config/config.go index 7250ace069..9e980cfefa 100644 --- a/cli/config/config.go +++ b/cli/config/config.go @@ -19,8 +19,7 @@ import ( const ( IPV4Localhost = "127.0.0.1" - PackageInitName = "zarf-init.tar.zst" - PackagePrefix = "zarf-package-" + PackagePrefix = "zarf-package" // ZarfMaxChartNameLength limits helm chart name size to account for K8s/helm limits and zarf prefix ZarfMaxChartNameLength = 40 @@ -102,11 +101,17 @@ func GetSeedImage() string { func GetPackageName() string { metadata := GetMetaData() + prefix := PackagePrefix + suffix := "tar.zst" + + if IsZarfInitConfig() { + return fmt.Sprintf("zarf-init-%s.tar.zst", GetArch()) + } + if metadata.Uncompressed { - return PackagePrefix + metadata.Name + ".tar" - } else { - return PackagePrefix + metadata.Name + ".tar.zst" + suffix = "tar" } + return fmt.Sprintf("%s-%s-%s.%s", prefix, metadata.Name, GetArch(), suffix) } func GetDataInjections() []types.ZarfData { diff --git a/cli/internal/packager/create.go b/cli/internal/packager/create.go index 3077a19887..822abb2949 100644 --- a/cli/internal/packager/create.go +++ b/cli/internal/packager/create.go @@ -68,9 +68,6 @@ func Create() { } if config.IsZarfInitConfig() { - // Override the package name for init packages - packageName = config.PackageInitName - // Include the injection things we need, note that zarf-registry must be created by `make build-injector` first utils.CreatePathAndCopy("injector/zarf-registry", tempPath.injectZarfBinary) utils.CreatePathAndCopy("injector/zarf-injector", tempPath.injectBinary) diff --git a/cli/internal/packager/validate/validate.go b/cli/internal/packager/validate/validate.go index cb3da64837..e0d65ea57d 100644 --- a/cli/internal/packager/validate/validate.go +++ b/cli/internal/packager/validate/validate.go @@ -2,6 +2,7 @@ package validate import ( "fmt" + "regexp" "strings" "github.com/defenseunicorns/zarf/cli/config" @@ -14,6 +15,10 @@ import ( func Run() { components := config.GetComponents() + if err := validatePackageName(config.GetMetaData().Name); err != nil { + message.Fatalf(err, "Invalid package name") + } + for _, component := range components { for _, chart := range component.Charts { if err := validateChart(chart); err != nil { @@ -29,6 +34,15 @@ func Run() { } +func validatePackageName(subject string) error { + // https://regex101.com/r/vpi8a8/1 + isValid := regexp.MustCompile(`^[a-z\-]+$`).MatchString + if isValid(subject) { + return nil + } + return fmt.Errorf("package name '%s' must be all lowercase and contain no special characters except -", subject) +} + func validateChart(chart types.ZarfChart) error { intro := fmt.Sprintf("chart %s", chart.Name) diff --git a/docs/adr/0002-moving-e2e-tests-away-from-terratest.md b/docs/adr/0002-moving-e2e-tests-away-from-terratest.md index 8d6fd31c02..46b705fd99 100644 --- a/docs/adr/0002-moving-e2e-tests-away-from-terratest.md +++ b/docs/adr/0002-moving-e2e-tests-away-from-terratest.md @@ -10,7 +10,7 @@ Accepted In previous releases of Zarf, the creation of the initialization package at the core of many of our E2E tests required repository secrets to login to registry1. Since this is an open-source project, anyone could submit a change to one of our GitHub workflows that could steal our secrets. In order to protect our secrets from any bad-actors we used [peter-evans/slash-command-dispatch@v2](https://github.com/peter-evans/slash-command-dispatch) so that only a maintainer would have the ability to run the E2E tests when a PR is submitted for review. -In the current version of Zarf (v0.15) images from registry1 are no longer needed to create the zarf-init.tar.zst. This means, given our current span of E2E tests, we no longer need to use repository secrets when running tests. This gives us the ability to reassess the way we do our E2E testing. +In the current version of Zarf (v0.15) images from registry1 are no longer needed to create the zarf-init-.tar.zst. This means, given our current span of E2E tests, we no longer need to use repository secrets when running tests. This gives us the ability to reassess the way we do our E2E testing. When considering how to handle the tests, some of the important additions we were considering were: 1. Ability to test against different kubernetes distributions diff --git a/docs/first-time-build.md b/docs/first-time-build.md index 169e109aa7..b57589e3fb 100644 --- a/docs/first-time-build.md +++ b/docs/first-time-build.md @@ -68,7 +68,7 @@ make init-package > ``` > It is likely that you've forgotten to setup access to Iron Bank _or_ that your credentials have changed. In either case, you should go back through the steps to [Log into Iron Bank](#2-log-into-iron-bank) & try to build again! -Assuming everything works out, you should see a shiny new `zarf-init.tar.zst` in your `./build` directory. +Assuming everything works out, you should see a shiny new `zarf-init-.tar.zst` in your `./build` directory. Congratulations! You've just built yourself a Zarf! diff --git a/docs/workstation.md b/docs/workstation.md index 3c2b789d6a..038a25f0d0 100644 --- a/docs/workstation.md +++ b/docs/workstation.md @@ -16,7 +16,7 @@ The simplest path to Zarf is to download a pre-built release and execute it on y 1. Download: - - The zarf cluster initialization package: `zarf-init.tar.zst`. + - The zarf cluster initialization package: `zarf-init-.tar.zst`. - The appropriate zarf binary for your system (choose _one_): @@ -34,7 +34,8 @@ The simplest path to Zarf is to download a pre-built release and execute it on y shasum -c ./zarf.sha256 > zarf: OK # <-- you should see "OK"s, like this - > zarf-init.tar.zst: OK + > zarf-init-amd64.tar.zst: OK + > zarf-init-arm64.tar.zst: OK > zarf-mac-apple: OK > zarf-mac-intel: OK ``` diff --git a/examples/Makefile b/examples/Makefile index b8f36369c5..68235afaae 100755 --- a/examples/Makefile +++ b/examples/Makefile @@ -37,7 +37,7 @@ clean: ## Clean the sync dir fetch-release: ## Grab the latest release as an alternative to needing to build the binaries @mkdir -p sync @# This probably isn't the cleanest way to get a release, but since we're moving to github, not worth adding the code until post-migration - @curl -fL "https://zarf-public.s3-us-gov-west-1.amazonaws.com/release/$$(git describe --tags --abbrev=0)/{zarf,zarf-mac-intel,zarf-mac-apple,zarf-init.tar.zst}" -o "sync/#1" + @curl -fL "https://zarf-public.s3-us-gov-west-1.amazonaws.com/release/$$(git describe --tags --abbrev=0)/{zarf,zarf-mac-intel,zarf-mac-apple,zarf-init-amd64.tar.zst,zarf-init-arm64.tar.zst}" -o "sync/#1" @chmod +x sync/* .PHONY: build-release diff --git a/examples/big-bang/README.md b/examples/big-bang/README.md index b452c57000..2b69e051ab 100644 --- a/examples/big-bang/README.md +++ b/examples/big-bang/README.md @@ -69,7 +69,7 @@ make vm-init ```shell # Deploy Big Bang -./zarf package deploy --confirm zarf-package-big-bang-core-demo.tar.zst +./zarf package deploy --confirm zarf-package-big-bang-core-demo-amd64.tar.zst # (Optional) Inspect the results ./zarf tools k9s diff --git a/examples/composable-packages/README.md b/examples/composable-packages/README.md index 34f745f135..1393cfb54b 100644 --- a/examples/composable-packages/README.md +++ b/examples/composable-packages/README.md @@ -64,7 +64,7 @@ kind create cluster This will result in a single-node Kubernetes cluster called `kind-kind` on your local machine running in Docker. Your KUBECONFIG should be automatically configured to talk to the new cluster. ```sh -cd +cd .tar.zst> zarf init ``` @@ -78,13 +78,13 @@ Congratulations! Your machine is now running a single-node Kubernetes cluster p **Troubleshooting:** -> _**ERROR: Unable to find the package on the local system, expected package at zarf-init.tar.zst**_ +> _**ERROR: Unable to find the package on the local system, expected package at zarf-init-.tar.zst**_ > > The zarf binary needs an init package to know how to setup your cluster! So, if `zarf init` returns an error like this: > ```sh -> ERROR: Unable to find the package on the local system, expected package at zarf-init.tar.zst +> ERROR: Unable to find the package on the local system, expected package at zarf-init-.tar.zst > ``` -> It's likely you've either forgotten to download `zarf-init.tar.zst` (as part of [getting ready](#get-ready)) _**OR**_ you are _not_ running `zarf init` from the directory the init package is sitting in. +> It's likely you've either forgotten to download `zarf-init-.tar.zst` (as part of [getting ready](#get-ready)) _**OR**_ you are _not_ running `zarf init` from the directory the init package is sitting in. > _**ERROR: failed to create cluster: node(s) already exist for a cluster with the name "kind"**_ > @@ -122,7 +122,7 @@ Watch the terminal scroll for a while. Once things are downloaded & zipped up an It's time to feed the package you built into your cluster. ```sh -zarf package deploy ./zarf-package-compose-example.tar.zst --confirm +zarf package deploy ./zarf-package-compose-example-.tar.zst --confirm ``` In a couple seconds the cluster will have loaded your package. diff --git a/examples/data-injection/README.md b/examples/data-injection/README.md index ecfc4e4b45..375303fc99 100644 --- a/examples/data-injection/README.md +++ b/examples/data-injection/README.md @@ -50,7 +50,7 @@ kind create cluster This will result in a single-node Kubernetes cluster called `kind-kind` on your local machine running in Docker. Your KUBECONFIG should be automatically configured to talk to the new cluster. ```sh -cd +cd .tar.zst> zarf init ``` @@ -64,15 +64,15 @@ Congratulations! Your machine is now running a single-node Kubernetes cluster po **Troubleshooting:** -> _**ERROR: Unable to find the package on the local system, expected package at zarf-init.tar.zst**_ +> _**ERROR: Unable to find the package on the local system, expected package at zarf-init-.tar.zst**_ > > The zarf binary needs an init package to know how to setup your cluster! So, if `zarf init` returns an error like this: > > ```sh -> ERROR: Unable to find the package on the local system, expected package at zarf-init.tar.zst +> ERROR: Unable to find the package on the local system, expected package at zarf-init-.tar.zst > ``` > -> It's likely you've either forgotten to download `zarf-init.tar.zst` (as part of [getting ready](#get-ready)) _**OR**_ you are _not_ running `zarf init` from the directory the init package is sitting in. +> It's likely you've either forgotten to download `zarf-init-.tar.zst` (as part of [getting ready](#get-ready)) _**OR**_ you are _not_ running `zarf init` from the directory the init package is sitting in. > _**ERROR: failed to create cluster: node(s) already exist for a cluster with the name "kind"**_ > @@ -110,7 +110,7 @@ It's time to feed the package you built into your cluster. Since you're running a Zarf cluster directly on your local machine—where this package & `zarf` binary _already are_—deploying the package is very simple: ```sh -zarf package deploy zarf-package-data-injection-demo.tar --confirm +zarf package deploy zarf-package-data-injection-demo-.tar --confirm ``` In a couple seconds the cluster will have loaded your package. diff --git a/examples/game/README.md b/examples/game/README.md index 8940aa30b6..214f22cd42 100644 --- a/examples/game/README.md +++ b/examples/game/README.md @@ -64,7 +64,7 @@ kind create cluster This will result in a single-node Kubernetes cluster called `kind-kind` on your local machine running in Docker. Your KUBECONFIG should be automatically configured to talk to the new cluster. ```sh -cd +cd .tar.zst> zarf init ``` @@ -78,13 +78,13 @@ Congratulations! Your machine is now running a single-node Kubernetes cluster p **Troubleshooting:** -> _**ERROR: Unable to find the package on the local system, expected package at zarf-init.tar.zst**_ +> _**ERROR: Unable to find the package on the local system, expected package at zarf-init-.tar.zst**_ > > The zarf binary needs an init package to know how to setup your cluster! So, if `zarf init` returns an error like this: > ```sh -> ERROR: Unable to find the package on the local system, expected package at zarf-init.tar.zst +> ERROR: Unable to find the package on the local system, expected package at zarf-init-.tar.zst > ``` -> It's likely you've either forgotten to download `zarf-init.tar.zst` (as part of [getting ready](#get-ready)) _**OR**_ you are _not_ running `zarf init` from the directory the init package is sitting in. +> It's likely you've either forgotten to download `zarf-init-.tar.zst` (as part of [getting ready](#get-ready)) _**OR**_ you are _not_ running `zarf init` from the directory the init package is sitting in. > _**ERROR: failed to create cluster: node(s) already exist for a cluster with the name "kind"**_ > @@ -128,7 +128,7 @@ It's time to feed the package you built into your cluster. Since you're running a Zarf cluster directly on your local machine—where the game package & `zarf` binary _already are_—deploying the game is very simple: ```sh -zarf package deploy ./zarf-package-appliance-demo-multi-games.tar.zst --confirm +zarf package deploy ./zarf-package-appliance-demo-multi-games-.tar.zst --confirm ``` In a couple seconds the cluster will have loaded your package. diff --git a/examples/game/add-logging.md b/examples/game/add-logging.md index fcaee1bae7..1c8fc22b74 100644 --- a/examples/game/add-logging.md +++ b/examples/game/add-logging.md @@ -44,7 +44,7 @@ Installing a Zarf component is _really_ easy—you just have to let `zarf in Exactly like when you first created the game example cluster, you _move into the directory holding your init package_ and run: ```sh -cd +cd .tar.zst> zarf init ``` diff --git a/examples/gitops-data/README.md b/examples/gitops-data/README.md index 354a19fc01..be86099234 100644 --- a/examples/gitops-data/README.md +++ b/examples/gitops-data/README.md @@ -51,7 +51,7 @@ zarf package create # make the package ``` Successful execution will create a package named -`zarf-package-gitops-service-data.tar.zst`, the Zarf example package. +`zarf-package-gitops-service-data-.tar.zst`, the Zarf example package. ## Deploying the Zarf Package @@ -64,7 +64,7 @@ command to deploy the package, uploading the Git repositories to Gitea and the container images to the Docker registry. ```sh -zarf package deploy zarf-package-gitops-service-data.tar.zst +zarf package deploy zarf-package-gitops-service-data-.tar.zst ``` ## Applying the Kustomization diff --git a/examples/istio-with-separate-cert/README.md b/examples/istio-with-separate-cert/README.md index f47bab6aac..72ff41f890 100644 --- a/examples/istio-with-separate-cert/README.md +++ b/examples/istio-with-separate-cert/README.md @@ -64,7 +64,7 @@ make vm-init ```shell # Deploy Big Bang -./zarf package deploy --confirm zarf-package-example-istio-with-separate-cert.tar.zst +./zarf package deploy --confirm zarf-package-example-istio-with-separate-cert-amd64.tar.zst # (Optional) Inspect the results ./zarf tools k9s diff --git a/examples/single-big-bang-package/README.md b/examples/single-big-bang-package/README.md index 31f6a90b59..848ed23896 100644 --- a/examples/single-big-bang-package/README.md +++ b/examples/single-big-bang-package/README.md @@ -47,7 +47,7 @@ kind create cluster This will result in a single-node Kubernetes cluster called `kind-kind` on your local machine running in Docker. Your KUBECONFIG should be automatically configured to talk to the new cluster. ```sh -cd +cd .tar.zst> zarf init ``` @@ -61,15 +61,15 @@ Congratulations! Your machine is now running a single-node Kubernetes cluster po **Troubleshooting:** -> _**ERROR: Unable to find the package on the local system, expected package at zarf-init.tar.zst**_ +> _**ERROR: Unable to find the package on the local system, expected package at zarf-init-.tar.zst**_ > > The zarf binary needs an init package to know how to setup your cluster! So, if `zarf init` returns an error like this: > > ```sh -> ERROR: Unable to find the package on the local system, expected package at zarf-init.tar.zst +> ERROR: Unable to find the package on the local system, expected package at zarf-init-.tar.zst > ``` > -> It's likely you've either forgotten to download `zarf-init.tar.zst` (as part of [getting ready](#get-ready)) _**OR**_ you are _not_ running `zarf init` from the directory the init package is sitting in. +> It's likely you've either forgotten to download `zarf-init-.tar.zst` (as part of [getting ready](#get-ready)) _**OR**_ you are _not_ running `zarf init` from the directory the init package is sitting in. > _**ERROR: failed to create cluster: node(s) already exist for a cluster with the name "kind"**_ > @@ -105,7 +105,7 @@ It's time to feed the package you built into your cluster. Since you're running a Zarf cluster directly on your local machine—where this package & `zarf` binary _already are_—deploying the package is very simple: ```sh -zarf package deploy zarf-package-big-bang-single-package-demo.tar.zst --confirm +zarf package deploy zarf-package-big-bang-single-package-demo-amd64.tar.zst --confirm ``` In a couple seconds the cluster will have loaded your package. diff --git a/examples/tiny-kafka/README.md b/examples/tiny-kafka/README.md index e5fdf927c8..22985b5202 100644 --- a/examples/tiny-kafka/README.md +++ b/examples/tiny-kafka/README.md @@ -47,7 +47,7 @@ kind create cluster This will result in a single-node Kubernetes cluster called `kind-kind` on your local machine running in Docker. Your KUBECONFIG should be automatically configured to talk to the new cluster. ```sh -cd +cd .tar.zst> zarf init ``` @@ -61,15 +61,15 @@ Congratulations! Your machine is now running a single-node Kubernetes cluster po **Troubleshooting:** -> _**ERROR: Unable to find the package on the local system, expected package at zarf-init.tar.zst**_ +> _**ERROR: Unable to find the package on the local system, expected package at zarf-init-.tar.zst**_ > > The zarf binary needs an init package to know how to setup your cluster! So, if `zarf init` returns an error like this: > > ```sh -> ERROR: Unable to find the package on the local system, expected package at zarf-init.tar.zst +> ERROR: Unable to find the package on the local system, expected package at zarf-init-.tar.zst > ``` > -> It's likely you've either forgotten to download `zarf-init.tar.zst` (as part of [getting ready](#get-ready)) _**OR**_ you are _not_ running `zarf init` from the directory the init package is sitting in. +> It's likely you've either forgotten to download `zarf-init-.tar.zst` (as part of [getting ready](#get-ready)) _**OR**_ you are _not_ running `zarf init` from the directory the init package is sitting in. > _**ERROR: failed to create cluster: node(s) already exist for a cluster with the name "kind"**_ > @@ -105,7 +105,7 @@ It's time to feed the package you built into your cluster. Since you're running a Zarf cluster directly on your local machine—where this package & `zarf` binary _already are_—deploying the package is very simple: ```sh -zarf package deploy zarf-package-kafka-strimzi-demo.tar.zst --confirm +zarf package deploy zarf-package-kafka-strimzi-demo-amd64.tar.zst --confirm ``` In a couple seconds the cluster will have loaded your package. diff --git a/test/e2e/common.go b/test/e2e/common.go index b6e9606b6a..a49c1f911d 100644 --- a/test/e2e/common.go +++ b/test/e2e/common.go @@ -29,6 +29,7 @@ import ( type ZarfE2ETest struct { zarfBinPath string + arch string clusterName string kubeconfigPath string filesToRemove []string diff --git a/test/e2e/e2e_composability_test.go b/test/e2e/e2e_composability_test.go index a755d37f3d..6c258647dd 100644 --- a/test/e2e/e2e_composability_test.go +++ b/test/e2e/e2e_composability_test.go @@ -1,6 +1,7 @@ package test import ( + "fmt" "io" "net/http" "testing" @@ -16,8 +17,10 @@ func TestE2eExampleComposability(t *testing.T) { output, err := e2e.execZarfCommand("init", "--confirm") require.NoError(t, err, output) + path := fmt.Sprintf("../../build/zarf-package-compose-example-%s.tar.zst", e2e.arch) + // Deploy the composable game package - output, err = e2e.execZarfCommand("package", "deploy", "../../build/zarf-package-compose-example.tar.zst", "--confirm") + output, err = e2e.execZarfCommand("package", "deploy", path, "--confirm") require.NoError(t, err, output) // Establish the port-forward into the game service diff --git a/test/e2e/e2e_data_injection_test.go b/test/e2e/e2e_data_injection_test.go index 6c7e5554f3..930d2bffca 100644 --- a/test/e2e/e2e_data_injection_test.go +++ b/test/e2e/e2e_data_injection_test.go @@ -1,6 +1,7 @@ package test import ( + "fmt" "testing" "time" @@ -15,8 +16,10 @@ func TestDataInjection(t *testing.T) { output, err := e2e.execZarfCommand("init", "--confirm", "-l=trace") require.NoError(t, err, output) + path := fmt.Sprintf("../../build/zarf-package-data-injection-demo-%s.tar", e2e.arch) + // Deploy the data injection example - output, err = e2e.execZarfCommand("package", "deploy", "../../build/zarf-package-data-injection-demo.tar", "--confirm", "-l=trace") + output, err = e2e.execZarfCommand("package", "deploy", path, "--confirm", "-l=trace") require.NoError(t, err, output) // Test to confirm the root file was placed diff --git a/test/e2e/e2e_example_game_test.go b/test/e2e/e2e_example_game_test.go index 0d2977fcd9..e808502508 100644 --- a/test/e2e/e2e_example_game_test.go +++ b/test/e2e/e2e_example_game_test.go @@ -1,6 +1,7 @@ package test import ( + "fmt" "net/http" "testing" @@ -15,8 +16,10 @@ func TestE2eExampleGame(t *testing.T) { output, err := e2e.execZarfCommand("init", "--confirm") require.NoError(t, err, output) + path := fmt.Sprintf("../../build/zarf-package-appliance-demo-multi-games-%s.tar.zst", e2e.arch) + // Deploy the game - output, err = e2e.execZarfCommand("package", "deploy", "../../build/zarf-package-appliance-demo-multi-games.tar.zst", "--confirm") + output, err = e2e.execZarfCommand("package", "deploy", path, "--confirm") require.NoError(t, err, output) // Establish the port-forward into the game service diff --git a/test/e2e/e2e_gitops_example_test.go b/test/e2e/e2e_gitops_example_test.go index 3ea74e133b..f929f11a1e 100644 --- a/test/e2e/e2e_gitops_example_test.go +++ b/test/e2e/e2e_gitops_example_test.go @@ -18,8 +18,10 @@ func TestGitopsExample(t *testing.T) { output, err := e2e.execZarfCommand("init", "--confirm", "--components=gitops-service") require.NoError(t, err, output) + path := fmt.Sprintf("../../build/zarf-package-gitops-service-data-%s.tar.zst", e2e.arch) + // Deploy the gitops example - output, err = e2e.execZarfCommand("package", "deploy", "../../build/zarf-package-gitops-service-data.tar.zst", "--confirm") + output, err = e2e.execZarfCommand("package", "deploy", path, "--confirm") require.NoError(t, err, output) // Create a tunnel to the git resources diff --git a/test/e2e/main_test.go b/test/e2e/main_test.go index 6752539c28..06fc87f7c0 100644 --- a/test/e2e/main_test.go +++ b/test/e2e/main_test.go @@ -6,6 +6,8 @@ import ( "path" "strings" "testing" + + "github.com/defenseunicorns/zarf/cli/config" ) type testSuite struct { @@ -40,6 +42,8 @@ func TestMain(m *testing.M) { var err error retCode := 0 + e2e.arch = config.GetArch() + // Set up constants for the tests e2e.zarfBinPath = path.Join("../../build", getCLIName()) e2e.kubeconfigPath, err = getKubeconfigPath() diff --git a/zarf.yaml b/zarf.yaml index 377e412963..914bf54fdc 100644 --- a/zarf.yaml +++ b/zarf.yaml @@ -1,8 +1,7 @@ kind: ZarfInitConfig metadata: - name: Zarf Official Init Package + name: init description: "Used to establish a new Zarf cluster" - architecture: amd64 seed: library/registry:2.7.1