diff --git a/.github/ISSUE_TEMPLATE/tech_debt.md b/.github/ISSUE_TEMPLATE/tech_debt.md index 8d862c65b9..aa19a1fdfc 100644 --- a/.github/ISSUE_TEMPLATE/tech_debt.md +++ b/.github/ISSUE_TEMPLATE/tech_debt.md @@ -10,7 +10,7 @@ assignees: '' A clear and concise description of what should be changed/researched. Ex. This piece of the code is not DRY enough [...] ### Links to any relevant code -(optional) i.e. - https://github.com/defenseunicorns/zarf/blob/main/README.md?plain=1#L1 +(optional) i.e. - https://github.com/zarf-dev/zarf/blob/main/README.md?plain=1#L1 ### Additional context Add any other context or screenshots about the technical debt here. diff --git a/.github/SECURITY.md b/.github/SECURITY.md index 6fd559327f..53776bbac6 100644 --- a/.github/SECURITY.md +++ b/.github/SECURITY.md @@ -1,6 +1,6 @@ # Reporting Security Issues -To report a security issue or vulnerability in Zarf, please use the confidential GitHub Security Advisory ["Report a Vulnerability"](https://github.com/defenseunicorns/zarf/security/advisories) tab. The Zarf team will send a response indicating the next steps in handling your report. After the initial reply to your report, the team will keep you informed of the progress towards a fix and full announcement, and may ask for additional information or guidance. +To report a security issue or vulnerability in Zarf, please use the confidential GitHub Security Advisory ["Report a Vulnerability"](https://github.com/zarf-dev/zarf/security/advisories) tab. The Zarf team will send a response indicating the next steps in handling your report. After the initial reply to your report, the team will keep you informed of the progress towards a fix and full announcement, and may ask for additional information or guidance. ### When Should I Report a Vulnerability? diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index cee28d19f1..00544265c2 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -11,4 +11,4 @@ Relates to # ## Checklist before merging - [ ] Test, docs, adr added or updated as needed -- [ ] [Contributor Guide Steps](https://github.com/defenseunicorns/zarf/blob/main/.github/CONTRIBUTING.md#developer-workflow) followed +- [ ] [Contributor Guide Steps](https://github.com/zarf-dev/zarf/blob/main/CONTRIBUTING.md#developer-workflow) followed diff --git a/.github/workflows/build-rust-injector.yml b/.github/workflows/build-rust-injector.yml index 270a091fcf..eb41af52c7 100644 --- a/.github/workflows/build-rust-injector.yml +++ b/.github/workflows/build-rust-injector.yml @@ -2,6 +2,7 @@ name: Zarf Injector Rust Binaries permissions: contents: read + id-token: write on: workflow_dispatch: @@ -9,9 +10,6 @@ on: versionTag: description: "Version tag" required: true - branchName: - description: "Branch to build the injector from" - required: true jobs: build-injector: @@ -19,8 +17,6 @@ jobs: steps: - name: "Checkout Repo" uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - ref: ${{ github.event.inputs.branchName }} - name: Install tools uses: ./.github/actions/install-tools @@ -37,13 +33,14 @@ jobs: shasum zarf-injector-amd64 >> checksums.txt shasum zarf-injector-arm64 >> checksums.txt - - name: Set AWS Credentials + - name: Auth with AWS uses: aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a # v4.0.1 with: - aws-access-key-id: ${{ secrets.AWS_GOV_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_GOV_SECRET_ACCESS_KEY }} - aws-region: us-gov-west-1 + role-to-assume: ${{ secrets.AWS_WRITE_ROLE }} + role-session-name: ${{ github.job || github.event.client_payload.pull_request.head.sha || github.sha }} + aws-region: us-east-2 + role-duration-seconds: 3600 - name: Sync Artifacts to S3 run: | - aws s3 sync src/injector/dist/ s3://zarf-public/injector/${{ github.event.inputs.versionTag }}/ + aws s3 sync src/injector/dist/ s3://zarf-init/injector/${{ github.event.inputs.versionTag }}/ diff --git a/.github/workflows/dummy-dco.yaml b/.github/workflows/dummy-dco.yaml new file mode 100644 index 0000000000..25f022c804 --- /dev/null +++ b/.github/workflows/dummy-dco.yaml @@ -0,0 +1,12 @@ +name: DCO +on: + merge_group: + +permissions: + contents: read + +jobs: + DCO: + runs-on: ubuntu-latest + steps: + - run: echo "dummy DCO workflow (it won't run any check actually) to trigger by merge_group in order to enable merge queue" diff --git a/.github/workflows/nightly-ecr.yml b/.github/workflows/nightly-ecr.yml index 655d3c4dd1..f922e89dba 100644 --- a/.github/workflows/nightly-ecr.yml +++ b/.github/workflows/nightly-ecr.yml @@ -2,7 +2,6 @@ name: Test ECR Publishing on: schedule: - cron: '0 7 * * * ' ## Every day at 0700 UTC - workflow_dispatch: ## Give us the ability to run this manually @@ -28,11 +27,13 @@ jobs: - name: Build the Zarf binary run: make build-cli-linux-amd - - name: Configure AWS Credentials + - name: Auth with AWS uses: aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a # v4.0.1 with: role-to-assume: ${{ secrets.AWS_NIGHTLY_ROLE }} + role-session-name: ${{ github.job || github.event.client_payload.pull_request.head.sha || github.sha }} aws-region: us-east-1 + role-duration-seconds: 3600 # NOTE: The aws cli will need to be explicitly installed on self-hosted runners - name: Login to the ECR Registry diff --git a/.github/workflows/nightly-eks.yml b/.github/workflows/nightly-eks.yml index c4bee3432f..1fe4f4ad7c 100644 --- a/.github/workflows/nightly-eks.yml +++ b/.github/workflows/nightly-eks.yml @@ -2,7 +2,6 @@ name: Test EKS Cluster on: schedule: - cron: '0 7 * * *' ## Every day at 0700 UTC - workflow_dispatch: ## Give us the ability to run this manually inputs: cluster_name: @@ -36,12 +35,13 @@ jobs: - name: Build binary and zarf packages uses: ./.github/actions/packages - - name: Configure AWS Credentials + - name: Auth with AWS uses: aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a # v4.0.1 with: role-to-assume: ${{ secrets.AWS_NIGHTLY_ROLE }} + role-session-name: ${{ github.job || github.event.client_payload.pull_request.head.sha || github.sha }} aws-region: us-east-1 - role-duration-seconds: 14400 + role-duration-seconds: 3600 - name: Build the eks package run: ./build/zarf package create packages/distros/eks -o build --confirm @@ -55,7 +55,7 @@ jobs: --confirm - name: Run tests - run: make test-e2e ARCH=amd64 + run: make test-e2e-with-cluster ARCH=amd64 - name: Teardown the cluster if: always() diff --git a/.github/workflows/publish-application-packages.yml b/.github/workflows/publish-application-packages.yml index c30c7105fa..59be8e3ff3 100644 --- a/.github/workflows/publish-application-packages.yml +++ b/.github/workflows/publish-application-packages.yml @@ -23,7 +23,7 @@ jobs: ref: ${{ github.event.inputs.branchName }} - name: Install The Latest Release Version of Zarf - uses: defenseunicorns/setup-zarf@f95763914e20e493bb5d45d63e30e17138f981d6 # v1.0.0 + uses: defenseunicorns/setup-zarf@10e539efed02f75ec39eb8823e22a5c795f492ae #v1.0.1 - name: "Login to GHCR" uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 @@ -39,11 +39,11 @@ jobs: zarf package create -o build -a arm64 examples/dos-games --signing-key=awskms:///${{ secrets.COSIGN_AWS_KMS_KEY }} --confirm # Publish a the signed dos-games package - zarf package publish ./build/zarf-package-dos-games-amd64-1.0.0.tar.zst oci://ghcr.io/defenseunicorns/packages --key=https://zarf.dev/cosign.pub - zarf package publish ./build/zarf-package-dos-games-arm64-1.0.0.tar.zst oci://ghcr.io/defenseunicorns/packages --key=https://zarf.dev/cosign.pub + zarf package publish ./build/zarf-package-dos-games-amd64-1.0.0.tar.zst oci://ghcr.io/zarf-dev/packages --key=https://zarf.dev/cosign.pub + zarf package publish ./build/zarf-package-dos-games-arm64-1.0.0.tar.zst oci://ghcr.io/zarf-dev/packages --key=https://zarf.dev/cosign.pub # Publish a skeleton of the dos-games package - zarf package publish examples/dos-games oci://ghcr.io/defenseunicorns/packages + zarf package publish examples/dos-games oci://ghcr.io/zarf-dev/packages env: AWS_REGION: ${{ secrets.COSIGN_AWS_REGION }} AWS_ACCESS_KEY_ID: ${{ secrets.COSIGN_AWS_KEY_ID }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2f23f8c9c3..f8e6e36604 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -42,13 +42,13 @@ jobs: run: | cp build/zarf build/zarf-linux-amd64 cp build/zarf-arm build/zarf-linux-arm64 - docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag ghcr.io/defenseunicorns/zarf/agent:$GITHUB_REF_NAME . + docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag ghcr.io/zarf-dev/zarf/agent:$GITHUB_REF_NAME . rm build/zarf-linux-amd64 rm build/zarf-linux-arm64 - echo ZARF_AGENT_IMAGE_DIGEST=$(docker buildx imagetools inspect ghcr.io/defenseunicorns/zarf/agent:$GITHUB_REF_NAME --format '{{ json . }}' | jq -r .manifest.digest) >> $GITHUB_ENV + echo ZARF_AGENT_IMAGE_DIGEST=$(docker buildx imagetools inspect ghcr.io/zarf-dev/zarf/agent:$GITHUB_REF_NAME --format '{{ json . }}' | jq -r .manifest.digest) >> $GITHUB_ENV - name: "Zarf Agent: Sign the Image" - run: cosign sign --key awskms:///${{ secrets.COSIGN_AWS_KMS_KEY }} -a release-engineer=https://github.com/${{ github.actor }} -a version=$GITHUB_REF_NAME ghcr.io/defenseunicorns/zarf/agent@$ZARF_AGENT_IMAGE_DIGEST -y + run: cosign sign --key awskms:///${{ secrets.COSIGN_AWS_KMS_KEY }} -a release-engineer=https://github.com/${{ github.actor }} -a version=$GITHUB_REF_NAME ghcr.io/zarf-dev/zarf/agent@$ZARF_AGENT_IMAGE_DIGEST -y env: COSIGN_EXPERIMENTAL: 1 AWS_REGION: ${{ secrets.COSIGN_AWS_REGION }} @@ -63,8 +63,8 @@ jobs: - name: Publish Init Package as OCI and Skeleton run: | - make publish-init-package ARCH=amd64 REPOSITORY_URL=ghcr.io/defenseunicorns/packages - make publish-init-package ARCH=arm64 REPOSITORY_URL=ghcr.io/defenseunicorns/packages + make publish-init-package ARCH=amd64 REPOSITORY_URL=ghcr.io/zerf-dev/packages + make publish-init-package ARCH=arm64 REPOSITORY_URL=ghcr.io/zarf-dev/packages # Create a CVE report based on this build - name: Create release time CVE report diff --git a/.github/workflows/test-upgrade.yml b/.github/workflows/test-upgrade.yml index 4bbcf170b5..552d79e103 100644 --- a/.github/workflows/test-upgrade.yml +++ b/.github/workflows/test-upgrade.yml @@ -73,7 +73,7 @@ jobs: chmod +x build/zarf - name: Install release version of Zarf - uses: defenseunicorns/setup-zarf@f95763914e20e493bb5d45d63e30e17138f981d6 # v1.0.0 + uses: defenseunicorns/setup-zarf@10e539efed02f75ec39eb8823e22a5c795f492ae #v1.0.1 with: download-init-package: true diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 8743d5d263..8af7ee7d5b 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -17,7 +17,7 @@ builds: - darwin - windows ldflags: - - -s -w -X github.com/defenseunicorns/zarf/src/config.CLIVersion={{.Tag}} + - -s -w -X github.com/zarf-dev/zarf/src/config.CLIVersion={{.Tag}} - -X k8s.io/component-base/version.gitVersion=v{{.Env.K8S_MODULES_MAJOR_VER}}.{{.Env.K8S_MODULES_MINOR_VER}}.{{.Env.K8S_MODULES_PATCH_VER}} - -X k8s.io/component-base/version.gitCommit={{.FullCommit}} - -X k8s.io/component-base/version.buildDate={{.Date}} @@ -27,9 +27,9 @@ builds: - -X helm.sh/helm/v3/pkg/chartutil.k8sVersionMinor={{.Env.K8S_MODULES_MINOR_VER}} - -X github.com/derailed/k9s/cmd.version={{.Env.K9S_VERSION}} - -X github.com/google/go-containerregistry/cmd/crane/cmd.Version={{.Env.CRANE_VERSION}} - - -X github.com/defenseunicorns/zarf/src/cmd/tools.syftVersion={{.Env.SYFT_VERSION}} - - -X github.com/defenseunicorns/zarf/src/cmd/tools.archiverVersion={{.Env.ARCHIVER_VERSION}} - - -X github.com/defenseunicorns/zarf/src/cmd/tools.helmVersion={{.Env.HELM_VERSION}} + - -X github.com/zarf-dev/zarf/src/cmd/tools.syftVersion={{.Env.SYFT_VERSION}} + - -X github.com/zarf-dev/zarf/src/cmd/tools.archiverVersion={{.Env.ARCHIVER_VERSION}} + - -X github.com/zarf-dev/zarf/src/cmd/tools.helmVersion={{.Env.HELM_VERSION}} goarch: - amd64 - arm64 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b77cc86c1c..ad9ea6d447 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: args: - "--allow-missing-credentials" - id: detect-private-key - exclude: "src/test/e2e/30_config_file_test.go" + exclude: "src/test/e2e/29_config_file_test.go" - id: end-of-file-fixer exclude: site/src/content/docs/commands/.* - id: fix-byte-order-marker diff --git a/CHARTER.pdf b/CHARTER.pdf new file mode 100644 index 0000000000..6834ea3fb5 Binary files /dev/null and b/CHARTER.pdf differ diff --git a/CODEOWNERS b/CODEOWNERS index c713375a0d..1f66adaee1 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1,5 +1,6 @@ -* @defenseunicorns/zarf @dgershman +* @zarf-dev/maintainers @zarf-dev/reviewers -/CODEOWNERS @jeff-mccoy @austenbryan -/cosign.pub @jeff-mccoy @austenbryan -/LICENSE @jeff-mccoy @austenbryan +/CODEOWNERS @zarf-dev/tsc +/cosign.pub @zarf-dev/tsc +/LICENSE @zarf-dev/tsc +/CHARTER.pdf @zarf-dev/tsc diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index a7d8c48f7e..6dd1456839 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,132 +1 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, caste, color, religion, or sexual -identity and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our -community include: - -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -* Focusing on what is best not just for us as individuals, but for the overall - community - -Examples of unacceptable behavior include: - -* The use of sexualized language or imagery, and sexual attention or advances of - any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email address, - without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official email address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at -zarf-dev-private@googlegroups.com. -All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -### 2. Warning - -**Community Impact**: A violation through a single incident or series of -actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or permanent -ban. - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within the -community. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.1, available at -[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. - -Community Impact Guidelines were inspired by -[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. - -For answers to common questions about this code of conduct, see the FAQ at -[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at -[https://www.contributor-covenant.org/translations][translations]. - -[homepage]: https://www.contributor-covenant.org -[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html -[Mozilla CoC]: https://github.com/mozilla/diversity -[FAQ]: https://www.contributor-covenant.org/faq -[translations]: https://www.contributor-covenant.org/translations \ No newline at end of file +Community members are required to abide by the [OpenSSF Code of Conduct](https://openssf.org/community/code-of-conduct/) in all project spaces including (but not limited to) GitHub, Slack, social media, and conferences. \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 700f161b7a..2434cba024 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -33,7 +33,7 @@ Now every time you commit, the hooks will run and format your code, linting can :key: == Required by automation -1. Look at the next due [release milestone](https://github.com/defenseunicorns/zarf/milestones) and pick an issue that you want to work on. If you don't see anything that interests you, create an issue and assign it to yourself. +1. Look at the next due [release milestone](https://github.com/zarf-dev/zarf/milestones) and pick an issue that you want to work on. If you don't see anything that interests you, create an issue and assign it to yourself. 1. Drop a comment in the issue to let everyone know you're working on it and submit a Draft PR (step 4) as soon as you are able. If you have any questions as you work through the code, reach out in the [Zarf Dev Kubernetes Slack Channel](https://kubernetes.slack.com/archives/C03BP9Z3CMA). 1. :key: Set up your Git config to GPG sign all commits. [Here's some documentation on how to set it up](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits). You won't be able to merge your PR if you have any unverified commits. 1. Create a Draft Pull Request as soon as you can, even if it is just 5 minutes after you started working on it. We lean towards working in the open as much as we can. If you're not sure what to put in the PR description, just put a link to the issue you're working on. @@ -41,8 +41,8 @@ Now every time you commit, the hooks will run and format your code, linting can - :key: We follow the [conventional commits spec](https://www.conventionalcommits.org/en/v1.0.0/) with the [commitlint conventional config](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional) as extended types for PR titles. 1. :key: Automated tests will begin based on the paths you have edited in your Pull Request. - > ⚠️ **NOTE:** _If you are an external third-party contributor, the pipelines won't run until a [CODEOWNER](https://github.com/defenseunicorns/zarf/blob/main/CODEOWNERS) approves the pipeline run._ -1. :key: Be sure to use the [needs-adr,needs-docs,needs-tests](https://github.com/defenseunicorns/zarf/labels?q=needs) labels as appropriate for the PR. Once you have addressed all of the needs, remove the label. + > ⚠️ **NOTE:** _If you are an external third-party contributor, the pipelines won't run until a [CODEOWNER](https://github.com/zarf-dev/zarf/blob/main/CODEOWNERS) approves the pipeline run._ +1. :key: Be sure to use the [needs-adr,needs-docs,needs-tests](https://github.com/zarf-dev/zarf/labels?q=needs) labels as appropriate for the PR. Once you have addressed all of the needs, remove the label. 1. Once the review is complete and approved, a core member of the zarf project will merge your PR. If you are an external third-party contributor, two core members of the zarf project will be required to approve the PR. 1. Close the issue if it is fully resolved by your PR. _Hint: You can add "Fixes #XX" to the PR description to automatically close an issue when the PR is merged._ @@ -56,7 +56,7 @@ Our unit tests can be found as `*_test.go` files inside the package that they ar ## Documentation -The CLI docs (located at `site/src/content/docs/commands`), and [`zarf.schema.json`](https://github.com/defenseunicorns/zarf/blob/main/zarf.schema.json) are autogenerated from `make docs-and-schema`. Run this make target locally to regenerate the schema and documentation each time you make a change to the CLI commands or the schema, otherwise CI will fail. +The CLI docs (located at `site/src/content/docs/commands`), and [`zarf.schema.json`](https://github.com/zarf-dev/zarf/blob/main/zarf.schema.json) are autogenerated from `make docs-and-schema`. Run this make target locally to regenerate the schema and documentation each time you make a change to the CLI commands or the schema, otherwise CI will fail. We do this so that there is a git commit signature from a person on the commit for better traceability, rather than a non-person entity (e.g. GitHub CI token). diff --git a/Makefile b/Makefile index 9a4fa4e58e..bdce6970d3 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ else endif CLI_VERSION ?= $(if $(shell git describe --tags),$(shell git describe --tags),"UnknownVersion") -BUILD_ARGS := -s -w -X github.com/defenseunicorns/zarf/src/config.CLIVersion=$(CLI_VERSION) +BUILD_ARGS := -s -w -X github.com/zarf-dev/zarf/src/config.CLIVersion=$(CLI_VERSION) K8S_MODULES_VER=$(subst ., ,$(subst v,,$(shell go list -f '{{.Version}}' -m k8s.io/client-go))) K8S_MODULES_MAJOR_VER=$(shell echo $$(($(firstword $(K8S_MODULES_VER)) + 1))) K8S_MODULES_MINOR_VER=$(word 2,$(K8S_MODULES_VER)) @@ -48,9 +48,9 @@ BUILD_ARGS += -X helm.sh/helm/v3/pkg/chartutil.k8sVersionMinor=$(K8S_MODULES_MIN BUILD_ARGS += -X k8s.io/component-base/version.gitVersion=v$(K8S_MODULES_MAJOR_VER).$(K8S_MODULES_MINOR_VER).$(K8S_MODULES_PATCH_VER) BUILD_ARGS += -X github.com/derailed/k9s/cmd.version=$(K9S_VERSION) BUILD_ARGS += -X github.com/google/go-containerregistry/cmd/crane/cmd.Version=$(CRANE_VERSION) -BUILD_ARGS += -X github.com/defenseunicorns/zarf/src/cmd/tools.syftVersion=$(SYFT_VERSION) -BUILD_ARGS += -X github.com/defenseunicorns/zarf/src/cmd/tools.archiverVersion=$(ARCHIVER_VERSION) -BUILD_ARGS += -X github.com/defenseunicorns/zarf/src/cmd/tools.helmVersion=$(HELM_VERSION) +BUILD_ARGS += -X github.com/zarf-dev/zarf/src/cmd/tools.syftVersion=$(SYFT_VERSION) +BUILD_ARGS += -X github.com/zarf-dev/zarf/src/cmd/tools.archiverVersion=$(ARCHIVER_VERSION) +BUILD_ARGS += -X github.com/zarf-dev/zarf/src/cmd/tools.helmVersion=$(HELM_VERSION) GIT_SHA := $(if $(shell git rev-parse HEAD),$(shell git rev-parse HEAD),"") BUILD_DATE := $(shell date -u +'%Y-%m-%dT%H:%M:%SZ') @@ -121,7 +121,7 @@ build-local-agent-image: ## Build the Zarf agent image to be used in a locally b @ if [ "$(ARCH)" = "amd64" ]; then cp build/zarf build/zarf-linux-amd64; fi @ if [ "$(ARCH)" = "arm64" ] && [ ! -s ./build/zarf-arm ]; then $(MAKE) build-cli-linux-arm; fi @ if [ "$(ARCH)" = "arm64" ]; then cp build/zarf-arm build/zarf-linux-arm64; fi - docker buildx build --load --platform linux/$(ARCH) --tag ghcr.io/defenseunicorns/zarf/agent:local . + docker buildx build --load --platform linux/$(ARCH) --tag ghcr.io/zarf-dev/zarf/agent:local . @ if [ "$(ARCH)" = "amd64" ]; then rm build/zarf-linux-amd64; fi @ if [ "$(ARCH)" = "arm64" ]; then rm build/zarf-linux-arm64; fi @@ -210,7 +210,7 @@ test-upgrade: ## Run the Zarf CLI E2E tests for an external registry and cluster .PHONY: test-unit test-unit: ## Run unit tests - go test -failfast -v -coverprofile=coverage.out -covermode=atomic $$(go list ./... | grep -v '^github.com/defenseunicorns/zarf/src/test' | grep -v 'github.com/defenseunicorns/zarf/src/extensions/bigbang/test') + go test -failfast -v -coverprofile=coverage.out -covermode=atomic $$(go list ./... | grep -v '^github.com/zarf-dev/zarf/src/test' | grep -v 'github.com/zarf-dev/zarf/src/extensions/bigbang/test') # INTERNAL: used to test that a dev has ran `make docs-and-schema` in their PR test-docs-and-schema: diff --git a/README.md b/README.md index 221ac84ae0..c49b2ade6c 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,16 @@ # Zarf - DevSecOps for Air Gap -[![Latest Release](https://img.shields.io/github/v/release/defenseunicorns/zarf)](https://github.com/defenseunicorns/zarf/releases) -[![Go version](https://img.shields.io/github/go-mod/go-version/defenseunicorns/zarf?filename=go.mod)](https://go.dev/) -[![Build Status](https://img.shields.io/github/actions/workflow/status/defenseunicorns/zarf/release.yml)](https://github.com/defenseunicorns/zarf/actions/workflows/release.yml) -[![Zarf Documentation Status](https://api.netlify.com/api/v1/badges/fe846ae4-25fb-4274-9968-90782640ee9f/deploy-status)](https://app.netlify.com/sites/zarf-docs/deploys) -[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/defenseunicorns/zarf/badge)](https://securityscorecards.dev/viewer/?uri=github.com/defenseunicorns/zarf) +[![Latest Release](https://img.shields.io/github/v/release/zarf-dev/zarf)](https://github.com/zarf-dev/zarf/releases) +[![Go version](https://img.shields.io/github/go-mod/go-version/zarf-dev/zarf?filename=go.mod)](https://go.dev/) +[![Build Status](https://img.shields.io/github/actions/workflow/status/zarf-dev/zarf/release.yml)](https://github.com/zarf-dev/zarf/actions/workflows/release.yml) +[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/zarf-dev/zarf/badge)](https://securityscorecards.dev/viewer/?uri=github.com/zarf-dev/zarf) [![Zarf Website](https://img.shields.io/badge/web-zarf.dev-6d87c3)](https://zarf.dev/) [![Zarf Documentation](https://img.shields.io/badge/docs-docs.zarf.dev-775ba1)](https://docs.zarf.dev/) [![Zarf Slack Channel](https://img.shields.io/badge/k8s%20slack-zarf-40a3dd)](https://kubernetes.slack.com/archives/C03B6BJAUJ3) -[![Community Meetups](https://img.shields.io/badge/community-meetups-22aebb)](https://github.com/defenseunicorns/zarf/issues/2202) -[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md) +[![Community Meetups](https://img.shields.io/badge/community-meetups-22aebb)](https://github.com/zarf-dev/zarf/issues/2202) Zarf eliminates the [complexity of air gap software delivery](https://www.itopstimes.com/contain/air-gap-kubernetes-considerations-for-running-cloud-native-applications-without-the-cloud/) for Kubernetes clusters and cloud-native workloads using a declarative packaging strategy to support DevSecOps in offline and semi-connected environments. @@ -79,8 +77,8 @@ Join us on the [Kubernetes Slack](https://kubernetes.slack.com/) in the [_#zarf_ We are so grateful to our Zarf community for contributing bug fixes and collaborating on new features: - - + + Made with [contrib.rocks](https://contrib.rocks). diff --git a/SUPPORT.md b/SUPPORT.md index ad6ce504bd..27d362cb58 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -4,10 +4,10 @@ We strive to create clear guidelines on communication to the Zarf team to provid ## Questions For guidance on using Zarf, [the documentation](https://docs.zarf.dev/) should cover most use cases. -For all questions documentation may not cover, we suggest utilizing [Github Discussions](https://github.com/defenseunicorns/zarf/discussions). +For all questions documentation may not cover, we suggest utilizing [Github Discussions](https://github.com/zarf-dev/zarf/discussions). ## Standard Process -All code issues should be a [Github Issue](https://github.com/defenseunicorns/zarf/issues/new/choose) that follows the issue template. +All code issues should be a [Github Issue](https://github.com/zarf-dev/zarf/issues/new/choose) that follows the issue template. Following the templates provides the Zarf community a foundation of understanding to be able to assist quickly. After an issue is made, this issue can be brought into other channels such as the [Kubernetes Slack #Zarf](https://zarf.dev/slack) channel or the [bi-weekly Zarf Community Meeting](https://docs.zarf.dev/contribute/contributor-guide/). diff --git a/examples/big-bang/zarf.yaml b/examples/big-bang/zarf.yaml index 534ebd0ea4..672ec4f8d1 100644 --- a/examples/big-bang/zarf.yaml +++ b/examples/big-bang/zarf.yaml @@ -96,4 +96,4 @@ x-mdx: | You can learn about YOLO mode in the [FAQ](/faq#what-is-yolo-mode-and-why-would-i-use-it) or the [YOLO mode example](/ref/examples/yolo/). - [Big Bang YOLO Mode Example](https://github.com/defenseunicorns/zarf/tree/main/examples/big-bang/yolo). + [Big Bang YOLO Mode Example](https://github.com/zarf-dev/zarf/tree/main/examples/big-bang/yolo). diff --git a/examples/git-data/zarf.yaml b/examples/git-data/zarf.yaml index 01e2c5d4eb..f2294f7c09 100644 --- a/examples/git-data/zarf.yaml +++ b/examples/git-data/zarf.yaml @@ -8,30 +8,30 @@ components: - name: full-repo repos: # The following performs a full Git Repo Mirror with `go-git` (internal to Zarf) - - https://github.com/defenseunicorns/zarf-public-test.git + - https://github.com/zarf-dev/zarf-public-test.git # The following performs a full Git Repo Mirror forcing a fallback to host `git` - https://dev.azure.com/defenseunicorns/zarf-public-test/_git/zarf-public-test - name: specific-tag repos: # The following performs a tag Git Repo Mirror with `go-git` (internal to Zarf) - - https://github.com/defenseunicorns/zarf-public-test.git@v0.0.1 + - https://github.com/zarf-dev/zarf-public-test.git@v0.0.1 # The following performs a refspec tag Git Repo Mirror with `go-git` - - https://github.com/defenseunicorns/zarf-public-test.git@refs/tags/v0.0.1 + - https://github.com/zarf-dev/zarf-public-test.git@refs/tags/v0.0.1 # The following performs a tag Git Repo Mirror forcing a fallback to host `git` - https://dev.azure.com/defenseunicorns/zarf-public-test/_git/zarf-public-test@v0.0.1 - name: specific-branch repos: # The following performs a branch Git Repo Mirror with `go-git` (internal to Zarf) - - https://github.com/defenseunicorns/zarf-public-test.git@refs/heads/dragons + - https://github.com/zarf-dev/zarf-public-test.git@refs/heads/dragons # The following performs a branch Git Repo Mirror forcing a fallback to host `git` - https://dev.azure.com/defenseunicorns/zarf-public-test/_git/zarf-public-test@refs/heads/dragons - name: specific-hash repos: # The following performs a SHA Git Repo Mirror with `go-git` (internal to Zarf) - - https://github.com/defenseunicorns/zarf-public-test.git@01a23218923f24194133b5eb11268cf8d73ff1bb + - https://github.com/zarf-dev/zarf-public-test.git@01a23218923f24194133b5eb11268cf8d73ff1bb # The following performs a SHA Git Repo Mirror forcing a fallback to host `git` - https://dev.azure.com/defenseunicorns/zarf-public-test/_git/zarf-public-test@01a23218923f24194133b5eb11268cf8d73ff1bb diff --git a/go.mod b/go.mod index b8cee0d6d6..9bf35fbbba 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/defenseunicorns/zarf +module github.com/zarf-dev/zarf go 1.22.4 diff --git a/main.go b/main.go index de8ce2617a..f424789b54 100644 --- a/main.go +++ b/main.go @@ -11,9 +11,9 @@ import ( "os/signal" "syscall" - "github.com/defenseunicorns/zarf/src/cmd" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/pkg/lint" + "github.com/zarf-dev/zarf/src/cmd" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/pkg/lint" ) //go:embed cosign.pub diff --git a/packages/README.md b/packages/README.md index 1776860ba4..be4516cf68 100644 --- a/packages/README.md +++ b/packages/README.md @@ -1,6 +1,6 @@ # Zarf Packages -This folder contains packages maintained by the [Zarf team](https://github.com/defenseunicorns/zarf/graphs/contributors). Some of these packages are used by `zarf init` for new cluster initialization. +This folder contains packages maintained by the [Zarf team](https://github.com/zarf-dev/zarf/graphs/contributors). Some of these packages are used by `zarf init` for new cluster initialization. ## Distros diff --git a/packages/distros/eks/eks.yaml b/packages/distros/eks/eks.yaml index 50ae84a197..530da71f8c 100644 --- a/packages/distros/eks/eks.yaml +++ b/packages/distros/eks/eks.yaml @@ -5,15 +5,28 @@ metadata: name: ###ZARF_VAR_EKS_CLUSTER_NAME### region: ###ZARF_VAR_EKS_CLUSTER_REGION### version: "###ZARF_VAR_EKS_CLUSTER_VERSION###" + tags: + PermissionsBoundary: "zarf_dev_base_policy" iam: withOIDC: true + serviceRolePermissionsBoundary: "arn:aws:iam::173911864621:policy/zarf_dev_base_policy" addons: - name: aws-ebs-csi-driver version: "###ZARF_VAR_EBS_DRIVER_VERSION###" attachPolicyARNs: - arn:aws:iam::aws:policy/service-role/AmazonEBSCSIDriverPolicy + permissionsBoundary: "arn:aws:iam::173911864621:policy/zarf_dev_base_policy" + tags: + PermissionsBoundary: "zarf_dev_base_policy" + + - name: vpc-cni + attachPolicyARNs: + - arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy + permissionsBoundary: "arn:aws:iam::173911864621:policy/zarf_dev_base_policy" + tags: + PermissionsBoundary: "zarf_dev_base_policy" managedNodeGroups: - instanceType: ###ZARF_VAR_EKS_INSTANCE_TYPE### @@ -21,3 +34,7 @@ managedNodeGroups: minSize: 3 maxSize: 6 spot: true + tags: + PermissionsBoundary: "zarf_dev_base_policy" + iam: + instanceRolePermissionsBoundary: "arn:aws:iam::173911864621:policy/zarf_dev_base_policy" diff --git a/packages/zarf-registry/configmap.yaml b/packages/zarf-registry/configmap.yaml index 02c9b9bb0b..fe3e7bf235 100644 --- a/packages/zarf-registry/configmap.yaml +++ b/packages/zarf-registry/configmap.yaml @@ -7,4 +7,4 @@ metadata: data: localRegistryHosting.v1: | host: "###ZARF_REGISTRY###" - help: "https://github.com/defenseunicorns/zarf" + help: "https://github.com/zarf-dev/zarf" diff --git a/site/astro.config.ts b/site/astro.config.ts index d787bd08c6..d00b26b4af 100644 --- a/site/astro.config.ts +++ b/site/astro.config.ts @@ -39,12 +39,12 @@ export default defineConfig({ SkipLink: "./src/components/SkipLink.astro", }, social: { - github: "https://github.com/defenseunicorns/zarf", + github: "https://github.com/zarf-dev/zarf", slack: "https://kubernetes.slack.com/archives/C03B6BJAUJ3", }, favicon: "/favicon.svg", editLink: { - baseUrl: "https://github.com/defenseunicorns/zarf/edit/main/site", + baseUrl: "https://github.com/zarf-dev/zarf/edit/main/site", }, logo: { src: "./src/assets/zarf-logo-header.svg", diff --git a/site/hack/copy-examples.js b/site/hack/copy-examples.js index a3cda64641..77abf23104 100644 --- a/site/hack/copy-examples.js +++ b/site/hack/copy-examples.js @@ -25,7 +25,7 @@ async function copyExamples() { } const mdx = parsed.get("x-mdx").trim(); examples.push(dir); - const repo = "https://github.com/defenseunicorns/zarf"; + const repo = "https://github.com/zarf-dev/zarf"; const link = new URL(`${repo}/edit/main/examples/${dir}/zarf.yaml`).toString(); const fm = `--- title: "${dir}" diff --git a/site/public/architecture.drawio.svg b/site/public/architecture.drawio.svg index 4fa51a8850..aced8942e9 100644 --- a/site/public/architecture.drawio.svg +++ b/site/public/architecture.drawio.svg @@ -1,4 +1,4 @@ - + diff --git a/site/public/tutorials/package_create_init.html b/site/public/tutorials/package_create_init.html index 6a21effc08..9c8e80e906 100644 --- a/site/public/tutorials/package_create_init.html +++ b/site/public/tutorials/package_create_init.html @@ -158,7 +158,7 @@ - packages/zarf-agent/manifests/deployment.yaml - packages/zarf-agent/manifests/webhook.yaml images: - - ghcr.io/defenseunicorns/zarf/agent:local + - ghcr.io/zarf-dev/zarf/agent:local - name: git-server description: | Deploys Gitea to provide git repositories for Kubernetes configurations. diff --git a/site/public/tutorials/publish_and_deploy_manifest.html b/site/public/tutorials/publish_and_deploy_manifest.html index 74e8928a4a..19977b88e0 100644 --- a/site/public/tutorials/publish_and_deploy_manifest.html +++ b/site/public/tutorials/publish_and_deploy_manifest.html @@ -51,7 +51,7 @@ $ mkdir -p zarf-publish-tutorial && cd zarf-publish-tutorial # For this tutorial we will use the example package -# located here: https://github.com/defenseunicorns/zarf/blob/main/examples/helm-oci-chart/zarf.yaml +# located here: https://github.com/zarf-dev/zarf/blob/main/examples/helm-oci-chart/zarf.yaml $ cat <<EOF > zarf.yaml kind: ZarfPackageConfig metadata: diff --git a/site/public/tutorials/resource_adoption_deploy.html b/site/public/tutorials/resource_adoption_deploy.html index dac25e7967..814f4c541f 100644 --- a/site/public/tutorials/resource_adoption_deploy.html +++ b/site/public/tutorials/resource_adoption_deploy.html @@ -88,7 +88,7 @@ This package has 1 artifacts with software bill-of-materials (SBOM) included. You can view them now in the zarf-sbom folder in this directory or to go directly to one, open this in your browser: -/Users/jason/src/github.com/defenseunicorns/zarf/zarf-sbom/sbom-viewer-defenseunicorns_zarf-game_multi-tile-dark.html +/Users/jason/src/github.com/zarf-dev/zarf/zarf-sbom/sbom-viewer-defenseunicorns_zarf-game_multi-tile-dark.html * This directory will be removed after package deployment. diff --git a/site/public/tutorials/resource_adoption_package.html b/site/public/tutorials/resource_adoption_package.html index a252ad6632..5a4c744f2e 100644 --- a/site/public/tutorials/resource_adoption_package.html +++ b/site/public/tutorials/resource_adoption_package.html @@ -49,7 +49,7 @@
$ zarf package create examples/dos-games -Using config file /Users/jason/src/github.com/defenseunicorns/zarf/zarf-config.toml +Using config file /Users/jason/src/github.com/zarf-dev/zarf/zarf-config.toml Saving log file to /var/folders/bk/rz1xx2sd5zn134c0_j1s2n5r0000gp/T/zarf-2023-05-10-11-24-25-3678510320.log diff --git a/site/src/content/docs/contribute/nerd-notes.mdx b/site/src/content/docs/contribute/nerd-notes.mdx index 6264dd5266..33dd73b35d 100644 --- a/site/src/content/docs/contribute/nerd-notes.mdx +++ b/site/src/content/docs/contribute/nerd-notes.mdx @@ -10,10 +10,10 @@ Zarf is written entirely in [go](https://go.dev/), except for a single 868Kb bin - All workloads are installed in the cluster via the [Helm SDK](https://helm.sh/docs/topics/advanced/#go-sdk) - The OCI Registries used are both from [Docker](https://github.com/distribution/distribution) -- Currently, the Registry and Git servers _are not HA_, see [#375](https://github.com/defenseunicorns/zarf/issues/375) and [#376](https://github.com/defenseunicorns/zarf/issues/376) for discussion on this +- Currently, the Registry and Git servers _are not HA_, see [#375](https://github.com/zarf-dev/zarf/issues/375) and [#376](https://github.com/zarf-dev/zarf/issues/376) for discussion on this - To avoid TLS issues, Zarf binds to `127.0.0.1:31999` on each node as a [NodePort](https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport) to allow all nodes to access the pod(s) in the cluster -- Zarf utilizes a [mutating admission webhook](https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#mutatingadmissionwebhook) called the [`zarf-agent`](https://github.com/defenseunicorns/zarf/tree/main/src/internal/agent) to modify the image property within the `PodSpec`. The purpose is to redirect it to Zarf's configured registry instead of the the original registry (such as DockerHub, GCR, or Quay). Additionally, the webhook attaches the appropriate [ImagePullSecret](https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod) for the seed registry to the pod. This configuration allows the pod to successfully retrieve the image from the seed registry, even when operating in an air-gapped environment. -- Zarf uses a custom injector system to bootstrap a new cluster. See the PR [#329](https://github.com/defenseunicorns/zarf/pull/329) and [ADR](https://github.com/defenseunicorns/zarf/blob/main/adr/0003-image-injection-into-remote-clusters-without-native-support.md) for more details on how we came to this solution. The general steps are listed below: +- Zarf utilizes a [mutating admission webhook](https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#mutatingadmissionwebhook) called the [`zarf-agent`](https://github.com/zarf-dev/zarf/tree/main/src/internal/agent) to modify the image property within the `PodSpec`. The purpose is to redirect it to Zarf's configured registry instead of the the original registry (such as DockerHub, GCR, or Quay). Additionally, the webhook attaches the appropriate [ImagePullSecret](https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod) for the seed registry to the pod. This configuration allows the pod to successfully retrieve the image from the seed registry, even when operating in an air-gapped environment. +- Zarf uses a custom injector system to bootstrap a new cluster. See the PR [#329](https://github.com/zarf-dev/zarf/pull/329) and [ADR](https://github.com/zarf-dev/zarf/blob/main/adr/0003-image-injection-into-remote-clusters-without-native-support.md) for more details on how we came to this solution. The general steps are listed below: - Get a list of images in the cluster - Attempt to create an ephemeral pod using an image from the list - A small rust binary that is compiled using [musl](https://www.musl-libc.org/) to keep the max binary size as minimal as possible diff --git a/site/src/content/docs/contribute/testing.mdx b/site/src/content/docs/contribute/testing.mdx index c64c643aa6..6805190229 100644 --- a/site/src/content/docs/contribute/testing.mdx +++ b/site/src/content/docs/contribute/testing.mdx @@ -2,7 +2,7 @@ title: Running Tests --- -Currently, we primarily test Zarf through a series of [end-to-end tests](https://github.com/defenseunicorns/zarf/tree/main/src/test/e2e). These tests are called in the `test-*.yml` workflows and undergo automatic execution against several K8s distros whenever a pull request is created or updated. +Currently, we primarily test Zarf through a series of [end-to-end tests](https://github.com/zarf-dev/zarf/tree/main/src/test/e2e). These tests are called in the `test-*.yml` workflows and undergo automatic execution against several K8s distros whenever a pull request is created or updated. In addition, Zarf implements unit tests for specific functions where edge cases prove difficult to cover through end-to-end testing alone. Unit tests follow standard Go convention and are `*_test.go` files. diff --git a/site/src/content/docs/faq.mdx b/site/src/content/docs/faq.mdx index e4bca91bba..5f57435ea2 100644 --- a/site/src/content/docs/faq.mdx +++ b/site/src/content/docs/faq.mdx @@ -10,7 +10,7 @@ Defense Unicorns' mission is to advance freedom and independence globally throug ## What license is Zarf under? -Zarf is under the [Apache License 2.0](https://github.com/defenseunicorns/zarf/blob/main/LICENSE). This is one of the most commonly used licenses for open-source software. +Zarf is under the [Apache License 2.0](https://github.com/zarf-dev/zarf/blob/main/LICENSE). This is one of the most commonly used licenses for open-source software. ## Is Zarf free to use? @@ -18,7 +18,7 @@ Yes! Zarf is Free and Open-Source Software (FOSS). And will remain free forever. ## Do I have to use Homebrew to install Zarf? -No, the Zarf binary and init package can be downloaded from the [Releases Page](https://github.com/defenseunicorns/zarf/releases). Zarf does not need to be installed or available to all users on the system, but it does need to be executable for the current user (i.e. `chmod +x zarf` for Linux/Mac). +No, the Zarf binary and init package can be downloaded from the [Releases Page](https://github.com/zarf-dev/zarf/releases). Zarf does not need to be installed or available to all users on the system, but it does need to be executable for the current user (i.e. `chmod +x zarf` for Linux/Mac). ## What dependencies does Zarf have? @@ -26,7 +26,7 @@ Zarf is statically compiled and written in [Go](https://golang.org/) and [Rust]( ## How can I improve the speed of loading large images from Docker on `zarf package create`? -Due to some limitations with how Docker provides access to local image layers, `zarf package create` has to rely on `docker save` under the hood which is [very slow overall](https://github.com/defenseunicorns/zarf/issues/1214) and also takes a long time to report progress. We experimented with many ways to improve this, but for now recommend leveraging a local docker registry to speed up the process. +Due to some limitations with how Docker provides access to local image layers, `zarf package create` has to rely on `docker save` under the hood which is [very slow overall](https://github.com/zarf-dev/zarf/issues/1214) and also takes a long time to report progress. We experimented with many ways to improve this, but for now recommend leveraging a local docker registry to speed up the process. This can be done by running a local registry and pushing the images to it before running `zarf package create`. This will allow `zarf package create` to pull the images from the local registry instead of Docker. This can also be combined with [component actions](/ref/actions/) and [`--registry-override`](/commands/zarf_package_create/) to make the process automatic. Given an example image of `registry.enterprise.corp/my-giant-image:v2` you could do something like this: @@ -74,8 +74,8 @@ metadata: components: repos: - - https://github.com/defenseunicorns/zarf.git - - ssh://git@github.com/defenseunicorns/zarf.git + - https://github.com/zarf-dev/zarf.git + - ssh://git@github.com/zarf-dev/zarf.git - file:///home/zarf/workspace/zarf - git://somegithost.com/zarf.git ``` diff --git a/site/src/content/docs/getting-started/install.mdx b/site/src/content/docs/getting-started/install.mdx index 7c115d8cfb..c92b7ba0ef 100644 --- a/site/src/content/docs/getting-started/install.mdx +++ b/site/src/content/docs/getting-started/install.mdx @@ -14,12 +14,12 @@ brew tap defenseunicorns/tap && brew install zarf ## GitHub Releases -All [Zarf releases](https://github.com/defenseunicorns/zarf/releases) on GitHub include prebuilt binaries that you can download and use. We offer range of combinations of OS and architecture for you to choose from. +All [Zarf releases](https://github.com/zarf-dev/zarf/releases) on GitHub include prebuilt binaries that you can download and use. We offer range of combinations of OS and architecture for you to choose from. export const downloadScript = (os, arch) => ` -ZARF_VERSION=$(curl -sIX HEAD https://github.com/defenseunicorns/zarf/releases/latest | grep -i ^location: | grep -Eo 'v[0-9]+.[0-9]+.[0-9]+') +ZARF_VERSION=$(curl -sIX HEAD https://github.com/zarf-dev/zarf/releases/latest | grep -i ^location: | grep -Eo 'v[0-9]+.[0-9]+.[0-9]+') -curl -sL "https://github.com/defenseunicorns/zarf/releases/download/\${ZARF_VERSION}/zarf_\${ZARF_VERSION}_${os}_${arch}" -o zarf +curl -sL "https://github.com/zarf-dev/zarf/releases/download/\${ZARF_VERSION}/zarf_\${ZARF_VERSION}_${os}_${arch}" -o zarf chmod +x zarf ` @@ -66,9 +66,9 @@ sudo mv zarf /usr/local/bin/zarf To download Zarf on Windows you can run the following (replacing `$ZarfVersion` with any release version of Zarf): export const downloadPowerShellScript = (arch) => ` -$ZarfVersion = (Invoke-RestMethod https://api.github.com/repos/defenseunicorns/zarf/releases/latest).tag_name +$ZarfVersion = (Invoke-RestMethod https://api.github.com/repos/zarf-dev/zarf/releases/latest).tag_name -Start-BitsTransfer -Source "https://github.com/defenseunicorns/zarf/releases/download/$($ZarfVersion)/zarf_$($ZarfVersion)_Windows_${arch}.exe" -Destination zarf.exe +Start-BitsTransfer -Source "https://github.com/zarf-dev/zarf/releases/download/$($ZarfVersion)/zarf_$($ZarfVersion)_Windows_${arch}.exe" -Destination zarf.exe `@@ -96,7 +96,7 @@ The following are unofficial methods of installing Zarf that are maintained by t If you want to build the CLI from scratch, you can do that too. Our local builds depend on [Go](https://golang.org/doc/install) and [make](https://www.gnu.org/software/make/). ```bash -git clone https://github.com/defenseunicorns/zarf +git clone https://github.com/zarf-dev/zarf cd zarf # build the CLI for your current OS and architecture make @@ -134,7 +134,7 @@ $ zarf tools download-init $ zarf init --confirm ``` -The default 'init' package can also be obtained by visiting the [Zarf releases](https://github.com/defenseunicorns/zarf/releases) page and downloading it into your working directory or into `~/.zarf-cache/zarf-init- -vX.X.X.tar.zst`. +The default 'init' package can also be obtained by visiting the [Zarf releases](https://github.com/zarf-dev/zarf/releases) page and downloading it into your working directory or into `~/.zarf-cache/zarf-init- -vX.X.X.tar.zst`. :::tip diff --git a/site/src/content/docs/index.mdx b/site/src/content/docs/index.mdx index 48ac086e1c..abf11bc393 100644 --- a/site/src/content/docs/index.mdx +++ b/site/src/content/docs/index.mdx @@ -45,7 +45,7 @@ Zarf provides a way to package and deploy software in a way that is **repeatable - Builtin Git server with [Gitea](https://gitea.com/) - Builtin Docker registry - Builtin [K9s Dashboard](https://k9scli.io/) for managing a cluster from the terminal -- [Mutating Webhook](https://github.com/defenseunicorns/zarf/blob/main/adr/0005-mutating-webhook.md) to automatically update Kubernetes pod's image path and pull secrets as well as [Flux Git Repository](https://fluxcd.io/docs/components/source/gitrepositories/) URLs and secret references +- [Mutating Webhook](https://github.com/zarf-dev/zarf/blob/main/adr/0005-mutating-webhook.md) to automatically update Kubernetes pod's image path and pull secrets as well as [Flux Git Repository](https://fluxcd.io/docs/components/source/gitrepositories/) URLs and secret references - Builtin [command to find images](/commands/zarf_dev_find-images/) and resources from a Helm chart - Tunneling capability to [connect to Kubernetes resources](/commands/zarf_connect/) without network routing, DNS, TLS or Ingress configuration required diff --git a/site/src/content/docs/ref/components.mdx b/site/src/content/docs/ref/components.mdx index b8f85d6fc6..50be327f1b 100644 --- a/site/src/content/docs/ref/components.mdx +++ b/site/src/content/docs/ref/components.mdx @@ -162,19 +162,19 @@ The [`podinfo-flux`](/ref/examples/podinfo-flux/) example showcases a simple Git #### Tag-Based Git Repository Clone -Tag-based `git` repository cloning is the **recommended** way of cloning a `git` repository for air-gapped deployments because it wraps meaning around a specific point in git history that can easily be traced back to the online world. Tag-based clones are defined using the `scheme://host/repo@tag` format as seen in the example of the `defenseunicorns/zarf` repository (`https://github.com/defenseunicorns/zarf.git@v0.15.0`). +Tag-based `git` repository cloning is the **recommended** way of cloning a `git` repository for air-gapped deployments because it wraps meaning around a specific point in git history that can easily be traced back to the online world. Tag-based clones are defined using the `scheme://host/repo@tag` format as seen in the example of the `zarf-dev/zarf` repository (`https://github.com/zarf-dev/zarf.git@v0.15.0`). A tag-based clone only mirrors the tag defined in the Zarf definition. The tag will be applied on the `git` mirror to a zarf-specific branch name based on the tag name (e.g. the tag `v0.1.0` will be pushed to the `zarf-ref-v0.1.0` branch). This ensures that this tag will be pushed and received properly by the airgap `git` server. :::note -If you would like to use a protocol scheme other than http/https, you can do so with something like the following: `ssh://git@github.com/defenseunicorns/zarf.git@v0.15.0`. Using this you can also clone from a local repo to help you manage larger git repositories: `file:///home/zarf/workspace/zarf@v0.15.0`. +If you would like to use a protocol scheme other than http/https, you can do so with something like the following: `ssh://git@github.com/zarf-dev/zarf.git@v0.15.0`. Using this you can also clone from a local repo to help you manage larger git repositories: `file:///home/zarf/workspace/zarf@v0.15.0`. ::: :::caution -Because Zarf creates long-lived mirrors of repositories in the air gap, it does not support shallow clones (i.e. `git clone --depth x`). These may be present in build environments (i.e. [GitLab runners](https://github.com/defenseunicorns/zarf/issues/1698)) and should be avoided. To learn more about shallow and partial clones see the [GitHub blog on the topic](https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone). +Because Zarf creates long-lived mirrors of repositories in the air gap, it does not support shallow clones (i.e. `git clone --depth x`). These may be present in build environments (i.e. [GitLab runners](https://github.com/zarf-dev/zarf/issues/1698)) and should be avoided. To learn more about shallow and partial clones see the [GitHub blog on the topic](https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone). ::: @@ -182,7 +182,7 @@ Because Zarf creates long-lived mirrors of repositories in the air gap, it does #### SHA-Based Git Repository Clone -In addition to tags, Zarf also supports cloning and pushing a specific SHA hash from a `git` repository, but this is **not recommended** as it is less readable/understandable than tag cloning. Commit SHAs are defined using the same `scheme://host/repo@shasum` format as seen in the example of the `defenseunicorns/zarf` repository (`https://github.com/defenseunicorns/zarf.git@c74e2e9626da0400e0a41e78319b3054c53a5d4e`). +In addition to tags, Zarf also supports cloning and pushing a specific SHA hash from a `git` repository, but this is **not recommended** as it is less readable/understandable than tag cloning. Commit SHAs are defined using the same `scheme://host/repo@shasum` format as seen in the example of the `zarf-dev/zarf` repository (`https://github.com/zarf-dev/zarf.git@c74e2e9626da0400e0a41e78319b3054c53a5d4e`). A SHA-based clone only mirrors the SHA hash defined in the Zarf definition. The SHA will be applied on the `git` mirror to a zarf-specific branch name based on the SHA hash (e.g. the SHA `c74e2e9626da0400e0a41e78319b3054c53a5d4e` will be pushed to the `zarf-ref-c74e2e9626da0400e0a41e78319b3054c53a5d4e` branch). This ensures that this tag will be pushed and received properly by the airgap `git` server. diff --git a/site/src/content/docs/ref/dev.mdx b/site/src/content/docs/ref/dev.mdx index 10fdf34a31..bdf0fe50f7 100644 --- a/site/src/content/docs/ref/dev.mdx +++ b/site/src/content/docs/ref/dev.mdx @@ -8,7 +8,7 @@ tableOfContents: ## Schema Validation -Zarf uses the [Zarf package schema](https://github.com/defenseunicorns/zarf/blob/main/zarf.schema.json) to define its configuration files. This schema is used to describe package configuration options and enable the validation of configuration files prior to their use in building a Zarf Package. +Zarf uses the [Zarf package schema](https://github.com/zarf-dev/zarf/blob/main/zarf.schema.json) to define its configuration files. This schema is used to describe package configuration options and enable the validation of configuration files prior to their use in building a Zarf Package. ### `zarf dev lint` @@ -28,7 +28,7 @@ zarf dev lint ```json "yaml.schemas": { - "https://raw.githubusercontent.com/defenseunicorns/zarf/main/zarf.schema.json": "zarf.yaml" + "https://raw.githubusercontent.com/zarf-dev/zarf/main/zarf.schema.json": "zarf.yaml" } ``` @@ -43,10 +43,10 @@ When successfully installed, the `yaml.schema` line will match the color of the To ensure consistent validation of the Zarf schema version in a `zarf.yaml` file, it can be beneficial to lock it to a specific version. This can be achieved by appending the following statement to the **first line** of any given `zarf.yaml` file: ```yaml -# yaml-language-server: $schema=https://raw.githubusercontent.com/defenseunicorns/zarf/ /zarf.schema.json +# yaml-language-server: $schema=https://raw.githubusercontent.com/zarf-dev/zarf/ /zarf.schema.json ``` -In the above example, ` ` should be replaced with the specific [Zarf release](https://github.com/defenseunicorns/zarf/releases). +In the above example, ` ` should be replaced with the specific [Zarf release](https://github.com/zarf-dev/zarf/releases). ![yaml schema](https://user-images.githubusercontent.com/92826525/226490465-1e6a56f7-41c4-45bf-923b-5242fa4ab64e.png) diff --git a/site/src/content/docs/ref/init-package.mdx b/site/src/content/docs/ref/init-package.mdx index 8a8daa55de..1af8d3d18e 100644 --- a/site/src/content/docs/ref/init-package.mdx +++ b/site/src/content/docs/ref/init-package.mdx @@ -51,7 +51,7 @@ While there is no distro-agnostic method to inject images into a cluster, every But then we have another problem of how to reassemble the image on the other side, as we don't have any consistent image that exists in the cluster that would have such utilities. This is where the `zarf-injector` Rust binary comes in. -> For compiling the `zarf-injector` binary, refer to its [README.md](https://github.com/defenseunicorns/zarf/tree/main/src/injector/README.md). +> For compiling the `zarf-injector` binary, refer to its [README.md](https://github.com/zarf-dev/zarf/tree/main/src/injector/README.md). The `zarf-injector` binary is statically compiled and injected into the cluster as a `configmap` along with the chunks of the `registry:2` image. During the `zarf-seed-registry`'s deployment, the `zarf-injector` binary is run in a pod that mounts the `configmaps` and reassembles the `registry:2` image. It then hosts a temporary, pull-only Docker registry implemented in Rust so that a real registry can be deployed into the cluster from the hosted `registry:2` image. @@ -76,7 +76,7 @@ Doing this keeps Zarf cluster agnostic, however does require that the kubelet be :::note -The `registry:2` image and the Zarf Agent image can be configured with a custom init package using the `registry_image_*` and `agent_image_*` templates defined in the Zarf repo's [zarf-config.toml](https://github.com/defenseunicorns/zarf/blob/main/zarf-config.toml). This allows you to swap them for enterprise provided / hardened versions if desired such as those provided by [Iron Bank](https://repo1.dso.mil/dsop/opensource/defenseunicorns/zarf/zarf-agent). +The `registry:2` image and the Zarf Agent image can be configured with a custom init package using the `registry_image_*` and `agent_image_*` templates defined in the Zarf repo's [zarf-config.toml](https://github.com/zarf-dev/zarf/blob/main/zarf-config.toml). This allows you to swap them for enterprise provided / hardened versions if desired such as those provided by [Iron Bank](https://repo1.dso.mil/dsop/opensource/defenseunicorns/zarf/zarf-agent). ::: @@ -95,7 +95,7 @@ It leverages the same `docker-registry` chart used in `zarf-seed-registry` but w You can further customize how the registry behaves by setting variables such as `REGISTRY_PVC_SIZE` with a [config file](/ref/config-files/) or `--set` on `zarf init`. -To see a full list of `variables` you can view the [`zarf.yaml` that defines the registry](https://github.com/defenseunicorns/zarf/blob/main/packages/zarf-registry/zarf.yaml). +To see a full list of `variables` you can view the [`zarf.yaml` that defines the registry](https://github.com/zarf-dev/zarf/blob/main/packages/zarf-registry/zarf.yaml). ::: @@ -216,7 +216,7 @@ root@machine ~ # zarf init --components k3s --set K3S_ARGS="" --confirm You can further customize how the git-server behaves by setting variables such as `GIT_SERVER_PVC_SIZE` with a [config file](/ref/config-files/) or `--set` on `zarf init`. -To see a full list of `variables` you can view the [zarf.yaml that defines the git-server](https://github.com/defenseunicorns/zarf/blob/main/packages/gitea/zarf.yaml). +To see a full list of `variables` you can view the [zarf.yaml that defines the git-server](https://github.com/zarf-dev/zarf/blob/main/packages/gitea/zarf.yaml). ::: @@ -273,7 +273,7 @@ components: In order to reproduce / build the following example, you will need to have the Zarf repository cloned locally. ```bash -git clone https://github.com/defenseunicorns/zarf.git +git clone https://github.com/zarf-dev/zarf.git cd zarf mv zarf.yaml zarf.yaml.bak ``` diff --git a/site/src/content/docs/ref/packages.mdx b/site/src/content/docs/ref/packages.mdx index 723c6ed845..5a2e3562ad 100644 --- a/site/src/content/docs/ref/packages.mdx +++ b/site/src/content/docs/ref/packages.mdx @@ -28,7 +28,7 @@ Typically, an init package is the first Zarf Package to be deployed on a cluster :::tip -Check out our [K3s cluster package](https://github.com/defenseunicorns/zarf/blob/main/packages/distros/k3s/zarf.yaml) to see an example of a Zarf Package that installs a Kubernetes distribution +Check out our [K3s cluster package](https://github.com/zarf-dev/zarf/blob/main/packages/distros/k3s/zarf.yaml) to see an example of a Zarf Package that installs a Kubernetes distribution ::: diff --git a/site/src/content/docs/roadmap.mdx b/site/src/content/docs/roadmap.mdx index 68878e6dbb..43a80e41ad 100644 --- a/site/src/content/docs/roadmap.mdx +++ b/site/src/content/docs/roadmap.mdx @@ -6,15 +6,15 @@ title: Roadmap The issue board for Zarf is hosted on a [GitHub Project Board](https://github.com/orgs/defenseunicorns/projects/1) that tracks the issues the Zarf team is working along with future work we are prioritizing. -If you would like to add bug reports or feature requests, please [add an issue](https://github.com/defenseunicorns/zarf/issues) to the GitHub repository under the appropriate template. If you have a more general question about a feature, feel free to ask the team in the [Zarf Kubernetes Slack Channel](https://kubernetes.slack.com/archives/C03B6BJAUJ3). +If you would like to add bug reports or feature requests, please [add an issue](https://github.com/zarf-dev/zarf/issues) to the GitHub repository under the appropriate template. If you have a more general question about a feature, feel free to ask the team in the [Zarf Kubernetes Slack Channel](https://kubernetes.slack.com/archives/C03B6BJAUJ3). -We also accept contributions from the community (regardless of where a particular bug or feature is in the queue), so feel free to read our [contributing guidelines](/contribute/contributor-guide) and [submit a PR](https://github.com/defenseunicorns/zarf/pulls)! You can also ask any development related questions in the [Zarf Dev Kubernetes Slack Channel](https://kubernetes.slack.com/archives/C03BP9Z3CMA). +We also accept contributions from the community (regardless of where a particular bug or feature is in the queue), so feel free to read our [contributing guidelines](/contribute/contributor-guide) and [submit a PR](https://github.com/zarf-dev/zarf/pulls)! You can also ask any development related questions in the [Zarf Dev Kubernetes Slack Channel](https://kubernetes.slack.com/archives/C03BP9Z3CMA). ## 2024 General Roadmap ### Q1: Community Building and Refactoring -- [X] - Establish a [monthly community meetup](https://github.com/defenseunicorns/zarf/issues/2202) to engage members of the community and answer questions. +- [X] - Establish a [monthly community meetup](https://github.com/zarf-dev/zarf/issues/2202) to engage members of the community and answer questions. - [ ] - Refactor and add tests to library code shared with [UDS-CLI](https://github.com/defenseunicorns/uds-cli) and split into a new GitHub repository. - [ ] - Gather OpenSSF donation requirements and clear off pre-reqs (additional maintainers and sponsor working group). @@ -81,6 +81,6 @@ Deprecated features are features that are no longer recommended for use and: ## General Availability (GA) Release -Right now, Zarf itself is still in its 'beta' phase. We are working on some final things before we release the official 1.0 General Availability (GA) release. The work still needed for the GA release can be found in our issues with [this filter](https://github.com/defenseunicorns/zarf/issues?q=is%3Aopen+is%3Aissue+label%3Aga). +Right now, Zarf itself is still in its 'beta' phase. We are working on some final things before we release the official 1.0 General Availability (GA) release. The work still needed for the GA release can be found in our issues with [this filter](https://github.com/zarf-dev/zarf/issues?q=is%3Aopen+is%3Aissue+label%3Aga). We are currently targeting Q4 2024 to have Zarf be generally available and will be pushing weekly releases until then to add necessary features and fix bugs as well as improve docs, architecture and test coverage behind the scenes. diff --git a/site/src/content/docs/support.mdx b/site/src/content/docs/support.mdx index 2cf650b416..b3d8aa75f1 100644 --- a/site/src/content/docs/support.mdx +++ b/site/src/content/docs/support.mdx @@ -8,4 +8,4 @@ title: Support - [Getting Started](/getting-started) 2. Look for an answer in the [Frequently Asked Questions](/faq). 3. Ask a question in [the Zarf Slack Channel](https://kubernetes.slack.com/archives/C03B6BJAUJ3) -4. [Read issues, report a bug, or request a new feature](https://github.com/defenseunicorns/zarf/issues) +4. [Read issues, report a bug, or request a new feature](https://github.com/zarf-dev/zarf/issues) diff --git a/site/src/content/docs/tutorials/0-creating-a-zarf-package.mdx b/site/src/content/docs/tutorials/0-creating-a-zarf-package.mdx index 84634b4386..4300d8c72f 100644 --- a/site/src/content/docs/tutorials/0-creating-a-zarf-package.mdx +++ b/site/src/content/docs/tutorials/0-creating-a-zarf-package.mdx @@ -27,7 +27,7 @@ In order to create a Zarf package you first need to have an idea of what applica ### Creating the Package Definition -A `zarf.yaml` file follows the [Zarf Package Schema](https://github.com/defenseunicorns/zarf/blob/main/zarf.schema.json) and allows us to specify package metadata and a set of components for us to deploy. We start a package definition with the `kind` of package we are making and `metadata` that describes the package. You can start our WordPress package by creating a new `zarf.yaml` with the following content: +A `zarf.yaml` file follows the [Zarf Package Schema](https://github.com/zarf-dev/zarf/blob/main/zarf.schema.json) and allows us to specify package metadata and a set of components for us to deploy. We start a package definition with the `kind` of package we are making and `metadata` that describes the package. You can start our WordPress package by creating a new `zarf.yaml` with the following content: ```yaml kind: ZarfPackageConfig # ZarfPackageConfig is the package kind for most normal zarf packages @@ -40,7 +40,7 @@ metadata: :::tip -You can run [`zarf dev lint `](/commands/zarf_dev_lint/) to validate against the [`zarf.schema.json`](https://github.com/defenseunicorns/zarf/blob/main/zarf.schema.json), or setup [VSCode](/ref/dev/#vscode) to see errors in real-time. +You can run [`zarf dev lint `](/commands/zarf_dev_lint/) to validate against the [`zarf.schema.json`](https://github.com/zarf-dev/zarf/blob/main/zarf.schema.json), or setup [VSCode](/ref/dev/#vscode) to see errors in real-time. ::: diff --git a/site/src/content/docs/tutorials/1-initializing-a-k8s-cluster.mdx b/site/src/content/docs/tutorials/1-initializing-a-k8s-cluster.mdx index 006d3a5743..deb26aa0ce 100644 --- a/site/src/content/docs/tutorials/1-initializing-a-k8s-cluster.mdx +++ b/site/src/content/docs/tutorials/1-initializing-a-k8s-cluster.mdx @@ -12,9 +12,9 @@ In this tutorial, we will demonstrate how to initialize Zarf onto a K8s cluster. Before beginning this tutorial you will need the following: -- The [Zarf](https://github.com/defenseunicorns/zarf) repository cloned: ([`git clone` Instructions](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository)) +- The [Zarf](https://github.com/zarf-dev/zarf) repository cloned: ([`git clone` Instructions](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository)) - Zarf binary installed on your $PATH: ([Installing Zarf](/getting-started/install/)) -- An init-package downloaded: ([init-package Build Instructions](/tutorials/0-creating-a-zarf-package/)) or ([Download Location](https://github.com/defenseunicorns/zarf/releases)) +- An init-package downloaded: ([init-package Build Instructions](/tutorials/0-creating-a-zarf-package/)) or ([Download Location](https://github.com/zarf-dev/zarf/releases)) - A local Kubernetes cluster ## Initializing the Cluster diff --git a/site/src/content/docs/tutorials/3-deploy-a-retro-arcade.mdx b/site/src/content/docs/tutorials/3-deploy-a-retro-arcade.mdx index 9364e98bbe..abfcd55b42 100644 --- a/site/src/content/docs/tutorials/3-deploy-a-retro-arcade.mdx +++ b/site/src/content/docs/tutorials/3-deploy-a-retro-arcade.mdx @@ -16,7 +16,7 @@ In previous tutorials, we learned how to [create a package](/tutorials/0-creatin Before beginning this tutorial you will need the following: -- The [Zarf](https://github.com/defenseunicorns/zarf) repository cloned: ([git clone instructions](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository)) +- The [Zarf](https://github.com/zarf-dev/zarf) repository cloned: ([git clone instructions](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository)) - Zarf binary installed on your $PATH: ([Installing Zarf](/getting-started/install/)) - [An initialized cluster](/tutorials/1-initializing-a-k8s-cluster/) diff --git a/site/src/content/docs/tutorials/4-creating-a-k8s-cluster-with-zarf.mdx b/site/src/content/docs/tutorials/4-creating-a-k8s-cluster-with-zarf.mdx index 81492468d7..2ca6056dbf 100644 --- a/site/src/content/docs/tutorials/4-creating-a-k8s-cluster-with-zarf.mdx +++ b/site/src/content/docs/tutorials/4-creating-a-k8s-cluster-with-zarf.mdx @@ -20,9 +20,9 @@ The 'k3s' component requires root access (not just `sudo`!) when deploying as it Before beginning this tutorial you will need the following: -- The [Zarf](https://github.com/defenseunicorns/zarf) repository cloned: ([`git clone` Instructions](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository)) +- The [Zarf](https://github.com/zarf-dev/zarf) repository cloned: ([`git clone` Instructions](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository)) - Zarf binary installed on your $PATH: ([Installing Zarf](/getting-started/install/)) -- An init-package built/downloaded: ([init-package Build Instructions](/tutorials/0-creating-a-zarf-package/)) or ([Download Location](https://github.com/defenseunicorns/zarf/releases)) +- An init-package built/downloaded: ([init-package Build Instructions](/tutorials/0-creating-a-zarf-package/)) or ([Download Location](https://github.com/zarf-dev/zarf/releases)) ## Creating the Cluster diff --git a/site/src/content/docs/tutorials/5-big-bang.mdx b/site/src/content/docs/tutorials/5-big-bang.mdx index b239f73ea3..bf073df59a 100644 --- a/site/src/content/docs/tutorials/5-big-bang.mdx +++ b/site/src/content/docs/tutorials/5-big-bang.mdx @@ -36,7 +36,7 @@ To learn more about Big Bang's requirements in general, see their documentation: Before beginning this tutorial you will need the following: - A local copy of the Zarf repository - - `git clone https://github.com/defenseunicorns/zarf.git` + - `git clone https://github.com/zarf-dev/zarf.git` - A kubernetes cluster onto which you can deploy Zarf and Big Bang - The latest version of the Zarf `cli` - Follow instructions on https://docs.zarf.dev/getting-started/install/ @@ -208,4 +208,4 @@ See the Troubleshooting section of the Big Bang Quick Start for help troubleshoo Also, ensure that you have followed all of the steps required in the [pre-requisites](#prerequisites) section. -If you feel that the error you are encountering is one with Zarf feel free to [open an issue](https://github.com/defenseunicorns/zarf/issues/new/choose) or reach out via [slack](https://kubernetes.slack.com/archives/C03B6BJAUJ3). +If you feel that the error you are encountering is one with Zarf feel free to [open an issue](https://github.com/zarf-dev/zarf/issues/new/choose) or reach out via [slack](https://kubernetes.slack.com/archives/C03B6BJAUJ3). diff --git a/site/src/content/docs/tutorials/7-custom-init-packages.mdx b/site/src/content/docs/tutorials/7-custom-init-packages.mdx index e99c8f08b6..1f1e78cad9 100644 --- a/site/src/content/docs/tutorials/7-custom-init-packages.mdx +++ b/site/src/content/docs/tutorials/7-custom-init-packages.mdx @@ -20,7 +20,7 @@ When creating a Zarf 'init' package, you must have a network connection so that Before beginning this tutorial you will need the following: -- The [Zarf](https://github.com/defenseunicorns/zarf) repository cloned: ([git clone instructions](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository)) +- The [Zarf](https://github.com/zarf-dev/zarf) repository cloned: ([git clone instructions](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository)) - Zarf binary installed on your $PATH: ([Installing Zarf](/getting-started/install/)) - (if building a local [`zarf-agent`](/faq#what-is-the-zarf-agent)) The [Docker CLI](https://docs.docker.com/desktop/) installed and the tools to [Build your own CLI](/getting-started/install/#building-from-source) diff --git a/site/src/content/docs/tutorials/9-package-create-differential.mdx b/site/src/content/docs/tutorials/9-package-create-differential.mdx index 176424805c..56207fab42 100644 --- a/site/src/content/docs/tutorials/9-package-create-differential.mdx +++ b/site/src/content/docs/tutorials/9-package-create-differential.mdx @@ -18,7 +18,7 @@ In this tutorial, you will create a differential package using Zarf. This is us For following along locally, please ensure the following prerequisites are met: - Zarf binary installed on your `$PATH`: ([Installing Zarf](/getting-started/install/)) -- The [Zarf](https://github.com/defenseunicorns/zarf) repository cloned: ([`git clone` Instructions](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository)) +- The [Zarf](https://github.com/zarf-dev/zarf) repository cloned: ([`git clone` Instructions](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository)) ## Create a Differential Package diff --git a/site/src/content/docs/tutorials/index.mdx b/site/src/content/docs/tutorials/index.mdx index 9c0b43ef6d..c8db1f80e5 100644 --- a/site/src/content/docs/tutorials/index.mdx +++ b/site/src/content/docs/tutorials/index.mdx @@ -11,9 +11,9 @@ This section of the documentation has a collection of tutorials that will help y If a tutorial has any prerequisites, they will be listed at the beginning of the tutorial with instructions on how to fulfill them. Almost all tutorials will have the following prerequisites/assumptions: -1. The [Zarf](https://github.com/defenseunicorns/zarf) repository cloned: ([git clone instructions](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository)) +1. The [Zarf](https://github.com/zarf-dev/zarf) repository cloned: ([git clone instructions](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository)) 1. You have a Zarf binary installed on your $PATH: ([Installing Zarf](/getting-started/install)) -1. You have an init-package built/downloaded: ([init-package Build Instructions](/tutorials/0-creating-a-zarf-package)) or ([Download Location](https://github.com/defenseunicorns/zarf/releases)) +1. You have an init-package built/downloaded: ([init-package Build Instructions](/tutorials/0-creating-a-zarf-package)) or ([Download Location](https://github.com/zarf-dev/zarf/releases)) 1. Have a kubernetes cluster running/available (ex. [k3s](https://k3s.io/)/[k3d](https://k3d.io/v5.4.1/)/[Kind](https://kind.sigs.k8s.io/docs/user/quick-start#installation)) ## Setting Up a Local Kubernetes Cluster diff --git a/src/cmd/common/setup.go b/src/cmd/common/setup.go index 6fab6e134b..703d9355bf 100644 --- a/src/cmd/common/setup.go +++ b/src/cmd/common/setup.go @@ -10,10 +10,10 @@ import ( "os" "time" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/config/lang" - "github.com/defenseunicorns/zarf/src/pkg/message" "github.com/pterm/pterm" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/pkg/message" ) // LogLevelCLI holds the log level as input from a command diff --git a/src/cmd/common/vendor.go b/src/cmd/common/vendor.go index 5f10726204..a8ff1db5ad 100644 --- a/src/cmd/common/vendor.go +++ b/src/cmd/common/vendor.go @@ -10,8 +10,8 @@ import ( "slices" - "github.com/defenseunicorns/zarf/src/config" "github.com/spf13/cobra" + "github.com/zarf-dev/zarf/src/config" ) var vendorCmds = []string{ diff --git a/src/cmd/common/viper.go b/src/cmd/common/viper.go index b852800611..bbd0f64c0c 100644 --- a/src/cmd/common/viper.go +++ b/src/cmd/common/viper.go @@ -8,10 +8,10 @@ import ( "os" "strings" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/config/lang" - "github.com/defenseunicorns/zarf/src/pkg/message" "github.com/spf13/viper" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/pkg/message" ) // Constants for use when loading configurations from viper config files diff --git a/src/cmd/connect.go b/src/cmd/connect.go index 89eb341b45..26f012660e 100644 --- a/src/cmd/connect.go +++ b/src/cmd/connect.go @@ -9,10 +9,10 @@ import ( "github.com/spf13/cobra" - "github.com/defenseunicorns/zarf/src/config/lang" - "github.com/defenseunicorns/zarf/src/pkg/cluster" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/utils/exec" + "github.com/zarf-dev/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/pkg/cluster" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/utils/exec" ) var ( diff --git a/src/cmd/destroy.go b/src/cmd/destroy.go index 0faa1d5c3e..1e3d1bb646 100644 --- a/src/cmd/destroy.go +++ b/src/cmd/destroy.go @@ -12,12 +12,12 @@ import ( "regexp" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/config/lang" - "github.com/defenseunicorns/zarf/src/internal/packager/helm" - "github.com/defenseunicorns/zarf/src/pkg/cluster" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/utils/exec" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/internal/packager/helm" + "github.com/zarf-dev/zarf/src/pkg/cluster" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/utils/exec" "github.com/spf13/cobra" ) @@ -68,7 +68,7 @@ var destroyCmd = &cobra.Command{ // Don't remove scripts we can't execute so the user can try to manually run continue } else if err != nil { - message.Debugf("Received error when trying to execute the script (%s): %#v", script, err) + return fmt.Errorf("received an error when executing the script %s: %w", script, err) } // Try to remove the script, but ignore any errors diff --git a/src/cmd/dev.go b/src/cmd/dev.go index a92dd2be3d..631b4de315 100644 --- a/src/cmd/dev.go +++ b/src/cmd/dev.go @@ -14,20 +14,20 @@ import ( "github.com/AlecAivazis/survey/v2" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/cmd/common" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/config/lang" - "github.com/defenseunicorns/zarf/src/pkg/lint" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/packager" - "github.com/defenseunicorns/zarf/src/pkg/transform" - "github.com/defenseunicorns/zarf/src/pkg/utils" - "github.com/defenseunicorns/zarf/src/types" "github.com/mholt/archiver/v3" "github.com/pterm/pterm" "github.com/sergi/go-diff/diffmatchpatch" "github.com/spf13/cobra" "github.com/spf13/viper" + "github.com/zarf-dev/zarf/src/cmd/common" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/pkg/lint" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/packager" + "github.com/zarf-dev/zarf/src/pkg/transform" + "github.com/zarf-dev/zarf/src/pkg/utils" + "github.com/zarf-dev/zarf/src/types" ) var extractPath string @@ -72,7 +72,7 @@ var devGenerateCmd = &cobra.Command{ Args: cobra.ExactArgs(1), Short: lang.CmdDevGenerateShort, Example: lang.CmdDevGenerateExample, - RunE: func(_ *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, args []string) error { pkgConfig.GenerateOpts.Name = args[0] pkgConfig.CreateOpts.BaseDir = "." @@ -84,7 +84,7 @@ var devGenerateCmd = &cobra.Command{ } defer pkgClient.ClearTempPaths() - err = pkgClient.Generate() + err = pkgClient.Generate(cmd.Context()) if err != nil { return err } diff --git a/src/cmd/initialize.go b/src/cmd/initialize.go index 2262454866..4d1c61363b 100644 --- a/src/cmd/initialize.go +++ b/src/cmd/initialize.go @@ -16,15 +16,15 @@ import ( "github.com/AlecAivazis/survey/v2" "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/pkg/oci" - "github.com/defenseunicorns/zarf/src/cmd/common" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/config/lang" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/packager" - "github.com/defenseunicorns/zarf/src/pkg/packager/sources" - "github.com/defenseunicorns/zarf/src/pkg/utils" - "github.com/defenseunicorns/zarf/src/pkg/zoci" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/cmd/common" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/packager" + "github.com/zarf-dev/zarf/src/pkg/packager/sources" + "github.com/zarf-dev/zarf/src/pkg/utils" + "github.com/zarf-dev/zarf/src/pkg/zoci" + "github.com/zarf-dev/zarf/src/types" "github.com/spf13/cobra" ) diff --git a/src/cmd/internal.go b/src/cmd/internal.go index b385564151..7ff0315356 100644 --- a/src/cmd/internal.go +++ b/src/cmd/internal.go @@ -13,17 +13,17 @@ import ( "strings" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/cmd/common" - "github.com/defenseunicorns/zarf/src/config/lang" - "github.com/defenseunicorns/zarf/src/internal/agent" - "github.com/defenseunicorns/zarf/src/internal/packager/git" - "github.com/defenseunicorns/zarf/src/pkg/cluster" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/types" "github.com/invopop/jsonschema" "github.com/spf13/cobra" "github.com/spf13/cobra/doc" "github.com/spf13/pflag" + "github.com/zarf-dev/zarf/src/cmd/common" + "github.com/zarf-dev/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/internal/agent" + "github.com/zarf-dev/zarf/src/internal/packager/git" + "github.com/zarf-dev/zarf/src/pkg/cluster" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/types" ) var ( diff --git a/src/cmd/package.go b/src/cmd/package.go index fa939e10bb..8b1405e25c 100644 --- a/src/cmd/package.go +++ b/src/cmd/package.go @@ -12,21 +12,21 @@ import ( "regexp" "strings" - "github.com/defenseunicorns/zarf/src/cmd/common" - "github.com/defenseunicorns/zarf/src/config/lang" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/packager/sources" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/cmd/common" + "github.com/zarf-dev/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/packager/sources" + "github.com/zarf-dev/zarf/src/types" "oras.land/oras-go/v2/registry" "github.com/AlecAivazis/survey/v2" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/pkg/cluster" - "github.com/defenseunicorns/zarf/src/pkg/packager" "github.com/spf13/cobra" "github.com/spf13/viper" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/pkg/cluster" + "github.com/zarf-dev/zarf/src/pkg/packager" ) var packageCmd = &cobra.Command{ diff --git a/src/cmd/root.go b/src/cmd/root.go index ee40254fe0..086a1cab6c 100644 --- a/src/cmd/root.go +++ b/src/cmd/root.go @@ -14,13 +14,13 @@ import ( "github.com/pterm/pterm" "github.com/spf13/cobra" - "github.com/defenseunicorns/zarf/src/cmd/common" - "github.com/defenseunicorns/zarf/src/cmd/tools" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/config/lang" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/cmd/common" + "github.com/zarf-dev/zarf/src/cmd/tools" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/types" ) var ( diff --git a/src/cmd/tools/archiver.go b/src/cmd/tools/archiver.go index d62ce32785..e3bf2f2629 100644 --- a/src/cmd/tools/archiver.go +++ b/src/cmd/tools/archiver.go @@ -10,13 +10,13 @@ import ( "path/filepath" "strings" - "github.com/defenseunicorns/zarf/src/config/lang" - "github.com/defenseunicorns/zarf/src/pkg/layout" "github.com/mholt/archiver/v3" "github.com/spf13/cobra" + "github.com/zarf-dev/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/pkg/layout" ) -// ldflags github.com/defenseunicorns/zarf/src/cmd/tools.archiverVersion=x.x.x +// ldflags github.com/zarf-dev/zarf/src/cmd/tools.archiverVersion=x.x.x var archiverVersion string var archiverCmd = &cobra.Command{ diff --git a/src/cmd/tools/common.go b/src/cmd/tools/common.go index 0844df9801..7f8f375be0 100644 --- a/src/cmd/tools/common.go +++ b/src/cmd/tools/common.go @@ -7,10 +7,10 @@ package tools import ( "fmt" - "github.com/defenseunicorns/zarf/src/cmd/common" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/config/lang" "github.com/spf13/cobra" + "github.com/zarf-dev/zarf/src/cmd/common" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/config/lang" ) var toolsCmd = &cobra.Command{ diff --git a/src/cmd/tools/crane.go b/src/cmd/tools/crane.go index ea8924be61..4df8daebb3 100644 --- a/src/cmd/tools/crane.go +++ b/src/cmd/tools/crane.go @@ -11,18 +11,18 @@ import ( "strings" "github.com/AlecAivazis/survey/v2" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/config/lang" - "github.com/defenseunicorns/zarf/src/internal/packager/images" - "github.com/defenseunicorns/zarf/src/pkg/cluster" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/transform" - "github.com/defenseunicorns/zarf/src/types" craneCmd "github.com/google/go-containerregistry/cmd/crane/cmd" "github.com/google/go-containerregistry/pkg/crane" "github.com/google/go-containerregistry/pkg/logs" v1 "github.com/google/go-containerregistry/pkg/v1" "github.com/spf13/cobra" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/internal/packager/images" + "github.com/zarf-dev/zarf/src/pkg/cluster" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/transform" + "github.com/zarf-dev/zarf/src/types" ) func init() { diff --git a/src/cmd/tools/helm.go b/src/cmd/tools/helm.go index dd2bf30d76..0d37f8d017 100644 --- a/src/cmd/tools/helm.go +++ b/src/cmd/tools/helm.go @@ -7,12 +7,12 @@ package tools import ( "os" - "github.com/defenseunicorns/zarf/src/cmd/tools/helm" - "github.com/defenseunicorns/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/cmd/tools/helm" + "github.com/zarf-dev/zarf/src/config/lang" "helm.sh/helm/v3/pkg/action" ) -// ldflags github.com/defenseunicorns/zarf/src/cmd/tools.helmVersion=x.x.x +// ldflags github.com/zarf-dev/zarf/src/cmd/tools.helmVersion=x.x.x var helmVersion string func init() { diff --git a/src/cmd/tools/helm/repo_add.go b/src/cmd/tools/helm/repo_add.go index de695bff5c..1d73a05467 100644 --- a/src/cmd/tools/helm/repo_add.go +++ b/src/cmd/tools/helm/repo_add.go @@ -31,10 +31,10 @@ import ( "time" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/pkg/cluster" "github.com/gofrs/flock" "github.com/pkg/errors" "github.com/spf13/cobra" + "github.com/zarf-dev/zarf/src/pkg/cluster" "golang.org/x/term" "sigs.k8s.io/yaml" diff --git a/src/cmd/tools/k9s.go b/src/cmd/tools/k9s.go index ceabe6a547..4866548ce8 100644 --- a/src/cmd/tools/k9s.go +++ b/src/cmd/tools/k9s.go @@ -7,9 +7,9 @@ package tools import ( "os" - "github.com/defenseunicorns/zarf/src/config/lang" k9s "github.com/derailed/k9s/cmd" "github.com/spf13/cobra" + "github.com/zarf-dev/zarf/src/config/lang" // This allows for go linkname to be used in this file. Go linkname is used so that we can pull the CLI flags from k9s and generate proper docs for the vendored tool. _ "unsafe" diff --git a/src/cmd/tools/kubectl.go b/src/cmd/tools/kubectl.go index e9eb820ff5..bccabe89f1 100644 --- a/src/cmd/tools/kubectl.go +++ b/src/cmd/tools/kubectl.go @@ -7,10 +7,10 @@ package tools import ( "os" - "github.com/defenseunicorns/zarf/src/cmd/common" - "github.com/defenseunicorns/zarf/src/config/lang" - "github.com/defenseunicorns/zarf/src/pkg/message" "github.com/spf13/cobra" + "github.com/zarf-dev/zarf/src/cmd/common" + "github.com/zarf-dev/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/pkg/message" kubeCLI "k8s.io/component-base/cli" kubeCmd "k8s.io/kubectl/pkg/cmd" diff --git a/src/cmd/tools/syft.go b/src/cmd/tools/syft.go index 1b466027a3..57051021a0 100644 --- a/src/cmd/tools/syft.go +++ b/src/cmd/tools/syft.go @@ -7,10 +7,10 @@ package tools import ( "github.com/anchore/clio" syftCLI "github.com/anchore/syft/cmd/syft/cli" - "github.com/defenseunicorns/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/config/lang" ) -// ldflags github.com/defenseunicorns/zarf/src/cmd/tools.syftVersion=x.x.x +// ldflags github.com/zarf-dev/zarf/src/cmd/tools.syftVersion=x.x.x var syftVersion string func init() { diff --git a/src/cmd/tools/wait.go b/src/cmd/tools/wait.go index bb767ec972..fda0344fbc 100644 --- a/src/cmd/tools/wait.go +++ b/src/cmd/tools/wait.go @@ -8,10 +8,10 @@ import ( "fmt" "time" - "github.com/defenseunicorns/zarf/src/config/lang" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/utils" "github.com/spf13/cobra" + "github.com/zarf-dev/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/utils" // Import to initialize client auth plugins. _ "k8s.io/client-go/plugin/pkg/client/auth" diff --git a/src/cmd/tools/yq.go b/src/cmd/tools/yq.go index 4dbf43ddff..85d72ab767 100644 --- a/src/cmd/tools/yq.go +++ b/src/cmd/tools/yq.go @@ -5,8 +5,8 @@ package tools import ( - "github.com/defenseunicorns/zarf/src/config/lang" yq "github.com/mikefarah/yq/v4/cmd" + "github.com/zarf-dev/zarf/src/config/lang" ) func init() { diff --git a/src/cmd/tools/zarf.go b/src/cmd/tools/zarf.go index f911b2ec40..3f97be20eb 100644 --- a/src/cmd/tools/zarf.go +++ b/src/cmd/tools/zarf.go @@ -18,18 +18,18 @@ import ( "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/pkg/oci" - "github.com/defenseunicorns/zarf/src/cmd/common" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/config/lang" - "github.com/defenseunicorns/zarf/src/internal/packager/git" - "github.com/defenseunicorns/zarf/src/internal/packager/helm" - "github.com/defenseunicorns/zarf/src/internal/packager/template" - "github.com/defenseunicorns/zarf/src/pkg/cluster" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/packager/sources" - "github.com/defenseunicorns/zarf/src/pkg/pki" - "github.com/defenseunicorns/zarf/src/pkg/zoci" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/cmd/common" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/internal/packager/git" + "github.com/zarf-dev/zarf/src/internal/packager/helm" + "github.com/zarf-dev/zarf/src/internal/packager/template" + "github.com/zarf-dev/zarf/src/pkg/cluster" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/packager/sources" + "github.com/zarf-dev/zarf/src/pkg/pki" + "github.com/zarf-dev/zarf/src/pkg/zoci" + "github.com/zarf-dev/zarf/src/types" ) var subAltNames []string diff --git a/src/cmd/version.go b/src/cmd/version.go index 589cab9929..26299c7db5 100644 --- a/src/cmd/version.go +++ b/src/cmd/version.go @@ -15,8 +15,8 @@ import ( goyaml "github.com/goccy/go-yaml" "github.com/spf13/cobra" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/config/lang" ) var outputFormat string diff --git a/src/config/config.go b/src/config/config.go index f9dfc580ab..4f55f48e61 100644 --- a/src/config/config.go +++ b/src/config/config.go @@ -12,12 +12,12 @@ import ( "strings" "time" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/types" ) // Zarf Global Configuration Constants. const ( - GithubProject = "defenseunicorns/zarf" + GithubProject = "zarf-dev/zarf" ZarfAgentHost = "agent-hook.zarf.svc" diff --git a/src/extensions/bigbang/banner.go b/src/extensions/bigbang/banner.go index 07314b3141..e6791eec58 100644 --- a/src/extensions/bigbang/banner.go +++ b/src/extensions/bigbang/banner.go @@ -5,8 +5,8 @@ package bigbang import ( - "github.com/defenseunicorns/zarf/src/pkg/message" "github.com/pterm/pterm" + "github.com/zarf-dev/zarf/src/pkg/message" ) func printBanner() { diff --git a/src/extensions/bigbang/bigbang.go b/src/extensions/bigbang/bigbang.go index b89b61f460..e312f382f9 100644 --- a/src/extensions/bigbang/bigbang.go +++ b/src/extensions/bigbang/bigbang.go @@ -5,6 +5,7 @@ package bigbang import ( + "context" "fmt" "os" "path" @@ -14,15 +15,15 @@ import ( "github.com/Masterminds/semver/v3" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/internal/packager/helm" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/utils" - "github.com/defenseunicorns/zarf/src/pkg/variables" - "github.com/defenseunicorns/zarf/src/types" - "github.com/defenseunicorns/zarf/src/types/extensions" fluxHelmCtrl "github.com/fluxcd/helm-controller/api/v2beta1" fluxSrcCtrl "github.com/fluxcd/source-controller/api/v1beta2" + "github.com/zarf-dev/zarf/src/internal/packager/helm" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/utils" + "github.com/zarf-dev/zarf/src/pkg/variables" + "github.com/zarf-dev/zarf/src/types" + "github.com/zarf-dev/zarf/src/types/extensions" "helm.sh/helm/v3/pkg/chartutil" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +43,7 @@ var tenMins = metav1.Duration{ // Run mutates a component that should deploy Big Bang to a set of manifests // that contain the flux deployment of Big Bang -func Run(YOLO bool, tmpPaths *layout.ComponentPaths, c types.ZarfComponent) (types.ZarfComponent, error) { +func Run(ctx context.Context, YOLO bool, tmpPaths *layout.ComponentPaths, c types.ZarfComponent) (types.ZarfComponent, error) { cfg := c.Extensions.BigBang manifests := []types.ZarfManifest{} @@ -99,7 +100,7 @@ func Run(YOLO bool, tmpPaths *layout.ComponentPaths, c types.ZarfComponent) (typ ) // Download the chart from Git and save it to a temporary directory. - err = helmCfg.PackageChartFromGit(c.DeprecatedCosignKeyPath) + err = helmCfg.PackageChartFromGit(ctx, c.DeprecatedCosignKeyPath) if err != nil { return c, fmt.Errorf("unable to download Big Bang Chart: %w", err) } @@ -220,7 +221,7 @@ func Run(YOLO bool, tmpPaths *layout.ComponentPaths, c types.ZarfComponent) (typ gitRepo := gitRepos[hr.NamespacedSource] values := hrValues[namespacedName] - images, err := findImagesforBBChartRepo(gitRepo, values) + images, err := findImagesforBBChartRepo(ctx, gitRepo, values) if err != nil { return c, fmt.Errorf("unable to find images for chart repo: %w", err) } @@ -523,7 +524,7 @@ func addBigBangManifests(YOLO bool, manifestDir string, cfg *extensions.BigBang) } // findImagesforBBChartRepo finds and returns the images for the Big Bang chart repo -func findImagesforBBChartRepo(repo string, values chartutil.Values) (images []string, err error) { +func findImagesforBBChartRepo(ctx context.Context, repo string, values chartutil.Values) (images []string, err error) { matches := strings.Split(repo, "@") if len(matches) < 2 { return images, fmt.Errorf("cannot convert git repo %s to helm chart without a version tag", repo) @@ -532,7 +533,7 @@ func findImagesforBBChartRepo(repo string, values chartutil.Values) (images []st spinner := message.NewProgressSpinner("Discovering images in %s", repo) defer spinner.Stop() - gitPath, err := helm.DownloadChartFromGitToTemp(repo, spinner) + gitPath, err := helm.DownloadChartFromGitToTemp(ctx, repo, spinner) if err != nil { return images, err } diff --git a/src/extensions/bigbang/flux.go b/src/extensions/bigbang/flux.go index e67129c07c..d67097f26c 100644 --- a/src/extensions/bigbang/flux.go +++ b/src/extensions/bigbang/flux.go @@ -11,11 +11,11 @@ import ( "path/filepath" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/internal/packager/kustomize" - "github.com/defenseunicorns/zarf/src/pkg/utils" - "github.com/defenseunicorns/zarf/src/types" - "github.com/defenseunicorns/zarf/src/types/extensions" fluxHelmCtrl "github.com/fluxcd/helm-controller/api/v2beta1" + "github.com/zarf-dev/zarf/src/internal/packager/kustomize" + "github.com/zarf-dev/zarf/src/pkg/utils" + "github.com/zarf-dev/zarf/src/types" + "github.com/zarf-dev/zarf/src/types/extensions" "helm.sh/helm/v3/pkg/chartutil" v1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" diff --git a/src/extensions/bigbang/manifests.go b/src/extensions/bigbang/manifests.go index cec481d6cb..3eb88bee6c 100644 --- a/src/extensions/bigbang/manifests.go +++ b/src/extensions/bigbang/manifests.go @@ -11,9 +11,9 @@ import ( "strings" "github.com/Masterminds/semver/v3" - "github.com/defenseunicorns/zarf/src/types/extensions" fluxHelmCtrl "github.com/fluxcd/helm-controller/api/v2beta1" fluxSrcCtrl "github.com/fluxcd/source-controller/api/v1" + "github.com/zarf-dev/zarf/src/types/extensions" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/src/extensions/bigbang/test/bigbang_test.go b/src/extensions/bigbang/test/bigbang_test.go index 4e016c6a6f..641ba566d1 100644 --- a/src/extensions/bigbang/test/bigbang_test.go +++ b/src/extensions/bigbang/test/bigbang_test.go @@ -14,10 +14,10 @@ import ( "strings" "testing" - "github.com/defenseunicorns/zarf/src/pkg/cluster" - "github.com/defenseunicorns/zarf/src/pkg/utils/exec" - test "github.com/defenseunicorns/zarf/src/test" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/pkg/cluster" + "github.com/zarf-dev/zarf/src/pkg/utils/exec" + test "github.com/zarf-dev/zarf/src/test" ) // The Big Bang project ID on Repo1 diff --git a/src/internal/agent/hooks/argocd-application.go b/src/internal/agent/hooks/argocd-application.go index b9197bae51..8886ba2ff9 100644 --- a/src/internal/agent/hooks/argocd-application.go +++ b/src/internal/agent/hooks/argocd-application.go @@ -10,12 +10,12 @@ import ( "fmt" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/config/lang" - "github.com/defenseunicorns/zarf/src/internal/agent/operations" - "github.com/defenseunicorns/zarf/src/pkg/cluster" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/transform" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/internal/agent/operations" + "github.com/zarf-dev/zarf/src/pkg/cluster" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/transform" + "github.com/zarf-dev/zarf/src/types" v1 "k8s.io/api/admission/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/src/internal/agent/hooks/argocd-application_test.go b/src/internal/agent/hooks/argocd-application_test.go index 6ef39b2730..31ec452959 100644 --- a/src/internal/agent/hooks/argocd-application_test.go +++ b/src/internal/agent/hooks/argocd-application_test.go @@ -9,10 +9,10 @@ import ( "net/http" "testing" - "github.com/defenseunicorns/zarf/src/internal/agent/http/admission" - "github.com/defenseunicorns/zarf/src/internal/agent/operations" - "github.com/defenseunicorns/zarf/src/types" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/internal/agent/http/admission" + "github.com/zarf-dev/zarf/src/internal/agent/operations" + "github.com/zarf-dev/zarf/src/types" v1 "k8s.io/api/admission/v1" "k8s.io/apimachinery/pkg/runtime" ) diff --git a/src/internal/agent/hooks/argocd-repository.go b/src/internal/agent/hooks/argocd-repository.go index 23e05df999..2311b50511 100644 --- a/src/internal/agent/hooks/argocd-repository.go +++ b/src/internal/agent/hooks/argocd-repository.go @@ -11,12 +11,12 @@ import ( "fmt" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/config/lang" - "github.com/defenseunicorns/zarf/src/internal/agent/operations" - "github.com/defenseunicorns/zarf/src/pkg/cluster" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/transform" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/internal/agent/operations" + "github.com/zarf-dev/zarf/src/pkg/cluster" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/transform" + "github.com/zarf-dev/zarf/src/types" v1 "k8s.io/api/admission/v1" corev1 "k8s.io/api/core/v1" ) diff --git a/src/internal/agent/hooks/argocd-repository_test.go b/src/internal/agent/hooks/argocd-repository_test.go index 4506b682e1..fdc99fe1c2 100644 --- a/src/internal/agent/hooks/argocd-repository_test.go +++ b/src/internal/agent/hooks/argocd-repository_test.go @@ -10,10 +10,10 @@ import ( "net/http" "testing" - "github.com/defenseunicorns/zarf/src/internal/agent/http/admission" - "github.com/defenseunicorns/zarf/src/internal/agent/operations" - "github.com/defenseunicorns/zarf/src/types" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/internal/agent/http/admission" + "github.com/zarf-dev/zarf/src/internal/agent/operations" + "github.com/zarf-dev/zarf/src/types" v1 "k8s.io/api/admission/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/src/internal/agent/hooks/common.go b/src/internal/agent/hooks/common.go index ed1de69797..52ea3bb509 100644 --- a/src/internal/agent/hooks/common.go +++ b/src/internal/agent/hooks/common.go @@ -4,7 +4,7 @@ // Package hooks contains the mutation hooks for the Zarf agent. package hooks -import "github.com/defenseunicorns/zarf/src/internal/agent/operations" +import "github.com/zarf-dev/zarf/src/internal/agent/operations" func getLabelPatch(currLabels map[string]string) operations.PatchOperation { if currLabels == nil { diff --git a/src/internal/agent/hooks/flux-gitrepo.go b/src/internal/agent/hooks/flux-gitrepo.go index 8256b40aae..079ee6a8e0 100644 --- a/src/internal/agent/hooks/flux-gitrepo.go +++ b/src/internal/agent/hooks/flux-gitrepo.go @@ -10,14 +10,14 @@ import ( "fmt" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/config/lang" - "github.com/defenseunicorns/zarf/src/internal/agent/operations" - "github.com/defenseunicorns/zarf/src/pkg/cluster" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/transform" fluxmeta "github.com/fluxcd/pkg/apis/meta" flux "github.com/fluxcd/source-controller/api/v1" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/internal/agent/operations" + "github.com/zarf-dev/zarf/src/pkg/cluster" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/transform" v1 "k8s.io/api/admission/v1" ) diff --git a/src/internal/agent/hooks/flux-gitrepo_test.go b/src/internal/agent/hooks/flux-gitrepo_test.go index a68cbfe591..dc9c17a093 100644 --- a/src/internal/agent/hooks/flux-gitrepo_test.go +++ b/src/internal/agent/hooks/flux-gitrepo_test.go @@ -9,13 +9,13 @@ import ( "net/http" "testing" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/internal/agent/http/admission" - "github.com/defenseunicorns/zarf/src/internal/agent/operations" - "github.com/defenseunicorns/zarf/src/types" fluxmeta "github.com/fluxcd/pkg/apis/meta" flux "github.com/fluxcd/source-controller/api/v1" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/internal/agent/http/admission" + "github.com/zarf-dev/zarf/src/internal/agent/operations" + "github.com/zarf-dev/zarf/src/types" v1 "k8s.io/api/admission/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" diff --git a/src/internal/agent/hooks/flux-helmrepo.go b/src/internal/agent/hooks/flux-helmrepo.go index 6fb0e7e712..90aab22f7a 100644 --- a/src/internal/agent/hooks/flux-helmrepo.go +++ b/src/internal/agent/hooks/flux-helmrepo.go @@ -11,14 +11,14 @@ import ( "strings" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/config/lang" - "github.com/defenseunicorns/zarf/src/internal/agent/operations" - "github.com/defenseunicorns/zarf/src/pkg/cluster" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/transform" "github.com/fluxcd/pkg/apis/meta" flux "github.com/fluxcd/source-controller/api/v1" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/internal/agent/operations" + "github.com/zarf-dev/zarf/src/pkg/cluster" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/transform" v1 "k8s.io/api/admission/v1" ) diff --git a/src/internal/agent/hooks/flux-helmrepo_test.go b/src/internal/agent/hooks/flux-helmrepo_test.go index 85895bd31b..d0e48a0074 100644 --- a/src/internal/agent/hooks/flux-helmrepo_test.go +++ b/src/internal/agent/hooks/flux-helmrepo_test.go @@ -9,13 +9,13 @@ import ( "net/http" "testing" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/internal/agent/http/admission" - "github.com/defenseunicorns/zarf/src/internal/agent/operations" - "github.com/defenseunicorns/zarf/src/types" fluxmeta "github.com/fluxcd/pkg/apis/meta" flux "github.com/fluxcd/source-controller/api/v1" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/internal/agent/http/admission" + "github.com/zarf-dev/zarf/src/internal/agent/operations" + "github.com/zarf-dev/zarf/src/types" v1 "k8s.io/api/admission/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/src/internal/agent/hooks/flux-ocirepo.go b/src/internal/agent/hooks/flux-ocirepo.go index 00d7ded917..045b315e3a 100644 --- a/src/internal/agent/hooks/flux-ocirepo.go +++ b/src/internal/agent/hooks/flux-ocirepo.go @@ -10,14 +10,14 @@ import ( "fmt" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/config/lang" - "github.com/defenseunicorns/zarf/src/internal/agent/operations" - "github.com/defenseunicorns/zarf/src/pkg/cluster" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/transform" "github.com/fluxcd/pkg/apis/meta" flux "github.com/fluxcd/source-controller/api/v1beta2" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/internal/agent/operations" + "github.com/zarf-dev/zarf/src/pkg/cluster" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/transform" v1 "k8s.io/api/admission/v1" ) diff --git a/src/internal/agent/hooks/flux-ocirepo_test.go b/src/internal/agent/hooks/flux-ocirepo_test.go index 4b2ff6cf57..5cab4d2530 100644 --- a/src/internal/agent/hooks/flux-ocirepo_test.go +++ b/src/internal/agent/hooks/flux-ocirepo_test.go @@ -9,13 +9,13 @@ import ( "net/http" "testing" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/internal/agent/http/admission" - "github.com/defenseunicorns/zarf/src/internal/agent/operations" - "github.com/defenseunicorns/zarf/src/types" fluxmeta "github.com/fluxcd/pkg/apis/meta" flux "github.com/fluxcd/source-controller/api/v1beta2" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/internal/agent/http/admission" + "github.com/zarf-dev/zarf/src/internal/agent/operations" + "github.com/zarf-dev/zarf/src/types" v1 "k8s.io/api/admission/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/src/internal/agent/hooks/pods.go b/src/internal/agent/hooks/pods.go index a152aa4a8a..1eaccb5fbb 100644 --- a/src/internal/agent/hooks/pods.go +++ b/src/internal/agent/hooks/pods.go @@ -9,12 +9,12 @@ import ( "encoding/json" "fmt" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/config/lang" - "github.com/defenseunicorns/zarf/src/internal/agent/operations" - "github.com/defenseunicorns/zarf/src/pkg/cluster" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/transform" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/internal/agent/operations" + "github.com/zarf-dev/zarf/src/pkg/cluster" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/transform" v1 "k8s.io/api/admission/v1" corev1 "k8s.io/api/core/v1" diff --git a/src/internal/agent/hooks/pods_test.go b/src/internal/agent/hooks/pods_test.go index 3a41f9227c..dafa786f8c 100644 --- a/src/internal/agent/hooks/pods_test.go +++ b/src/internal/agent/hooks/pods_test.go @@ -9,11 +9,11 @@ import ( "net/http" "testing" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/internal/agent/http/admission" - "github.com/defenseunicorns/zarf/src/internal/agent/operations" - "github.com/defenseunicorns/zarf/src/types" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/internal/agent/http/admission" + "github.com/zarf-dev/zarf/src/internal/agent/operations" + "github.com/zarf-dev/zarf/src/types" v1 "k8s.io/api/admission/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/src/internal/agent/hooks/utils_test.go b/src/internal/agent/hooks/utils_test.go index f2d4ed6136..84ee8a4c47 100644 --- a/src/internal/agent/hooks/utils_test.go +++ b/src/internal/agent/hooks/utils_test.go @@ -11,10 +11,10 @@ import ( "net/http/httptest" "testing" - "github.com/defenseunicorns/zarf/src/internal/agent/operations" - "github.com/defenseunicorns/zarf/src/pkg/cluster" - "github.com/defenseunicorns/zarf/src/types" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/internal/agent/operations" + "github.com/zarf-dev/zarf/src/pkg/cluster" + "github.com/zarf-dev/zarf/src/types" v1 "k8s.io/api/admission/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/src/internal/agent/http/admission/handler.go b/src/internal/agent/http/admission/handler.go index f1d3cd8ead..56589a7c73 100644 --- a/src/internal/agent/http/admission/handler.go +++ b/src/internal/agent/http/admission/handler.go @@ -12,9 +12,9 @@ import ( "io" "net/http" - "github.com/defenseunicorns/zarf/src/config/lang" - "github.com/defenseunicorns/zarf/src/internal/agent/operations" - "github.com/defenseunicorns/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/internal/agent/operations" + "github.com/zarf-dev/zarf/src/pkg/message" corev1 "k8s.io/api/admission/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" diff --git a/src/internal/agent/http/proxy.go b/src/internal/agent/http/proxy.go index 2a78b88eea..719ef17281 100644 --- a/src/internal/agent/http/proxy.go +++ b/src/internal/agent/http/proxy.go @@ -14,10 +14,10 @@ import ( "net/url" "strings" - "github.com/defenseunicorns/zarf/src/config/lang" - "github.com/defenseunicorns/zarf/src/pkg/cluster" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/transform" + "github.com/zarf-dev/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/pkg/cluster" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/transform" ) // ProxyHandler constructs a new httputil.ReverseProxy and returns an http handler. @@ -112,7 +112,9 @@ func proxyResponseTransform(resp *http.Response) error { message.Debugf("Before Resp Location %#v", resp.Header.Get("Location")) locationURL, err := url.Parse(resp.Header.Get("Location")) - message.Debugf("%#v", err) + if err != nil { + return err + } locationURL.Path = transform.NoTransform + locationURL.Path locationURL.Host = resp.Request.Header.Get("X-Forwarded-Host") diff --git a/src/internal/agent/http/server.go b/src/internal/agent/http/server.go index 62fb72c59d..b5953ee0e2 100644 --- a/src/internal/agent/http/server.go +++ b/src/internal/agent/http/server.go @@ -10,11 +10,11 @@ import ( "net/http" "time" - "github.com/defenseunicorns/zarf/src/internal/agent/hooks" - "github.com/defenseunicorns/zarf/src/internal/agent/http/admission" - "github.com/defenseunicorns/zarf/src/pkg/cluster" - "github.com/defenseunicorns/zarf/src/pkg/message" "github.com/prometheus/client_golang/prometheus/promhttp" + "github.com/zarf-dev/zarf/src/internal/agent/hooks" + "github.com/zarf-dev/zarf/src/internal/agent/http/admission" + "github.com/zarf-dev/zarf/src/pkg/cluster" + "github.com/zarf-dev/zarf/src/pkg/message" ) // NewAdmissionServer creates a http.Server for the mutating webhook admission handler. diff --git a/src/internal/agent/operations/hook.go b/src/internal/agent/operations/hook.go index 5ce42b8810..627ce58094 100644 --- a/src/internal/agent/operations/hook.go +++ b/src/internal/agent/operations/hook.go @@ -7,8 +7,8 @@ package operations import ( "fmt" - "github.com/defenseunicorns/zarf/src/config/lang" - "github.com/defenseunicorns/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/pkg/message" admission "k8s.io/api/admission/v1" ) diff --git a/src/internal/agent/start.go b/src/internal/agent/start.go index 9acd2afcc4..80a04c642f 100644 --- a/src/internal/agent/start.go +++ b/src/internal/agent/start.go @@ -12,9 +12,9 @@ import ( "golang.org/x/sync/errgroup" - "github.com/defenseunicorns/zarf/src/config/lang" - agentHttp "github.com/defenseunicorns/zarf/src/internal/agent/http" - "github.com/defenseunicorns/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/config/lang" + agentHttp "github.com/zarf-dev/zarf/src/internal/agent/http" + "github.com/zarf-dev/zarf/src/pkg/message" ) // Heavily influenced by https://github.com/douglasmakey/admissioncontroller and diff --git a/src/internal/packager/git/checkout.go b/src/internal/packager/git/checkout.go index 2a39382cda..4441e48873 100644 --- a/src/internal/packager/git/checkout.go +++ b/src/internal/packager/git/checkout.go @@ -7,10 +7,10 @@ package git import ( "fmt" - "github.com/defenseunicorns/zarf/src/pkg/message" "github.com/go-git/go-git/v5" "github.com/go-git/go-git/v5/plumbing" "github.com/go-git/go-git/v5/plumbing/object" + "github.com/zarf-dev/zarf/src/pkg/message" ) // CheckoutTag performs a `git checkout` of the provided tag to a detached HEAD. diff --git a/src/internal/packager/git/clone.go b/src/internal/packager/git/clone.go index 0123b81f2f..2f607670e7 100644 --- a/src/internal/packager/git/clone.go +++ b/src/internal/packager/git/clone.go @@ -9,16 +9,16 @@ import ( "errors" "strings" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/utils" - "github.com/defenseunicorns/zarf/src/pkg/utils/exec" "github.com/go-git/go-git/v5" goConfig "github.com/go-git/go-git/v5/config" "github.com/go-git/go-git/v5/plumbing" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/utils" + "github.com/zarf-dev/zarf/src/pkg/utils/exec" ) // clone performs a `git clone` of a given repo. -func (g *Git) clone(gitURL string, ref plumbing.ReferenceName, shallow bool) error { +func (g *Git) clone(ctx context.Context, gitURL string, ref plumbing.ReferenceName, shallow bool) error { cloneOptions := &git.CloneOptions{ URL: gitURL, Progress: g.Spinner, @@ -38,7 +38,10 @@ func (g *Git) clone(gitURL string, ref plumbing.ReferenceName, shallow bool) err } // Setup git credentials if we have them, ignore if we don't. - gitCred := utils.FindAuthForHost(gitURL) + gitCred, err := utils.FindAuthForHost(gitURL) + if err != nil { + return err + } if gitCred != nil { cloneOptions.Auth = &gitCred.Auth } @@ -47,7 +50,7 @@ func (g *Git) clone(gitURL string, ref plumbing.ReferenceName, shallow bool) err repo, err := git.PlainClone(g.GitPath, false, cloneOptions) if err != nil { message.Notef("Falling back to host 'git', failed to clone the repo %q with Zarf: %s", gitURL, err.Error()) - return g.gitCloneFallback(gitURL, ref, shallow) + return g.gitCloneFallback(ctx, gitURL, ref, shallow) } // If we're cloning the whole repo, we need to also fetch the other branches besides the default. @@ -72,7 +75,7 @@ func (g *Git) clone(gitURL string, ref plumbing.ReferenceName, shallow bool) err } // gitCloneFallback is a fallback if go-git fails to clone a repo. -func (g *Git) gitCloneFallback(gitURL string, ref plumbing.ReferenceName, shallow bool) error { +func (g *Git) gitCloneFallback(ctx context.Context, gitURL string, ref plumbing.ReferenceName, shallow bool) error { // If we can't clone with go-git, fallback to the host clone // Only support "all tags" due to the azure clone url format including a username cloneArgs := []string{"clone", "--origin", onlineRemoteName, gitURL, g.GitPath} @@ -96,7 +99,7 @@ func (g *Git) gitCloneFallback(gitURL string, ref plumbing.ReferenceName, shallo message.Command("git %s", strings.Join(cloneArgs, " ")) - _, _, err := exec.CmdWithContext(context.TODO(), cloneExecConfig, "git", cloneArgs...) + _, _, err := exec.CmdWithContext(ctx, cloneExecConfig, "git", cloneArgs...) if err != nil { return err } @@ -113,7 +116,7 @@ func (g *Git) gitCloneFallback(gitURL string, ref plumbing.ReferenceName, shallo message.Command("git %s", strings.Join(fetchArgs, " ")) - _, _, err := exec.CmdWithContext(context.TODO(), fetchExecConfig, "git", fetchArgs...) + _, _, err := exec.CmdWithContext(ctx, fetchExecConfig, "git", fetchArgs...) if err != nil { return err } diff --git a/src/internal/packager/git/common.go b/src/internal/packager/git/common.go index 1c03fd3343..6864d3dea5 100644 --- a/src/internal/packager/git/common.go +++ b/src/internal/packager/git/common.go @@ -8,9 +8,9 @@ import ( "fmt" "strings" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/types" "github.com/go-git/go-git/v5/plumbing" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/types" ) // Git is the main struct for managing git repositories. diff --git a/src/internal/packager/git/gitea.go b/src/internal/packager/git/gitea.go index 7bf9afe53f..a6c2f4b48a 100644 --- a/src/internal/packager/git/gitea.go +++ b/src/internal/packager/git/gitea.go @@ -16,10 +16,10 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/pkg/cluster" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/pkg/cluster" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/types" ) // CreateTokenResponse is the response given from creating a token in Gitea diff --git a/src/internal/packager/git/pull.go b/src/internal/packager/git/pull.go index 79313cde32..5d9e6f1006 100644 --- a/src/internal/packager/git/pull.go +++ b/src/internal/packager/git/pull.go @@ -5,18 +5,19 @@ package git import ( + "context" "fmt" "path" "strings" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/pkg/transform" - "github.com/defenseunicorns/zarf/src/pkg/utils" "github.com/go-git/go-git/v5/plumbing" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/pkg/transform" + "github.com/zarf-dev/zarf/src/pkg/utils" ) // DownloadRepoToTemp clones or updates a repo into a temp folder to perform ephemeral actions (i.e. process chart repos). -func (g *Git) DownloadRepoToTemp(gitURL string) error { +func (g *Git) DownloadRepoToTemp(ctx context.Context, gitURL string) error { g.Spinner.Updatef("g.DownloadRepoToTemp(%s)", gitURL) path, err := utils.MakeTempDir(config.CommonOptions.TempDirectory) @@ -26,7 +27,7 @@ func (g *Git) DownloadRepoToTemp(gitURL string) error { // If downloading to temp, set this as a shallow clone to only pull the exact // gitURL w/ ref that was specified since we will throw away git history anyway - if err = g.Pull(gitURL, path, true); err != nil { + if err = g.Pull(ctx, gitURL, path, true); err != nil { return fmt.Errorf("unable to pull the git repo at %s: %w", gitURL, err) } @@ -34,7 +35,7 @@ func (g *Git) DownloadRepoToTemp(gitURL string) error { } // Pull clones or updates a git repository into the target folder. -func (g *Git) Pull(gitURL, targetFolder string, shallow bool) error { +func (g *Git) Pull(ctx context.Context, gitURL, targetFolder string, shallow bool) error { g.Spinner.Updatef("Processing git repo %s", gitURL) // Split the remote url and the zarf reference @@ -59,7 +60,7 @@ func (g *Git) Pull(gitURL, targetFolder string, shallow bool) error { g.GitPath = path.Join(targetFolder, repoFolder) // Clone the git repository. - err = g.clone(gitURLNoRef, ref, shallow) + err = g.clone(ctx, gitURLNoRef, ref, shallow) if err != nil { return fmt.Errorf("not a valid git repo or unable to clone (%s): %w", gitURL, err) } diff --git a/src/internal/packager/git/push.go b/src/internal/packager/git/push.go index 9bd52e2c79..494ee40db6 100644 --- a/src/internal/packager/git/push.go +++ b/src/internal/packager/git/push.go @@ -10,13 +10,13 @@ import ( "os" "path" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/transform" "github.com/go-git/go-git/v5" goConfig "github.com/go-git/go-git/v5/config" "github.com/go-git/go-git/v5/plumbing" "github.com/go-git/go-git/v5/plumbing/transport" "github.com/go-git/go-git/v5/plumbing/transport/http" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/transform" ) // PushRepo pushes a git repository from the local path to the configured git server. @@ -145,7 +145,7 @@ func (g *Git) push(repo *git.Repository, spinner *message.Spinner) error { RemoteName: offlineRemoteName, Auth: &gitCred, Progress: spinner, - // TODO: (@JEFFMCCOY) add the parsing for the `+` force prefix (see https://github.com/defenseunicorns/zarf/issues/1410) + // TODO: (@JEFFMCCOY) add the parsing for the `+` force prefix (see https://github.com/zarf-dev/zarf/issues/1410) //Force: isForce, // If a provided refspec doesn't push anything, it is just ignored RefSpecs: []goConfig.RefSpec{ diff --git a/src/internal/packager/helm/chart.go b/src/internal/packager/helm/chart.go index 0ff647b60a..f9ac5eefe0 100644 --- a/src/internal/packager/helm/chart.go +++ b/src/internal/packager/helm/chart.go @@ -24,9 +24,9 @@ import ( "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/types" ) // InstallOrUpgradeChart performs a helm install of the given chart. diff --git a/src/internal/packager/helm/common.go b/src/internal/packager/helm/common.go index 6fba4d364e..e4dd729a19 100644 --- a/src/internal/packager/helm/common.go +++ b/src/internal/packager/helm/common.go @@ -14,11 +14,11 @@ import ( "strconv" "time" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/pkg/cluster" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/variables" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/pkg/cluster" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/variables" + "github.com/zarf-dev/zarf/src/types" "helm.sh/helm/v3/pkg/action" "helm.sh/helm/v3/pkg/chart" "helm.sh/helm/v3/pkg/cli" diff --git a/src/internal/packager/helm/destroy.go b/src/internal/packager/helm/destroy.go index 8f7060c7c7..44c519a00a 100644 --- a/src/internal/packager/helm/destroy.go +++ b/src/internal/packager/helm/destroy.go @@ -7,8 +7,8 @@ package helm import ( "regexp" - "github.com/defenseunicorns/zarf/src/pkg/cluster" - "github.com/defenseunicorns/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/cluster" + "github.com/zarf-dev/zarf/src/pkg/message" "helm.sh/helm/v3/pkg/action" ) diff --git a/src/internal/packager/helm/images.go b/src/internal/packager/helm/images.go index 447aefc780..390ce5c8be 100644 --- a/src/internal/packager/helm/images.go +++ b/src/internal/packager/helm/images.go @@ -5,8 +5,8 @@ package helm import ( "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/pkg/message" "github.com/goccy/go-yaml" + "github.com/zarf-dev/zarf/src/pkg/message" "helm.sh/helm/v3/pkg/chart/loader" "helm.sh/helm/v3/pkg/chartutil" ) diff --git a/src/internal/packager/helm/post-render.go b/src/internal/packager/helm/post-render.go index b03aa6a93a..8d6c157427 100644 --- a/src/internal/packager/helm/post-render.go +++ b/src/internal/packager/helm/post-render.go @@ -14,11 +14,11 @@ import ( "slices" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/pkg/cluster" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/utils" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/pkg/cluster" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/utils" + "github.com/zarf-dev/zarf/src/types" "helm.sh/helm/v3/pkg/releaseutil" corev1 "k8s.io/api/core/v1" "k8s.io/client-go/dynamic" @@ -285,6 +285,10 @@ func (r *renderer) editHelmResources(ctx context.Context, resources []releaseuti return err } resource, err := dc.Resource(mapping.Resource).Namespace(deployedNamespace).Get(ctx, rawData.GetName(), metav1.GetOptions{}) + // Ignore resources that are yet to be created + if kerrors.IsNotFound(err) { + return nil + } if err != nil { return err } @@ -308,7 +312,7 @@ func (r *renderer) editHelmResources(ctx context.Context, resources []releaseuti return nil }() if err != nil { - message.Debugf("Unable to adopt resource %s: %s", rawData.GetName(), err.Error()) + return fmt.Errorf("unable to adopt the resource %s: %w", rawData.GetName(), err) } } // Finally place this back onto the output buffer diff --git a/src/internal/packager/helm/repo.go b/src/internal/packager/helm/repo.go index 6bc19c8e50..148a4176a4 100644 --- a/src/internal/packager/helm/repo.go +++ b/src/internal/packager/helm/repo.go @@ -5,19 +5,20 @@ package helm import ( + "context" "fmt" "os" "path/filepath" "strings" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/config/lang" - "github.com/defenseunicorns/zarf/src/internal/packager/git" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/transform" - "github.com/defenseunicorns/zarf/src/pkg/utils" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/internal/packager/git" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/transform" + "github.com/zarf-dev/zarf/src/pkg/utils" + "github.com/zarf-dev/zarf/src/types" "helm.sh/helm/v3/pkg/action" "helm.sh/helm/v3/pkg/chart" "helm.sh/helm/v3/pkg/cli" @@ -32,7 +33,7 @@ import ( ) // PackageChart creates a chart archive from a path to a chart on the host os and builds chart dependencies -func (h *Helm) PackageChart(cosignKeyPath string) error { +func (h *Helm) PackageChart(ctx context.Context, cosignKeyPath string) error { if len(h.chart.URL) > 0 { url, refPlain, err := transform.GitURLSplitRef(h.chart.URL) // check if the chart is a git url with a ref (if an error is returned url will be empty) @@ -47,7 +48,7 @@ func (h *Helm) PackageChart(cosignKeyPath string) error { h.chart.URL = fmt.Sprintf("%s@%s", h.chart.URL, h.chart.Version) } - err = h.PackageChartFromGit(cosignKeyPath) + err = h.PackageChartFromGit(ctx, cosignKeyPath) if err != nil { return fmt.Errorf("unable to pull the chart %q from git: %w", h.chart.Name, err) } @@ -113,12 +114,12 @@ func (h *Helm) PackageChartFromLocalFiles(cosignKeyPath string) error { } // PackageChartFromGit is a special implementation of chart archiving that supports the https://p1.dso.mil/#/products/big-bang/ model. -func (h *Helm) PackageChartFromGit(cosignKeyPath string) error { +func (h *Helm) PackageChartFromGit(ctx context.Context, cosignKeyPath string) error { spinner := message.NewProgressSpinner("Processing helm chart %s", h.chart.Name) defer spinner.Stop() // Retrieve the repo containing the chart - gitPath, err := DownloadChartFromGitToTemp(h.chart.URL, spinner) + gitPath, err := DownloadChartFromGitToTemp(ctx, h.chart.URL, spinner) if err != nil { return err } @@ -232,12 +233,12 @@ func (h *Helm) DownloadPublishedChart(cosignKeyPath string) error { } // DownloadChartFromGitToTemp downloads a chart from git into a temp directory -func DownloadChartFromGitToTemp(url string, spinner *message.Spinner) (string, error) { +func DownloadChartFromGitToTemp(ctx context.Context, url string, spinner *message.Spinner) (string, error) { // Create the Git configuration and download the repo gitCfg := git.NewWithSpinner(types.GitServerInfo{}, spinner) // Download the git repo to a temporary directory - err := gitCfg.DownloadRepoToTemp(url) + err := gitCfg.DownloadRepoToTemp(ctx, url) if err != nil { return "", fmt.Errorf("unable to download the git repo %s: %w", url, err) } diff --git a/src/internal/packager/helm/utils.go b/src/internal/packager/helm/utils.go index 4f6119de8e..8d3d5f3202 100644 --- a/src/internal/packager/helm/utils.go +++ b/src/internal/packager/helm/utils.go @@ -8,7 +8,7 @@ import ( "fmt" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/message" "helm.sh/helm/v3/pkg/action" "helm.sh/helm/v3/pkg/chart" "helm.sh/helm/v3/pkg/chartutil" diff --git a/src/internal/packager/helm/zarf.go b/src/internal/packager/helm/zarf.go index 91d3fe917f..0381ef4b52 100644 --- a/src/internal/packager/helm/zarf.go +++ b/src/internal/packager/helm/zarf.go @@ -17,13 +17,13 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/defenseunicorns/zarf/src/internal/packager/template" - "github.com/defenseunicorns/zarf/src/pkg/cluster" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/transform" - "github.com/defenseunicorns/zarf/src/pkg/utils" - "github.com/defenseunicorns/zarf/src/pkg/variables" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/internal/packager/template" + "github.com/zarf-dev/zarf/src/pkg/cluster" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/transform" + "github.com/zarf-dev/zarf/src/pkg/utils" + "github.com/zarf-dev/zarf/src/pkg/variables" + "github.com/zarf-dev/zarf/src/types" ) // UpdateZarfRegistryValues updates the Zarf registry deployment with the new state values diff --git a/src/internal/packager/images/common.go b/src/internal/packager/images/common.go index 8efb18f12d..3e2ad406ff 100644 --- a/src/internal/packager/images/common.go +++ b/src/internal/packager/images/common.go @@ -9,13 +9,13 @@ import ( "time" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/transform" - "github.com/defenseunicorns/zarf/src/types" "github.com/google/go-containerregistry/pkg/authn" "github.com/google/go-containerregistry/pkg/crane" v1 "github.com/google/go-containerregistry/pkg/v1" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/transform" + "github.com/zarf-dev/zarf/src/types" ) // PullConfig is the configuration for pulling images. @@ -104,7 +104,7 @@ func createPushOpts(cfg PushConfig, pb *message.ProgressBar) []crane.Option { transport := http.DefaultTransport.(*http.Transport).Clone() transport.TLSClientConfig.InsecureSkipVerify = config.CommonOptions.Insecure - // TODO (@WSTARR) This is set to match the TLSHandshakeTimeout to potentially mitigate effects of https://github.com/defenseunicorns/zarf/issues/1444 + // TODO (@WSTARR) This is set to match the TLSHandshakeTimeout to potentially mitigate effects of https://github.com/zarf-dev/zarf/issues/1444 transport.ResponseHeaderTimeout = 10 * time.Second transportWithProgressBar := helpers.NewTransport(transport, pb) diff --git a/src/internal/packager/images/pull.go b/src/internal/packager/images/pull.go index 5636e7229d..7a313c5db0 100644 --- a/src/internal/packager/images/pull.go +++ b/src/internal/packager/images/pull.go @@ -19,11 +19,6 @@ import ( "time" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/transform" - "github.com/defenseunicorns/zarf/src/pkg/utils" "github.com/google/go-containerregistry/pkg/crane" "github.com/google/go-containerregistry/pkg/logs" "github.com/google/go-containerregistry/pkg/name" @@ -37,6 +32,11 @@ import ( "github.com/google/go-containerregistry/pkg/v1/types" "github.com/moby/moby/client" ocispec "github.com/opencontainers/image-spec/specs-go/v1" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/transform" + "github.com/zarf-dev/zarf/src/pkg/utils" "golang.org/x/sync/errgroup" ) @@ -132,7 +132,7 @@ func Pull(ctx context.Context, cfg PullConfig) (map[transform.Image]v1.Image, er ref, utils.ByteFormat(float64(rawImg.Size), 2)) } - // Use unbuffered opener to avoid OOM Kill issues https://github.com/defenseunicorns/zarf/issues/1214. + // Use unbuffered opener to avoid OOM Kill issues https://github.com/zarf-dev/zarf/issues/1214. // This will also take forever to load large images. img, err = daemon.Image(reference, daemon.WithUnbufferedOpener()) if err != nil { @@ -254,7 +254,7 @@ func Pull(ctx context.Context, cfg PullConfig) (map[transform.Image]v1.Image, er // Needed because when pulling from the local docker daemon, while using the docker containerd runtime // Crane incorrectly names the blob of the docker image config to a sha that does not match the contents - // https://github.com/defenseunicorns/zarf/issues/2584 + // https://github.com/zarf-dev/zarf/issues/2584 // This is a band aid fix while we wait for crane and or docker to create the permanent fix blobDir := filepath.Join(cfg.DestinationDirectory, "blobs", "sha256") err = filepath.Walk(blobDir, func(path string, fi os.FileInfo, err error) error { diff --git a/src/internal/packager/images/pull_test.go b/src/internal/packager/images/pull_test.go index 4ee0ca5478..eef8bbc9e8 100644 --- a/src/internal/packager/images/pull_test.go +++ b/src/internal/packager/images/pull_test.go @@ -10,8 +10,8 @@ import ( "path/filepath" "testing" - "github.com/defenseunicorns/zarf/src/pkg/transform" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/pkg/transform" ) func TestPull(t *testing.T) { diff --git a/src/internal/packager/images/push.go b/src/internal/packager/images/push.go index 3048218662..08625ab385 100644 --- a/src/internal/packager/images/push.go +++ b/src/internal/packager/images/push.go @@ -10,13 +10,13 @@ import ( "time" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/pkg/cluster" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/transform" - "github.com/defenseunicorns/zarf/src/pkg/utils" "github.com/google/go-containerregistry/pkg/crane" "github.com/google/go-containerregistry/pkg/logs" v1 "github.com/google/go-containerregistry/pkg/v1" + "github.com/zarf-dev/zarf/src/pkg/cluster" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/transform" + "github.com/zarf-dev/zarf/src/pkg/utils" ) // Push pushes images to a registry. diff --git a/src/internal/packager/sbom/catalog.go b/src/internal/packager/sbom/catalog.go index d60d7a70b7..aadeeea257 100755 --- a/src/internal/packager/sbom/catalog.go +++ b/src/internal/packager/sbom/catalog.go @@ -24,12 +24,12 @@ import ( "github.com/anchore/syft/syft/sbom" "github.com/anchore/syft/syft/source" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/transform" - "github.com/defenseunicorns/zarf/src/pkg/utils" v1 "github.com/google/go-containerregistry/pkg/v1" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/transform" + "github.com/zarf-dev/zarf/src/pkg/utils" ) // Builder is the main struct used to build SBOM artifacts. diff --git a/src/internal/packager/sbom/tools.go b/src/internal/packager/sbom/tools.go index 860b50e879..60aa998958 100644 --- a/src/internal/packager/sbom/tools.go +++ b/src/internal/packager/sbom/tools.go @@ -9,8 +9,8 @@ import ( "path/filepath" "github.com/AlecAivazis/survey/v2" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/utils/exec" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/utils/exec" ) // ViewSBOMFiles opens a browser to view the SBOM files and pauses for user input. diff --git a/src/internal/packager/sbom/viewer.go b/src/internal/packager/sbom/viewer.go index 3362d251ac..8bc9fd9e0e 100644 --- a/src/internal/packager/sbom/viewer.go +++ b/src/internal/packager/sbom/viewer.go @@ -9,8 +9,8 @@ import ( "fmt" "html/template" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/pkg/transform" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/pkg/transform" ) func (b *Builder) createSBOMViewerAsset(identifier string, jsonData []byte) error { diff --git a/src/internal/packager/template/template.go b/src/internal/packager/template/template.go index 8b76252aa1..70f7808cc2 100644 --- a/src/internal/packager/template/template.go +++ b/src/internal/packager/template/template.go @@ -10,14 +10,14 @@ import ( "log/slog" "strings" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/types" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/pkg/interactive" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/utils" - "github.com/defenseunicorns/zarf/src/pkg/variables" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/pkg/interactive" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/utils" + "github.com/zarf-dev/zarf/src/pkg/variables" ) const ( diff --git a/src/pkg/cluster/cluster.go b/src/pkg/cluster/cluster.go index 5d15550482..b4eb28051b 100644 --- a/src/pkg/cluster/cluster.go +++ b/src/pkg/cluster/cluster.go @@ -18,7 +18,7 @@ import ( pkgkubernetes "github.com/defenseunicorns/pkg/kubernetes" - "github.com/defenseunicorns/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/message" ) const ( diff --git a/src/pkg/cluster/data.go b/src/pkg/cluster/data.go index 21a060742e..cd46dbb28b 100644 --- a/src/pkg/cluster/data.go +++ b/src/pkg/cluster/data.go @@ -13,7 +13,6 @@ import ( "sort" "strconv" "strings" - "sync" "time" corev1 "k8s.io/api/core/v1" @@ -22,22 +21,20 @@ import ( "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/utils" - "github.com/defenseunicorns/zarf/src/pkg/utils/exec" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/utils" + "github.com/zarf-dev/zarf/src/pkg/utils/exec" + "github.com/zarf-dev/zarf/src/types" ) // HandleDataInjection waits for the target pod(s) to come up and inject the data into them // todo: this currently requires kubectl but we should have enough k8s work to make this native now. -func (c *Cluster) HandleDataInjection(ctx context.Context, wg *sync.WaitGroup, data types.ZarfDataInjection, componentPath *layout.ComponentPaths, dataIdx int) { - defer wg.Done() +func (c *Cluster) HandleDataInjection(ctx context.Context, data types.ZarfDataInjection, componentPath *layout.ComponentPaths, dataIdx int) error { injectionCompletionMarker := filepath.Join(componentPath.DataInjections, config.GetDataInjectionMarker()) if err := os.WriteFile(injectionCompletionMarker, []byte("🦄"), helpers.ReadWriteUser); err != nil { - message.WarnErrf(err, "Unable to create the data injection completion marker") - return + return fmt.Errorf("unable to create the data injection completion marker: %w", err) } tarCompressFlag := "" @@ -59,103 +56,110 @@ func (c *Cluster) HandleDataInjection(ctx context.Context, wg *sync.WaitGroup, d shell, shellArgs := exec.GetOSShell(exec.Shell{Windows: "cmd"}) if _, _, err := exec.Cmd(shell, append(shellArgs, "tar --version")...); err != nil { - message.WarnErr(err, "Unable to execute tar on this system. Please ensure it is installed and on your $PATH.") - return + return fmt.Errorf("unable to execute tar, ensure it is installed in the $PATH: %w", err) } -iterator: - // The eternal loop because some data injections can take a very long time for { - message.Debugf("Attempting to inject data into %s", data.Target) - source := filepath.Join(componentPath.DataInjections, filepath.Base(data.Target.Path)) - if helpers.InvalidPath(source) { - // The path is likely invalid because of how we compose OCI components, add an index suffix to the filename - source = filepath.Join(componentPath.DataInjections, strconv.Itoa(dataIdx), filepath.Base(data.Target.Path)) + select { + case <-ctx.Done(): + return ctx.Err() + default: + message.Debugf("Attempting to inject data into %s", data.Target) + source := filepath.Join(componentPath.DataInjections, filepath.Base(data.Target.Path)) if helpers.InvalidPath(source) { - message.Warnf("Unable to find the data injection source path %s", source) - return + // The path is likely invalid because of how we compose OCI components, add an index suffix to the filename + source = filepath.Join(componentPath.DataInjections, strconv.Itoa(dataIdx), filepath.Base(data.Target.Path)) + if helpers.InvalidPath(source) { + return fmt.Errorf("could not find the data injection source path %s", source) + } } - } - target := podLookup{ - Namespace: data.Target.Namespace, - Selector: data.Target.Selector, - Container: data.Target.Container, - } - - // Wait until the pod we are injecting data into becomes available - pods := waitForPodsAndContainers(ctx, c.Clientset, target, podFilterByInitContainer) - if len(pods) < 1 { - continue - } + target := podLookup{ + Namespace: data.Target.Namespace, + Selector: data.Target.Selector, + Container: data.Target.Container, + } - // Inject into all the pods - for _, pod := range pods { - // Try to use the embedded kubectl if we can - zarfCommand, err := utils.GetFinalExecutableCommand() - kubectlBinPath := "kubectl" + // Wait until the pod we are injecting data into becomes available + pods, err := waitForPodsAndContainers(ctx, c.Clientset, target, podFilterByInitContainer) if err != nil { - message.Warnf("Unable to get the zarf executable path, falling back to host kubectl: %s", err) - } else { - kubectlBinPath = fmt.Sprintf("%s tools kubectl", zarfCommand) + return err + } + if len(pods) < 1 { + continue } - kubectlCmd := fmt.Sprintf("%s exec -i -n %s %s -c %s ", kubectlBinPath, data.Target.Namespace, pod.Name, data.Target.Container) - // Note that each command flag is separated to provide the widest cross-platform tar support - tarCmd := fmt.Sprintf("tar -c %s -f -", tarCompressFlag) - untarCmd := fmt.Sprintf("tar -x %s -v -f - -C %s", tarCompressFlag, data.Target.Path) + // Inject into all the pods + for _, pod := range pods { + // Try to use the embedded kubectl if we can + zarfCommand, err := utils.GetFinalExecutableCommand() + kubectlBinPath := "kubectl" + if err != nil { + message.Warnf("Unable to get the zarf executable path, falling back to host kubectl: %s", err) + } else { + kubectlBinPath = fmt.Sprintf("%s tools kubectl", zarfCommand) + } + kubectlCmd := fmt.Sprintf("%s exec -i -n %s %s -c %s ", kubectlBinPath, data.Target.Namespace, pod.Name, data.Target.Container) - // Must create the target directory before trying to change to it for untar - mkdirCmd := fmt.Sprintf("%s -- mkdir -p %s", kubectlCmd, data.Target.Path) - if err := exec.CmdWithPrint(shell, append(shellArgs, mkdirCmd)...); err != nil { - message.Warnf("Unable to create the data injection target directory %s in pod %s", data.Target.Path, pod.Name) - continue iterator - } + // Note that each command flag is separated to provide the widest cross-platform tar support + tarCmd := fmt.Sprintf("tar -c %s -f -", tarCompressFlag) + untarCmd := fmt.Sprintf("tar -x %s -v -f - -C %s", tarCompressFlag, data.Target.Path) - cpPodCmd := fmt.Sprintf("%s -C %s . | %s -- %s", - tarCmd, - source, - kubectlCmd, - untarCmd, - ) - - // Do the actual data injection - if err := exec.CmdWithPrint(shell, append(shellArgs, cpPodCmd)...); err != nil { - message.Warnf("Error copying data into the pod %#v: %#v\n", pod.Name, err) - continue iterator - } + // Must create the target directory before trying to change to it for untar + mkdirCmd := fmt.Sprintf("%s -- mkdir -p %s", kubectlCmd, data.Target.Path) + if err := exec.CmdWithPrint(shell, append(shellArgs, mkdirCmd)...); err != nil { + return fmt.Errorf("unable to create the data injection target directory %s in pod %s: %w", data.Target.Path, pod.Name, err) + } + + cpPodCmd := fmt.Sprintf("%s -C %s . | %s -- %s", + tarCmd, + source, + kubectlCmd, + untarCmd, + ) - // Leave a marker in the target container for pods to track the sync action - cpPodCmd = fmt.Sprintf("%s -C %s %s | %s -- %s", - tarCmd, - componentPath.DataInjections, - config.GetDataInjectionMarker(), - kubectlCmd, - untarCmd, - ) - - if err := exec.CmdWithPrint(shell, append(shellArgs, cpPodCmd)...); err != nil { - message.Warnf("Error saving the zarf sync completion file after injection into pod %#v\n", pod.Name) - continue iterator + // Do the actual data injection + if err := exec.CmdWithPrint(shell, append(shellArgs, cpPodCmd)...); err != nil { + return fmt.Errorf("could not copy data into the pod %s: %w", pod.Name, err) + } + + // Leave a marker in the target container for pods to track the sync action + cpPodCmd = fmt.Sprintf("%s -C %s %s | %s -- %s", + tarCmd, + componentPath.DataInjections, + config.GetDataInjectionMarker(), + kubectlCmd, + untarCmd, + ) + + if err := exec.CmdWithPrint(shell, append(shellArgs, cpPodCmd)...); err != nil { + return fmt.Errorf("could not save the Zarf sync completion file after injection into pod %s: %w", pod.Name, err) + } } - } - // Do not look for a specific container after injection in case they are running an init container - podOnlyTarget := podLookup{ - Namespace: data.Target.Namespace, - Selector: data.Target.Selector, - } + // Do not look for a specific container after injection in case they are running an init container + podOnlyTarget := podLookup{ + Namespace: data.Target.Namespace, + Selector: data.Target.Selector, + } - // Block one final time to make sure at least one pod has come up and injected the data - // Using only the pod as the final selector because we don't know what the container name will be - // Still using the init container filter to make sure we have the right running pod - _ = waitForPodsAndContainers(ctx, c.Clientset, podOnlyTarget, podFilterByInitContainer) + // Block one final time to make sure at least one pod has come up and injected the data + // Using only the pod as the final selector because we don't know what the container name will be + // Still using the init container filter to make sure we have the right running pod + _, err = waitForPodsAndContainers(ctx, c.Clientset, podOnlyTarget, podFilterByInitContainer) + if err != nil { + return err + } - // Cleanup now to reduce disk pressure - _ = os.RemoveAll(source) + // Cleanup now to reduce disk pressure + err = os.RemoveAll(source) + if err != nil { + return err + } - // Return to stop the loop - return + // Return to stop the loop + return nil + } } } @@ -173,7 +177,7 @@ type podFilter func(pod corev1.Pod) bool // It will wait up to 90 seconds for the pods to be found and will return a list of matching pod names // If the timeout is reached, an empty list will be returned. // TODO: Test, refactor and/or remove. -func waitForPodsAndContainers(ctx context.Context, clientset kubernetes.Interface, target podLookup, include podFilter) []corev1.Pod { +func waitForPodsAndContainers(ctx context.Context, clientset kubernetes.Interface, target podLookup, include podFilter) ([]corev1.Pod, error) { waitCtx, cancel := context.WithTimeout(ctx, 90*time.Second) defer cancel() @@ -183,16 +187,14 @@ func waitForPodsAndContainers(ctx context.Context, clientset kubernetes.Interfac for { select { case <-waitCtx.Done(): - message.Debug("Pod lookup failed: %v", ctx.Err()) - return nil + return nil, ctx.Err() case <-timer.C: listOpts := metav1.ListOptions{ LabelSelector: target.Selector, } podList, err := clientset.CoreV1().Pods(target.Namespace).List(ctx, listOpts) if err != nil { - message.Debug("Unable to find matching pods: %w", err) - return nil + return nil, err } message.Debug("Found %d pods for target %#v", len(podList.Items), target) @@ -245,7 +247,7 @@ func waitForPodsAndContainers(ctx context.Context, clientset kubernetes.Interfac } } if len(readyPods) > 0 { - return readyPods + return readyPods, nil } timer.Reset(3 * time.Second) } diff --git a/src/pkg/cluster/injector.go b/src/pkg/cluster/injector.go index 52824843bf..48552ac5e1 100644 --- a/src/pkg/cluster/injector.go +++ b/src/pkg/cluster/injector.go @@ -26,10 +26,10 @@ import ( "github.com/defenseunicorns/pkg/helpers/v2" pkgkubernetes "github.com/defenseunicorns/pkg/kubernetes" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/transform" - "github.com/defenseunicorns/zarf/src/pkg/utils" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/transform" + "github.com/zarf-dev/zarf/src/pkg/utils" ) // StartInjection initializes a Zarf injection into the cluster. diff --git a/src/pkg/cluster/namespace.go b/src/pkg/cluster/namespace.go index c65c968d0e..6d4256ef83 100644 --- a/src/pkg/cluster/namespace.go +++ b/src/pkg/cluster/namespace.go @@ -12,7 +12,7 @@ import ( kerrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/defenseunicorns/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/message" ) // DeleteZarfNamespace deletes the Zarf namespace from the connected cluster. diff --git a/src/pkg/cluster/secrets.go b/src/pkg/cluster/secrets.go index d083f6bbf4..3cdeabe826 100644 --- a/src/pkg/cluster/secrets.go +++ b/src/pkg/cluster/secrets.go @@ -15,9 +15,9 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/types" ) // DockerConfig contains the authentication information from the machine's docker config. diff --git a/src/pkg/cluster/secrets_test.go b/src/pkg/cluster/secrets_test.go index 20d3fe70f9..80cd33b933 100644 --- a/src/pkg/cluster/secrets_test.go +++ b/src/pkg/cluster/secrets_test.go @@ -12,7 +12,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/fake" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/types" ) func TestGenerateRegistryPullCredsWithOutSvc(t *testing.T) { diff --git a/src/pkg/cluster/state.go b/src/pkg/cluster/state.go index 65fba1431a..bdc14e5989 100644 --- a/src/pkg/cluster/state.go +++ b/src/pkg/cluster/state.go @@ -17,11 +17,11 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/config/lang" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/pki" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/pki" + "github.com/zarf-dev/zarf/src/types" ) // Zarf Cluster Constants. diff --git a/src/pkg/cluster/state_test.go b/src/pkg/cluster/state_test.go index 524b0e3295..cf52d195dc 100644 --- a/src/pkg/cluster/state_test.go +++ b/src/pkg/cluster/state_test.go @@ -17,9 +17,9 @@ import ( "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/pki" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/pki" + "github.com/zarf-dev/zarf/src/types" ) func TestInitZarfState(t *testing.T) { diff --git a/src/pkg/cluster/tunnel.go b/src/pkg/cluster/tunnel.go index 3f8433ed9f..f0a1a660e0 100644 --- a/src/pkg/cluster/tunnel.go +++ b/src/pkg/cluster/tunnel.go @@ -23,8 +23,8 @@ import ( "k8s.io/client-go/transport/spdy" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/types" ) // Zarf specific connect strings diff --git a/src/pkg/cluster/tunnel_test.go b/src/pkg/cluster/tunnel_test.go index fd1866da19..9ce09770e9 100644 --- a/src/pkg/cluster/tunnel_test.go +++ b/src/pkg/cluster/tunnel_test.go @@ -12,7 +12,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/fake" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/types" ) func TestListConnections(t *testing.T) { diff --git a/src/pkg/cluster/zarf.go b/src/pkg/cluster/zarf.go index 93d8406ced..7320e4610b 100644 --- a/src/pkg/cluster/zarf.go +++ b/src/pkg/cluster/zarf.go @@ -17,9 +17,9 @@ import ( kerrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/types" ) // GetDeployedZarfPackages gets metadata information about packages that have been deployed to the cluster. diff --git a/src/pkg/cluster/zarf_test.go b/src/pkg/cluster/zarf_test.go index 4abfb81e8f..f7e9b481ec 100644 --- a/src/pkg/cluster/zarf_test.go +++ b/src/pkg/cluster/zarf_test.go @@ -16,8 +16,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/fake" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/types" ) // TestPackageSecretNeedsWait verifies that Zarf waits for webhooks to complete correctly. diff --git a/src/pkg/interactive/components.go b/src/pkg/interactive/components.go index 4e24f3f083..f48db25043 100644 --- a/src/pkg/interactive/components.go +++ b/src/pkg/interactive/components.go @@ -8,10 +8,10 @@ import ( "fmt" "github.com/AlecAivazis/survey/v2" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/utils" - "github.com/defenseunicorns/zarf/src/types" "github.com/pterm/pterm" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/utils" + "github.com/zarf-dev/zarf/src/types" ) // SelectOptionalComponent prompts to confirm optional components diff --git a/src/pkg/interactive/prompt.go b/src/pkg/interactive/prompt.go index d832982538..759f520948 100644 --- a/src/pkg/interactive/prompt.go +++ b/src/pkg/interactive/prompt.go @@ -8,8 +8,8 @@ import ( "fmt" "github.com/AlecAivazis/survey/v2" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/variables" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/variables" ) // PromptSigPassword prompts the user for the password to their private key diff --git a/src/pkg/layout/component.go b/src/pkg/layout/component.go index c933fce6f6..f52e6bbe06 100644 --- a/src/pkg/layout/component.go +++ b/src/pkg/layout/component.go @@ -11,9 +11,9 @@ import ( "path/filepath" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/types" "github.com/mholt/archiver/v3" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/types" ) // ComponentPaths contains paths for a component. diff --git a/src/pkg/layout/image.go b/src/pkg/layout/image.go index 7d236410bf..13ed0af43d 100644 --- a/src/pkg/layout/image.go +++ b/src/pkg/layout/image.go @@ -49,7 +49,7 @@ func (i *Images) AddV1Image(img v1.Image) error { return err } // Cannot use img.ConfigName to get this value because of an upstream bug in crane / docker using the containerd runtime - // https://github.com/defenseunicorns/zarf/issues/2584 + // https://github.com/zarf-dev/zarf/issues/2584 i.AddBlob(manifest.Config.Digest.Hex) manifestSha, err := img.Digest() if err != nil { diff --git a/src/pkg/layout/package.go b/src/pkg/layout/package.go index 1b99379e81..aef5e849d6 100644 --- a/src/pkg/layout/package.go +++ b/src/pkg/layout/package.go @@ -13,14 +13,14 @@ import ( "github.com/Masterminds/semver/v3" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/pkg/interactive" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/packager/deprecated" - "github.com/defenseunicorns/zarf/src/pkg/utils" - "github.com/defenseunicorns/zarf/src/types" "github.com/google/go-containerregistry/pkg/crane" "github.com/mholt/archiver/v3" ocispec "github.com/opencontainers/image-spec/specs-go/v1" + "github.com/zarf-dev/zarf/src/pkg/interactive" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/packager/deprecated" + "github.com/zarf-dev/zarf/src/pkg/utils" + "github.com/zarf-dev/zarf/src/types" ) // PackagePaths is the default package layout. diff --git a/src/pkg/layout/split.go b/src/pkg/layout/split.go index aecf295dad..4668107405 100644 --- a/src/pkg/layout/split.go +++ b/src/pkg/layout/split.go @@ -13,8 +13,8 @@ import ( "os" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/types" ) // splitFile will split the file into chunks and remove the original file. diff --git a/src/pkg/layout/split_test.go b/src/pkg/layout/split_test.go index b7f48fc9f6..718dc7bfee 100644 --- a/src/pkg/layout/split_test.go +++ b/src/pkg/layout/split_test.go @@ -10,8 +10,8 @@ import ( "path/filepath" "testing" - "github.com/defenseunicorns/zarf/src/types" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/types" ) func TestSplitFile(t *testing.T) { diff --git a/src/pkg/lint/findings.go b/src/pkg/lint/findings.go index 76b1717ff9..a8ad9b5eac 100644 --- a/src/pkg/lint/findings.go +++ b/src/pkg/lint/findings.go @@ -9,8 +9,8 @@ import ( "path/filepath" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/pkg/message" "github.com/fatih/color" + "github.com/zarf-dev/zarf/src/pkg/message" ) // PackageFinding is a struct that contains a finding about something wrong with a package diff --git a/src/pkg/lint/lint.go b/src/pkg/lint/lint.go index 4fa331e75a..6b48951f48 100644 --- a/src/pkg/lint/lint.go +++ b/src/pkg/lint/lint.go @@ -10,13 +10,13 @@ import ( "fmt" "os" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/config/lang" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/packager/composer" - "github.com/defenseunicorns/zarf/src/pkg/utils" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/packager/composer" + "github.com/zarf-dev/zarf/src/pkg/utils" + "github.com/zarf-dev/zarf/src/types" ) // Validate lints the given Zarf package diff --git a/src/pkg/lint/lint_test.go b/src/pkg/lint/lint_test.go index 5a464aa71a..d5c5a03495 100644 --- a/src/pkg/lint/lint_test.go +++ b/src/pkg/lint/lint_test.go @@ -9,9 +9,9 @@ import ( "fmt" "testing" - "github.com/defenseunicorns/zarf/src/config/lang" - "github.com/defenseunicorns/zarf/src/types" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/types" ) func TestLintComponents(t *testing.T) { diff --git a/src/pkg/lint/rules.go b/src/pkg/lint/rules.go index bd18668e30..17c22256a4 100644 --- a/src/pkg/lint/rules.go +++ b/src/pkg/lint/rules.go @@ -9,8 +9,8 @@ import ( "strings" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/pkg/transform" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/pkg/transform" + "github.com/zarf-dev/zarf/src/types" ) func isPinnedImage(image string) (bool, error) { diff --git a/src/pkg/lint/rules_test.go b/src/pkg/lint/rules_test.go index 7fd6bc4a04..a73b275d1c 100644 --- a/src/pkg/lint/rules_test.go +++ b/src/pkg/lint/rules_test.go @@ -8,8 +8,8 @@ import ( "errors" "testing" - "github.com/defenseunicorns/zarf/src/types" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/types" ) func TestValidateComponent(t *testing.T) { @@ -17,10 +17,10 @@ func TestValidateComponent(t *testing.T) { t.Run("Unpinnned repo warning", func(t *testing.T) { t.Parallel() - unpinnedRepo := "https://github.com/defenseunicorns/zarf-public-test.git" + unpinnedRepo := "https://github.com/zarf-dev/zarf-public-test.git" component := types.ZarfComponent{Repos: []string{ unpinnedRepo, - "https://dev.azure.com/defenseunicorns/zarf-public-test/_git/zarf-public-test@v0.0.1", + "https://dev.azure.com/zarf-dev/zarf-public-test/_git/zarf-public-test@v0.0.1", }} findings := checkForUnpinnedRepos(component, 0) expected := []PackageFinding{ @@ -103,12 +103,12 @@ func TestValidateComponent(t *testing.T) { err error }{ { - input: "registry.com:8080/defenseunicorns/whatever", + input: "registry.com:8080/zarf-dev/whatever", expected: false, err: nil, }, { - input: "ghcr.io/defenseunicorns/pepr/controller:v0.15.0", + input: "ghcr.io/zarf-dev/pepr/controller:v0.15.0", expected: false, err: nil, }, diff --git a/src/pkg/lint/schema.go b/src/pkg/lint/schema.go index 85e086a6c5..136bd2b46d 100644 --- a/src/pkg/lint/schema.go +++ b/src/pkg/lint/schema.go @@ -9,9 +9,9 @@ import ( "io/fs" "regexp" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/pkg/utils" "github.com/xeipuuv/gojsonschema" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/pkg/utils" ) // ZarfSchema is exported so main.go can embed the schema file diff --git a/src/pkg/lint/schema_test.go b/src/pkg/lint/schema_test.go index 9522515dac..1827310c32 100644 --- a/src/pkg/lint/schema_test.go +++ b/src/pkg/lint/schema_test.go @@ -9,10 +9,10 @@ import ( "os" "testing" - "github.com/defenseunicorns/zarf/src/pkg/variables" - "github.com/defenseunicorns/zarf/src/types" goyaml "github.com/goccy/go-yaml" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/pkg/variables" + "github.com/zarf-dev/zarf/src/types" ) func TestZarfSchema(t *testing.T) { diff --git a/src/pkg/message/connect.go b/src/pkg/message/connect.go index 75f87fdd64..499a9e3602 100644 --- a/src/pkg/message/connect.go +++ b/src/pkg/message/connect.go @@ -7,7 +7,7 @@ package message import ( "fmt" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/types" ) // PrintConnectStringTable prints a table of connect strings. diff --git a/src/pkg/message/credentials.go b/src/pkg/message/credentials.go index 19f86f8516..74b127a1c6 100644 --- a/src/pkg/message/credentials.go +++ b/src/pkg/message/credentials.go @@ -8,8 +8,8 @@ import ( "fmt" "strings" - "github.com/defenseunicorns/zarf/src/types" "github.com/pterm/pterm" + "github.com/zarf-dev/zarf/src/types" ) // Common constants for printing credentials diff --git a/src/pkg/message/message.go b/src/pkg/message/message.go index 0ead8b0e01..f9d7d48c3c 100644 --- a/src/pkg/message/message.go +++ b/src/pkg/message/message.go @@ -12,9 +12,9 @@ import ( "time" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/config" "github.com/fatih/color" "github.com/pterm/pterm" + "github.com/zarf-dev/zarf/src/config" ) // LogLevel is the level of logging to display. diff --git a/src/pkg/packager/actions/actions.go b/src/pkg/packager/actions/actions.go index 2f01757d6c..c92457675c 100644 --- a/src/pkg/packager/actions/actions.go +++ b/src/pkg/packager/actions/actions.go @@ -13,12 +13,12 @@ import ( "time" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/internal/packager/template" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/utils" - "github.com/defenseunicorns/zarf/src/pkg/utils/exec" - "github.com/defenseunicorns/zarf/src/pkg/variables" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/internal/packager/template" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/utils" + "github.com/zarf-dev/zarf/src/pkg/utils/exec" + "github.com/zarf-dev/zarf/src/pkg/variables" + "github.com/zarf-dev/zarf/src/types" ) // Run runs all provided actions. diff --git a/src/pkg/packager/common.go b/src/pkg/packager/common.go index 0f59319ae6..d790275d12 100644 --- a/src/pkg/packager/common.go +++ b/src/pkg/packager/common.go @@ -15,17 +15,17 @@ import ( "github.com/Masterminds/semver/v3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/config/lang" - "github.com/defenseunicorns/zarf/src/internal/packager/template" - "github.com/defenseunicorns/zarf/src/pkg/cluster" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/packager/deprecated" - "github.com/defenseunicorns/zarf/src/pkg/packager/sources" - "github.com/defenseunicorns/zarf/src/pkg/utils" - "github.com/defenseunicorns/zarf/src/pkg/variables" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/internal/packager/template" + "github.com/zarf-dev/zarf/src/pkg/cluster" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/packager/deprecated" + "github.com/zarf-dev/zarf/src/pkg/packager/sources" + "github.com/zarf-dev/zarf/src/pkg/utils" + "github.com/zarf-dev/zarf/src/pkg/variables" + "github.com/zarf-dev/zarf/src/types" ) // Packager is the main struct for managing packages. @@ -192,7 +192,10 @@ func (p *Packager) attemptClusterChecks(ctx context.Context) (err error) { // Check for any breaking changes between the initialized Zarf version and this CLI if existingInitPackage, _ := p.cluster.GetDeployedPackage(ctx, "init"); existingInitPackage != nil { // Use the build version instead of the metadata since this will support older Zarf versions - deprecated.PrintBreakingChanges(os.Stderr, existingInitPackage.Data.Build.Version, config.CLIVersion) + err := deprecated.PrintBreakingChanges(os.Stderr, existingInitPackage.Data.Build.Version, config.CLIVersion) + if err != nil { + return err + } } spinner.Success() diff --git a/src/pkg/packager/common_test.go b/src/pkg/packager/common_test.go index 6927082f9b..ac47544515 100644 --- a/src/pkg/packager/common_test.go +++ b/src/pkg/packager/common_test.go @@ -13,9 +13,9 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/fake" - "github.com/defenseunicorns/zarf/src/config/lang" - "github.com/defenseunicorns/zarf/src/pkg/cluster" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/pkg/cluster" + "github.com/zarf-dev/zarf/src/types" ) func TestValidatePackageArchitecture(t *testing.T) { diff --git a/src/pkg/packager/composer/list.go b/src/pkg/packager/composer/list.go index 69aa5fdb8e..06f67ec816 100644 --- a/src/pkg/packager/composer/list.go +++ b/src/pkg/packager/composer/list.go @@ -11,13 +11,13 @@ import ( "strings" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/extensions/bigbang" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/pkg/packager/deprecated" - "github.com/defenseunicorns/zarf/src/pkg/utils" - "github.com/defenseunicorns/zarf/src/pkg/variables" - "github.com/defenseunicorns/zarf/src/pkg/zoci" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/extensions/bigbang" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/pkg/packager/deprecated" + "github.com/zarf-dev/zarf/src/pkg/utils" + "github.com/zarf-dev/zarf/src/pkg/variables" + "github.com/zarf-dev/zarf/src/pkg/zoci" + "github.com/zarf-dev/zarf/src/types" ) // Node is a node in the import chain diff --git a/src/pkg/packager/composer/list_test.go b/src/pkg/packager/composer/list_test.go index 0f96e0beb0..e720fdf57c 100644 --- a/src/pkg/packager/composer/list_test.go +++ b/src/pkg/packager/composer/list_test.go @@ -11,10 +11,10 @@ import ( "path/filepath" "testing" - "github.com/defenseunicorns/zarf/src/pkg/variables" - "github.com/defenseunicorns/zarf/src/types" - "github.com/defenseunicorns/zarf/src/types/extensions" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/pkg/variables" + "github.com/zarf-dev/zarf/src/types" + "github.com/zarf-dev/zarf/src/types/extensions" ) func TestNewImportChain(t *testing.T) { diff --git a/src/pkg/packager/composer/oci.go b/src/pkg/packager/composer/oci.go index f4f02fbaf3..129013d487 100644 --- a/src/pkg/packager/composer/oci.go +++ b/src/pkg/packager/composer/oci.go @@ -13,13 +13,13 @@ import ( "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/pkg/oci" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/utils" - "github.com/defenseunicorns/zarf/src/pkg/zoci" "github.com/mholt/archiver/v3" ocispec "github.com/opencontainers/image-spec/specs-go/v1" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/utils" + "github.com/zarf-dev/zarf/src/pkg/zoci" ocistore "oras.land/oras-go/v2/content/oci" ) diff --git a/src/pkg/packager/composer/override.go b/src/pkg/packager/composer/override.go index 4a07a1d936..feb4b4b6f3 100644 --- a/src/pkg/packager/composer/override.go +++ b/src/pkg/packager/composer/override.go @@ -7,7 +7,7 @@ package composer import ( "fmt" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/types" ) func overrideMetadata(c *types.ZarfComponent, override types.ZarfComponent) error { diff --git a/src/pkg/packager/composer/pathfixer.go b/src/pkg/packager/composer/pathfixer.go index fac110c47c..f13537dfd9 100644 --- a/src/pkg/packager/composer/pathfixer.go +++ b/src/pkg/packager/composer/pathfixer.go @@ -8,7 +8,7 @@ import ( "path/filepath" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/types" ) func makePathRelativeTo(path, relativeTo string) string { diff --git a/src/pkg/packager/create.go b/src/pkg/packager/create.go index ee9a7fd2bc..517726eba4 100755 --- a/src/pkg/packager/create.go +++ b/src/pkg/packager/create.go @@ -10,10 +10,10 @@ import ( "os" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/packager/creator" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/packager/creator" ) // Create generates a Zarf package tarball for a given PackageConfig and optional base directory. diff --git a/src/pkg/packager/creator/compose.go b/src/pkg/packager/creator/compose.go index 6cd5277388..8844c0305f 100644 --- a/src/pkg/packager/creator/compose.go +++ b/src/pkg/packager/creator/compose.go @@ -7,9 +7,9 @@ package creator import ( "context" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/packager/composer" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/packager/composer" + "github.com/zarf-dev/zarf/src/types" ) // ComposeComponents composes components and their dependencies into a single Zarf package using an import chain. diff --git a/src/pkg/packager/creator/compose_test.go b/src/pkg/packager/creator/compose_test.go index 35e298f553..a4dd2fdf9e 100644 --- a/src/pkg/packager/creator/compose_test.go +++ b/src/pkg/packager/creator/compose_test.go @@ -8,8 +8,8 @@ import ( "context" "testing" - "github.com/defenseunicorns/zarf/src/types" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/types" ) func TestComposeComponents(t *testing.T) { diff --git a/src/pkg/packager/creator/creator.go b/src/pkg/packager/creator/creator.go index aae86172c6..34e511458f 100644 --- a/src/pkg/packager/creator/creator.go +++ b/src/pkg/packager/creator/creator.go @@ -7,8 +7,8 @@ package creator import ( "context" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/types" ) // Creator is an interface for creating Zarf packages. diff --git a/src/pkg/packager/creator/creator_test.go b/src/pkg/packager/creator/creator_test.go index 1796e17dcc..7248fe1cc9 100644 --- a/src/pkg/packager/creator/creator_test.go +++ b/src/pkg/packager/creator/creator_test.go @@ -11,10 +11,10 @@ import ( "path/filepath" "testing" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/pkg/lint" - "github.com/defenseunicorns/zarf/src/types" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/pkg/lint" + "github.com/zarf-dev/zarf/src/types" ) type mockSchemaLoader struct { diff --git a/src/pkg/packager/creator/differential.go b/src/pkg/packager/creator/differential.go index d2c3c80480..a373bcc4f2 100644 --- a/src/pkg/packager/creator/differential.go +++ b/src/pkg/packager/creator/differential.go @@ -8,11 +8,11 @@ import ( "context" "os" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/pkg/packager/sources" - "github.com/defenseunicorns/zarf/src/pkg/utils" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/pkg/packager/sources" + "github.com/zarf-dev/zarf/src/pkg/utils" + "github.com/zarf-dev/zarf/src/types" ) // loadDifferentialData sets any images and repos from the existing reference package in the DifferentialData and returns it. diff --git a/src/pkg/packager/creator/normal.go b/src/pkg/packager/creator/normal.go index e760bf97e0..8671a891df 100644 --- a/src/pkg/packager/creator/normal.go +++ b/src/pkg/packager/creator/normal.go @@ -17,25 +17,25 @@ import ( "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/pkg/oci" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/config/lang" - "github.com/defenseunicorns/zarf/src/extensions/bigbang" - "github.com/defenseunicorns/zarf/src/internal/packager/git" - "github.com/defenseunicorns/zarf/src/internal/packager/helm" - "github.com/defenseunicorns/zarf/src/internal/packager/images" - "github.com/defenseunicorns/zarf/src/internal/packager/kustomize" - "github.com/defenseunicorns/zarf/src/internal/packager/sbom" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/pkg/lint" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/packager/actions" - "github.com/defenseunicorns/zarf/src/pkg/packager/filters" - "github.com/defenseunicorns/zarf/src/pkg/packager/sources" - "github.com/defenseunicorns/zarf/src/pkg/transform" - "github.com/defenseunicorns/zarf/src/pkg/utils" - "github.com/defenseunicorns/zarf/src/pkg/zoci" - "github.com/defenseunicorns/zarf/src/types" "github.com/mholt/archiver/v3" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/extensions/bigbang" + "github.com/zarf-dev/zarf/src/internal/packager/git" + "github.com/zarf-dev/zarf/src/internal/packager/helm" + "github.com/zarf-dev/zarf/src/internal/packager/images" + "github.com/zarf-dev/zarf/src/internal/packager/kustomize" + "github.com/zarf-dev/zarf/src/internal/packager/sbom" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/pkg/lint" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/packager/actions" + "github.com/zarf-dev/zarf/src/pkg/packager/filters" + "github.com/zarf-dev/zarf/src/pkg/packager/sources" + "github.com/zarf-dev/zarf/src/pkg/transform" + "github.com/zarf-dev/zarf/src/pkg/utils" + "github.com/zarf-dev/zarf/src/pkg/zoci" + "github.com/zarf-dev/zarf/src/types" ) var ( @@ -86,7 +86,7 @@ func (pc *PackageCreator) LoadPackageDefinition(ctx context.Context, src *layout warnings = append(warnings, templateWarnings...) // After templates are filled process any create extensions - pkg.Components, err = pc.processExtensions(pkg.Components, src, pkg.Metadata.YOLO) + pkg.Components, err = pc.processExtensions(ctx, pkg.Components, src, pkg.Metadata.YOLO) if err != nil { return types.ZarfPackage{}, nil, err } @@ -143,7 +143,7 @@ func (pc *PackageCreator) Assemble(ctx context.Context, dst *layout.PackagePaths } } - if err := pc.addComponent(component, dst); err != nil { + if err := pc.addComponent(ctx, component, dst); err != nil { onFailure() return fmt.Errorf("unable to add component %q: %w", component.Name, err) } @@ -328,7 +328,7 @@ func (pc *PackageCreator) Output(ctx context.Context, dst *layout.PackagePaths, return nil } -func (pc *PackageCreator) processExtensions(components []types.ZarfComponent, layout *layout.PackagePaths, isYOLO bool) (processedComponents []types.ZarfComponent, err error) { +func (pc *PackageCreator) processExtensions(ctx context.Context, components []types.ZarfComponent, layout *layout.PackagePaths, isYOLO bool) (processedComponents []types.ZarfComponent, err error) { // Create component paths and process extensions for each component. for _, c := range components { componentPaths, err := layout.Components.Create(c) @@ -338,7 +338,7 @@ func (pc *PackageCreator) processExtensions(components []types.ZarfComponent, la // Big Bang if c.Extensions.BigBang != nil { - if c, err = bigbang.Run(isYOLO, componentPaths, c); err != nil { + if c, err = bigbang.Run(ctx, isYOLO, componentPaths, c); err != nil { return nil, fmt.Errorf("unable to process bigbang extension: %w", err) } } @@ -349,7 +349,7 @@ func (pc *PackageCreator) processExtensions(components []types.ZarfComponent, la return processedComponents, nil } -func (pc *PackageCreator) addComponent(component types.ZarfComponent, dst *layout.PackagePaths) error { +func (pc *PackageCreator) addComponent(ctx context.Context, component types.ZarfComponent, dst *layout.PackagePaths) error { message.HeaderInfof("📦 %s COMPONENT", strings.ToUpper(component.Name)) componentPaths, err := dst.Components.Create(component) @@ -365,7 +365,7 @@ func (pc *PackageCreator) addComponent(component types.ZarfComponent, dst *layou // If any helm charts are defined, process them. for _, chart := range component.Charts { helmCfg := helm.New(chart, componentPaths.Charts, componentPaths.Values) - if err := helmCfg.PackageChart(componentPaths.Charts); err != nil { + if err := helmCfg.PackageChart(ctx, componentPaths.Charts); err != nil { return err } } @@ -515,7 +515,7 @@ func (pc *PackageCreator) addComponent(component types.ZarfComponent, dst *layou for _, url := range component.Repos { // Pull all the references if there is no `@` in the string. gitCfg := git.NewWithSpinner(types.GitServerInfo{}, spinner) - if err := gitCfg.Pull(url, componentPaths.Repos, false); err != nil { + if err := gitCfg.Pull(ctx, url, componentPaths.Repos, false); err != nil { return fmt.Errorf("unable to pull git repo %s: %w", url, err) } } diff --git a/src/pkg/packager/creator/skeleton.go b/src/pkg/packager/creator/skeleton.go index b03a4a913d..12c7b14671 100644 --- a/src/pkg/packager/creator/skeleton.go +++ b/src/pkg/packager/creator/skeleton.go @@ -13,18 +13,18 @@ import ( "strings" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/config/lang" - "github.com/defenseunicorns/zarf/src/extensions/bigbang" - "github.com/defenseunicorns/zarf/src/internal/packager/helm" - "github.com/defenseunicorns/zarf/src/internal/packager/kustomize" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/pkg/lint" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/utils" - "github.com/defenseunicorns/zarf/src/pkg/zoci" - "github.com/defenseunicorns/zarf/src/types" "github.com/mholt/archiver/v3" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/extensions/bigbang" + "github.com/zarf-dev/zarf/src/internal/packager/helm" + "github.com/zarf-dev/zarf/src/internal/packager/kustomize" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/pkg/lint" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/utils" + "github.com/zarf-dev/zarf/src/pkg/zoci" + "github.com/zarf-dev/zarf/src/types" ) var ( diff --git a/src/pkg/packager/creator/template.go b/src/pkg/packager/creator/template.go index df2fc86038..5a06651c53 100644 --- a/src/pkg/packager/creator/template.go +++ b/src/pkg/packager/creator/template.go @@ -7,12 +7,12 @@ package creator import ( "fmt" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/config/lang" - "github.com/defenseunicorns/zarf/src/pkg/interactive" - "github.com/defenseunicorns/zarf/src/pkg/utils" - "github.com/defenseunicorns/zarf/src/pkg/variables" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/pkg/interactive" + "github.com/zarf-dev/zarf/src/pkg/utils" + "github.com/zarf-dev/zarf/src/pkg/variables" + "github.com/zarf-dev/zarf/src/types" ) // FillActiveTemplate merges user-specified variables into the configuration templates of a zarf.yaml. diff --git a/src/pkg/packager/creator/utils.go b/src/pkg/packager/creator/utils.go index ebc7f0602b..3b485e170b 100644 --- a/src/pkg/packager/creator/utils.go +++ b/src/pkg/packager/creator/utils.go @@ -10,10 +10,10 @@ import ( "runtime" "time" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/pkg/lint" - "github.com/defenseunicorns/zarf/src/pkg/packager/deprecated" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/pkg/lint" + "github.com/zarf-dev/zarf/src/pkg/packager/deprecated" + "github.com/zarf-dev/zarf/src/types" ) // Validate errors if a package violates the schema or any runtime validations diff --git a/src/pkg/packager/deploy.go b/src/pkg/packager/deploy.go index 8c0eb6b7a4..5c174a684f 100644 --- a/src/pkg/packager/deploy.go +++ b/src/pkg/packager/deploy.go @@ -14,28 +14,34 @@ import ( "runtime" "strconv" "strings" - "sync" "time" + "golang.org/x/sync/errgroup" + corev1 "k8s.io/api/core/v1" kerrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/config/lang" - "github.com/defenseunicorns/zarf/src/internal/packager/git" - "github.com/defenseunicorns/zarf/src/internal/packager/helm" - "github.com/defenseunicorns/zarf/src/internal/packager/images" - "github.com/defenseunicorns/zarf/src/internal/packager/template" - "github.com/defenseunicorns/zarf/src/pkg/cluster" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/packager/actions" - "github.com/defenseunicorns/zarf/src/pkg/packager/filters" - "github.com/defenseunicorns/zarf/src/pkg/transform" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/internal/packager/git" + "github.com/zarf-dev/zarf/src/internal/packager/helm" + "github.com/zarf-dev/zarf/src/internal/packager/images" + "github.com/zarf-dev/zarf/src/internal/packager/template" + "github.com/zarf-dev/zarf/src/pkg/cluster" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/packager/actions" + "github.com/zarf-dev/zarf/src/pkg/packager/filters" + "github.com/zarf-dev/zarf/src/pkg/transform" + "github.com/zarf-dev/zarf/src/types" +) + +var ( + // localClusterServiceRegex is used to match the local cluster service format: + localClusterServiceRegex = regexp.MustCompile(`^(?P [^\.]+)\.(?P [^\.]+)\.svc\.cluster\.local$`) ) func (p *Packager) resetRegistryHPA(ctx context.Context) { @@ -288,7 +294,6 @@ func (p *Packager) deployComponent(ctx context.Context, component types.ZarfComp hasCharts := len(component.Charts) > 0 hasManifests := len(component.Manifests) > 0 hasRepos := len(component.Repos) > 0 - hasDataInjections := len(component.DataInjections) > 0 hasFiles := len(component.Files) > 0 onDeploy := component.Actions.OnDeploy @@ -339,14 +344,11 @@ func (p *Packager) deployComponent(ctx context.Context, component types.ZarfComp } } - if hasDataInjections { - waitGroup := sync.WaitGroup{} - defer waitGroup.Wait() - - for idx, data := range component.DataInjections { - waitGroup.Add(1) - go p.cluster.HandleDataInjection(ctx, &waitGroup, data, componentPath, idx) - } + g, gCtx := errgroup.WithContext(ctx) + for idx, data := range component.DataInjections { + g.Go(func() error { + return p.cluster.HandleDataInjection(gCtx, data, componentPath, idx) + }) } if hasCharts || hasManifests { @@ -359,6 +361,10 @@ func (p *Packager) deployComponent(ctx context.Context, component types.ZarfComp return charts, fmt.Errorf("unable to run component after action: %w", err) } + err = g.Wait() + if err != nil { + return nil, err + } return charts, nil } @@ -742,11 +748,7 @@ func serviceInfoFromServiceURL(serviceURL string) (string, string, int, error) { } // Match hostname against local cluster service format. - pattern, err := regexp.Compile(`^(?P [^\.]+)\.(?P [^\.]+)\.svc\.cluster\.local$`) - if err != nil { - return "", "", 0, err - } - get, err := helpers.MatchRegex(pattern, parsedURL.Hostname()) + get, err := helpers.MatchRegex(localClusterServiceRegex, parsedURL.Hostname()) // If incomplete match, return an error. if err != nil { diff --git a/src/pkg/packager/deploy_test.go b/src/pkg/packager/deploy_test.go index 5bb21bfcca..6e82cbcb10 100644 --- a/src/pkg/packager/deploy_test.go +++ b/src/pkg/packager/deploy_test.go @@ -6,10 +6,10 @@ package packager import ( "testing" - "github.com/defenseunicorns/zarf/src/pkg/packager/sources" - "github.com/defenseunicorns/zarf/src/pkg/variables" - "github.com/defenseunicorns/zarf/src/types" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/pkg/packager/sources" + "github.com/zarf-dev/zarf/src/pkg/variables" + "github.com/zarf-dev/zarf/src/types" ) func TestGenerateValuesOverrides(t *testing.T) { diff --git a/src/pkg/packager/deprecated/common.go b/src/pkg/packager/deprecated/common.go index 4867ac52b2..e0dd708c27 100644 --- a/src/pkg/packager/deprecated/common.go +++ b/src/pkg/packager/deprecated/common.go @@ -5,6 +5,7 @@ package deprecated import ( + "errors" "fmt" "io" "strings" @@ -12,9 +13,9 @@ import ( "slices" "github.com/Masterminds/semver/v3" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/types" "github.com/pterm/pterm" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/types" ) // BreakingChange represents a breaking change that happened on a specified Zarf version. @@ -35,7 +36,7 @@ func (bc BreakingChange) String() string { // List of migrations tracked in the zarf.yaml build data. const ( - // This should be updated when a breaking change is introduced to the Zarf package structure. See: https://github.com/defenseunicorns/zarf/releases/tag/v0.27.0 + // This should be updated when a breaking change is introduced to the Zarf package structure. See: https://github.com/zarf-dev/zarf/releases/tag/v0.27.0 LastNonBreakingVersion = "v0.27.0" ScriptsToActionsMigrated = "scripts-to-actions" PluralizeSetVariable = "pluralize-set-variable" @@ -78,11 +79,14 @@ func MigrateComponent(build types.ZarfBuildData, component types.ZarfComponent) } // PrintBreakingChanges prints the breaking changes between the provided version and the current CLIVersion. -func PrintBreakingChanges(w io.Writer, deployedZarfVersion, cliVersion string) { +func PrintBreakingChanges(w io.Writer, deployedZarfVersion, cliVersion string) error { deployedSemver, err := semver.NewVersion(deployedZarfVersion) + // Dev versions of Zarf are not semver. + if errors.Is(err, semver.ErrInvalidSemVer) { + return nil + } if err != nil { - message.Debugf("Unable to check for breaking changes between Zarf versions") - return + return fmt.Errorf("unable to check for breaking changes between Zarf versions: %w", err) } // List of breaking changes to warn the user of. @@ -103,7 +107,7 @@ func PrintBreakingChanges(w io.Writer, deployedZarfVersion, cliVersion string) { } if len(applicableBreakingChanges) == 0 { - return + return nil } // Print header information @@ -123,4 +127,5 @@ func PrintBreakingChanges(w io.Writer, deployedZarfVersion, cliVersion string) { } message.HorizontalRule() + return nil } diff --git a/src/pkg/packager/deprecated/common_test.go b/src/pkg/packager/deprecated/common_test.go index 6dec381554..ed562593ad 100644 --- a/src/pkg/packager/deprecated/common_test.go +++ b/src/pkg/packager/deprecated/common_test.go @@ -9,8 +9,8 @@ import ( "testing" "github.com/Masterminds/semver/v3" - "github.com/defenseunicorns/zarf/src/pkg/message" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/pkg/message" ) func TestPrintBreakingChanges(t *testing.T) { @@ -48,7 +48,8 @@ func TestPrintBreakingChanges(t *testing.T) { t.Parallel() var output bytes.Buffer message.InitializePTerm(&output) - PrintBreakingChanges(&output, tt.deployedVersion, tt.cliVersion) + err := PrintBreakingChanges(&output, tt.deployedVersion, tt.cliVersion) + require.NoError(t, err) for _, bc := range tt.breakingChanges { require.Contains(t, output.String(), bc.String()) } diff --git a/src/pkg/packager/deprecated/pluralize-set-variable.go b/src/pkg/packager/deprecated/pluralize-set-variable.go index c3dc13e06c..44ea9c7f9c 100644 --- a/src/pkg/packager/deprecated/pluralize-set-variable.go +++ b/src/pkg/packager/deprecated/pluralize-set-variable.go @@ -7,8 +7,8 @@ package deprecated import ( "fmt" - "github.com/defenseunicorns/zarf/src/pkg/variables" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/pkg/variables" + "github.com/zarf-dev/zarf/src/types" ) func migrateSetVariableToSetVariables(c types.ZarfComponent) (types.ZarfComponent, string) { diff --git a/src/pkg/packager/deprecated/scripts-to-actions.go b/src/pkg/packager/deprecated/scripts-to-actions.go index 2040e7eb90..f296e49ec3 100644 --- a/src/pkg/packager/deprecated/scripts-to-actions.go +++ b/src/pkg/packager/deprecated/scripts-to-actions.go @@ -8,7 +8,7 @@ import ( "fmt" "math" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/types" ) // migrateScriptsToActions coverts the deprecated scripts to the new actions diff --git a/src/pkg/packager/dev.go b/src/pkg/packager/dev.go index fd55fa1fb8..7713565482 100644 --- a/src/pkg/packager/dev.go +++ b/src/pkg/packager/dev.go @@ -11,13 +11,13 @@ import ( "runtime" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/pkg/lint" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/packager/creator" - "github.com/defenseunicorns/zarf/src/pkg/packager/filters" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/pkg/lint" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/packager/creator" + "github.com/zarf-dev/zarf/src/pkg/packager/filters" + "github.com/zarf-dev/zarf/src/types" ) // DevDeploy creates + deploys a package in one shot diff --git a/src/pkg/packager/filters/deploy.go b/src/pkg/packager/filters/deploy.go index f5ac17916f..40555fb9a2 100644 --- a/src/pkg/packager/filters/deploy.go +++ b/src/pkg/packager/filters/deploy.go @@ -11,8 +11,8 @@ import ( "github.com/agnivade/levenshtein" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/pkg/interactive" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/pkg/interactive" + "github.com/zarf-dev/zarf/src/types" ) // ForDeploy creates a new deployment filter. diff --git a/src/pkg/packager/filters/deploy_test.go b/src/pkg/packager/filters/deploy_test.go index 1bb548f1cb..5b31a2269e 100644 --- a/src/pkg/packager/filters/deploy_test.go +++ b/src/pkg/packager/filters/deploy_test.go @@ -10,8 +10,8 @@ import ( "testing" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/types" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/types" ) func componentFromQuery(t *testing.T, q string) types.ZarfComponent { diff --git a/src/pkg/packager/filters/diff.go b/src/pkg/packager/filters/diff.go index fe722e9741..bbba9ab789 100644 --- a/src/pkg/packager/filters/diff.go +++ b/src/pkg/packager/filters/diff.go @@ -6,10 +6,10 @@ package filters import ( "fmt" - "github.com/defenseunicorns/zarf/src/internal/packager/git" - "github.com/defenseunicorns/zarf/src/pkg/transform" - "github.com/defenseunicorns/zarf/src/types" "github.com/go-git/go-git/v5/plumbing" + "github.com/zarf-dev/zarf/src/internal/packager/git" + "github.com/zarf-dev/zarf/src/pkg/transform" + "github.com/zarf-dev/zarf/src/types" ) // ByDifferentialData filters any images and repos already present in the reference package components. diff --git a/src/pkg/packager/filters/diff_test.go b/src/pkg/packager/filters/diff_test.go index 8ee64fab84..0b279b8f08 100644 --- a/src/pkg/packager/filters/diff_test.go +++ b/src/pkg/packager/filters/diff_test.go @@ -6,8 +6,8 @@ package filters import ( "testing" - "github.com/defenseunicorns/zarf/src/types" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/types" ) func TestCopyFilter(t *testing.T) { diff --git a/src/pkg/packager/filters/empty.go b/src/pkg/packager/filters/empty.go index 860799fb7b..af4eb09663 100644 --- a/src/pkg/packager/filters/empty.go +++ b/src/pkg/packager/filters/empty.go @@ -4,7 +4,7 @@ // Package filters contains core implementations of the ComponentFilterStrategy interface. package filters -import "github.com/defenseunicorns/zarf/src/types" +import "github.com/zarf-dev/zarf/src/types" // Empty returns a filter that does nothing. func Empty() ComponentFilterStrategy { diff --git a/src/pkg/packager/filters/empty_test.go b/src/pkg/packager/filters/empty_test.go index 8096219ad5..8d55fd70ad 100644 --- a/src/pkg/packager/filters/empty_test.go +++ b/src/pkg/packager/filters/empty_test.go @@ -7,8 +7,8 @@ package filters import ( "testing" - "github.com/defenseunicorns/zarf/src/types" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/types" ) func TestEmptyFilter_Apply(t *testing.T) { diff --git a/src/pkg/packager/filters/os.go b/src/pkg/packager/filters/os.go index b031f35bbc..845c0cb400 100644 --- a/src/pkg/packager/filters/os.go +++ b/src/pkg/packager/filters/os.go @@ -7,7 +7,7 @@ package filters import ( "errors" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/types" ) // ByLocalOS creates a new filter that filters components based on local (runtime) OS. diff --git a/src/pkg/packager/filters/os_test.go b/src/pkg/packager/filters/os_test.go index 7d54beecd3..4dcc4b5279 100644 --- a/src/pkg/packager/filters/os_test.go +++ b/src/pkg/packager/filters/os_test.go @@ -7,8 +7,8 @@ package filters import ( "testing" - "github.com/defenseunicorns/zarf/src/types" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/types" ) func TestLocalOSFilter(t *testing.T) { diff --git a/src/pkg/packager/filters/select.go b/src/pkg/packager/filters/select.go index 9116efe453..35694f580f 100644 --- a/src/pkg/packager/filters/select.go +++ b/src/pkg/packager/filters/select.go @@ -6,7 +6,7 @@ package filters import ( "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/types" ) // BySelectState creates a new simple included filter. diff --git a/src/pkg/packager/filters/select_test.go b/src/pkg/packager/filters/select_test.go index 9d87fbf014..b4d4ac9289 100644 --- a/src/pkg/packager/filters/select_test.go +++ b/src/pkg/packager/filters/select_test.go @@ -7,8 +7,8 @@ package filters import ( "testing" - "github.com/defenseunicorns/zarf/src/types" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/types" ) func Test_selectStateFilter_Apply(t *testing.T) { diff --git a/src/pkg/packager/filters/strat.go b/src/pkg/packager/filters/strat.go index 497778b2df..1411ae3c5f 100644 --- a/src/pkg/packager/filters/strat.go +++ b/src/pkg/packager/filters/strat.go @@ -7,7 +7,7 @@ package filters import ( "fmt" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/types" ) // ComponentFilterStrategy is a strategy interface for filtering components. diff --git a/src/pkg/packager/filters/strat_test.go b/src/pkg/packager/filters/strat_test.go index 5f5391153c..12f7dad86e 100644 --- a/src/pkg/packager/filters/strat_test.go +++ b/src/pkg/packager/filters/strat_test.go @@ -7,8 +7,8 @@ package filters import ( "testing" - "github.com/defenseunicorns/zarf/src/types" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/types" ) func TestCombine(t *testing.T) { diff --git a/src/pkg/packager/generate.go b/src/pkg/packager/generate.go index d03e80c88d..d1fc593033 100644 --- a/src/pkg/packager/generate.go +++ b/src/pkg/packager/generate.go @@ -5,21 +5,22 @@ package packager import ( + "context" "fmt" "os" "path/filepath" "strings" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/types" goyaml "github.com/goccy/go-yaml" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/types" ) // Generate generates a Zarf package definition. -func (p *Packager) Generate() (err error) { +func (p *Packager) Generate(ctx context.Context) (err error) { generatedZarfYAMLPath := filepath.Join(p.cfg.GenerateOpts.Output, layout.ZarfYAML) spinner := message.NewProgressSpinner("Generating package for %q at %s", p.cfg.GenerateOpts.Name, generatedZarfYAMLPath) @@ -61,7 +62,7 @@ func (p *Packager) Generate() (err error) { }, } - images, err := p.findImages() + images, err := p.findImages(ctx) if err != nil { // purposefully not returning error here, as we can still generate the package without images message.Warnf("Unable to find images: %s", err.Error()) diff --git a/src/pkg/packager/inspect.go b/src/pkg/packager/inspect.go index d68ae5f5de..bfa29d860b 100644 --- a/src/pkg/packager/inspect.go +++ b/src/pkg/packager/inspect.go @@ -10,8 +10,8 @@ import ( "os" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/internal/packager/sbom" - "github.com/defenseunicorns/zarf/src/pkg/utils" + "github.com/zarf-dev/zarf/src/internal/packager/sbom" + "github.com/zarf-dev/zarf/src/pkg/utils" ) // Inspect list the contents of a package. diff --git a/src/pkg/packager/interactive.go b/src/pkg/packager/interactive.go index 8c67fd55fe..3a09595eab 100644 --- a/src/pkg/packager/interactive.go +++ b/src/pkg/packager/interactive.go @@ -11,11 +11,11 @@ import ( "github.com/AlecAivazis/survey/v2" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/utils" "github.com/pterm/pterm" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/utils" ) func (p *Packager) confirmAction(stage string, warnings []string, sbomViewFiles []string) (confirm bool) { diff --git a/src/pkg/packager/mirror.go b/src/pkg/packager/mirror.go index 27ffaf9c18..9cafe38f58 100644 --- a/src/pkg/packager/mirror.go +++ b/src/pkg/packager/mirror.go @@ -10,10 +10,10 @@ import ( "runtime" "strings" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/packager/filters" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/packager/filters" + "github.com/zarf-dev/zarf/src/types" ) // Mirror pulls resources from a package (images, git repositories, etc) and pushes them to remotes in the air gap without deploying them diff --git a/src/pkg/packager/prepare.go b/src/pkg/packager/prepare.go index 9a4f7a1280..340ac1c85a 100644 --- a/src/pkg/packager/prepare.go +++ b/src/pkg/packager/prepare.go @@ -16,16 +16,16 @@ import ( "github.com/goccy/go-yaml" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/config/lang" - "github.com/defenseunicorns/zarf/src/internal/packager/helm" - "github.com/defenseunicorns/zarf/src/internal/packager/images" - "github.com/defenseunicorns/zarf/src/internal/packager/kustomize" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/packager/creator" - "github.com/defenseunicorns/zarf/src/pkg/utils" - "github.com/defenseunicorns/zarf/src/types" "github.com/google/go-containerregistry/pkg/crane" + "github.com/zarf-dev/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/internal/packager/helm" + "github.com/zarf-dev/zarf/src/internal/packager/images" + "github.com/zarf-dev/zarf/src/internal/packager/kustomize" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/packager/creator" + "github.com/zarf-dev/zarf/src/pkg/utils" + "github.com/zarf-dev/zarf/src/types" v1 "k8s.io/api/apps/v1" batchv1 "k8s.io/api/batch/v1" corev1 "k8s.io/api/core/v1" @@ -70,10 +70,10 @@ func (p *Packager) FindImages(ctx context.Context) (map[string][]string, error) message.Warn(warning) } - return p.findImages() + return p.findImages(ctx) } -func (p *Packager) findImages() (imgMap map[string][]string, err error) { +func (p *Packager) findImages(ctx context.Context) (imgMap map[string][]string, err error) { repoHelmChartPath := p.cfg.FindImagesOpts.RepoHelmChartPath kubeVersionOverride := p.cfg.FindImagesOpts.KubeVersionOverride whyImage := p.cfg.FindImagesOpts.Why @@ -172,7 +172,7 @@ func (p *Packager) findImages() (imgMap map[string][]string, err error) { helm.WithVariableConfig(p.variableConfig), ) - err = helmCfg.PackageChart(component.DeprecatedCosignKeyPath) + err = helmCfg.PackageChart(ctx, component.DeprecatedCosignKeyPath) if err != nil { return nil, fmt.Errorf("unable to package the chart %s: %w", chart.Name, err) } diff --git a/src/pkg/packager/publish.go b/src/pkg/packager/publish.go index 6f5e90843c..bf664f2739 100644 --- a/src/pkg/packager/publish.go +++ b/src/pkg/packager/publish.go @@ -12,16 +12,16 @@ import ( "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/pkg/oci" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/packager/creator" - "github.com/defenseunicorns/zarf/src/pkg/packager/filters" - "github.com/defenseunicorns/zarf/src/pkg/packager/sources" - "github.com/defenseunicorns/zarf/src/pkg/utils" - "github.com/defenseunicorns/zarf/src/pkg/zoci" - "github.com/defenseunicorns/zarf/src/types" ocispec "github.com/opencontainers/image-spec/specs-go/v1" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/packager/creator" + "github.com/zarf-dev/zarf/src/pkg/packager/filters" + "github.com/zarf-dev/zarf/src/pkg/packager/sources" + "github.com/zarf-dev/zarf/src/pkg/utils" + "github.com/zarf-dev/zarf/src/pkg/zoci" + "github.com/zarf-dev/zarf/src/types" ) // Publish publishes the package to a registry diff --git a/src/pkg/packager/remove.go b/src/pkg/packager/remove.go index be34b6dda7..dbfbf7d690 100644 --- a/src/pkg/packager/remove.go +++ b/src/pkg/packager/remove.go @@ -18,14 +18,14 @@ import ( kerrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/internal/packager/helm" - "github.com/defenseunicorns/zarf/src/pkg/cluster" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/packager/actions" - "github.com/defenseunicorns/zarf/src/pkg/packager/filters" - "github.com/defenseunicorns/zarf/src/pkg/packager/sources" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/internal/packager/helm" + "github.com/zarf-dev/zarf/src/pkg/cluster" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/packager/actions" + "github.com/zarf-dev/zarf/src/pkg/packager/filters" + "github.com/zarf-dev/zarf/src/pkg/packager/sources" + "github.com/zarf-dev/zarf/src/types" ) // Remove removes a package that was already deployed onto a cluster, uninstalling all installed helm charts. diff --git a/src/pkg/packager/sources/cluster.go b/src/pkg/packager/sources/cluster.go index 5936c5d6f0..bd671120e8 100644 --- a/src/pkg/packager/sources/cluster.go +++ b/src/pkg/packager/sources/cluster.go @@ -9,11 +9,11 @@ import ( "fmt" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/pkg/cluster" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/pkg/packager/filters" - "github.com/defenseunicorns/zarf/src/pkg/utils" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/pkg/cluster" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/pkg/packager/filters" + "github.com/zarf-dev/zarf/src/pkg/utils" + "github.com/zarf-dev/zarf/src/types" ) var ( diff --git a/src/pkg/packager/sources/new.go b/src/pkg/packager/sources/new.go index c9f1f46a14..9018632085 100644 --- a/src/pkg/packager/sources/new.go +++ b/src/pkg/packager/sources/new.go @@ -12,12 +12,12 @@ import ( "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/pkg/oci" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/packager/filters" - "github.com/defenseunicorns/zarf/src/pkg/zoci" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/packager/filters" + "github.com/zarf-dev/zarf/src/pkg/zoci" + "github.com/zarf-dev/zarf/src/types" ) // PackageSource is an interface for package sources. diff --git a/src/pkg/packager/sources/new_test.go b/src/pkg/packager/sources/new_test.go index 9c7629ba42..a1a495b3ca 100644 --- a/src/pkg/packager/sources/new_test.go +++ b/src/pkg/packager/sources/new_test.go @@ -17,9 +17,9 @@ import ( "github.com/stretchr/testify/require" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/pkg/packager/filters" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/pkg/packager/filters" + "github.com/zarf-dev/zarf/src/types" ) func TestNewPackageSource(t *testing.T) { @@ -51,13 +51,13 @@ func TestNewPackageSource(t *testing.T) { }, { name: "https", - src: "https://github.com/defenseunicorns/zarf/releases/download/v1.0.0/zarf-init-amd64-v1.0.0.tar.zst", + src: "https://github.com/zarf-dev/zarf/releases/download/v1.0.0/zarf-init-amd64-v1.0.0.tar.zst", expectedIdentify: "https", expectedType: &URLSource{}, }, { name: "http", - src: "http://github.com/defenseunicorns/zarf/releases/download/v1.0.0/zarf-init-amd64-v1.0.0.tar.zst", + src: "http://github.com/zarf-dev/zarf/releases/download/v1.0.0/zarf-init-amd64-v1.0.0.tar.zst", expectedIdentify: "http", expectedType: &URLSource{}, }, diff --git a/src/pkg/packager/sources/oci.go b/src/pkg/packager/sources/oci.go index 84ba85ebaf..99a98137fc 100644 --- a/src/pkg/packager/sources/oci.go +++ b/src/pkg/packager/sources/oci.go @@ -12,14 +12,14 @@ import ( "path/filepath" "strings" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/packager/filters" - "github.com/defenseunicorns/zarf/src/pkg/utils" - "github.com/defenseunicorns/zarf/src/pkg/zoci" - "github.com/defenseunicorns/zarf/src/types" "github.com/mholt/archiver/v3" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/packager/filters" + "github.com/zarf-dev/zarf/src/pkg/utils" + "github.com/zarf-dev/zarf/src/pkg/zoci" + "github.com/zarf-dev/zarf/src/types" ) var ( diff --git a/src/pkg/packager/sources/split.go b/src/pkg/packager/sources/split.go index 1594a51c20..473aa0008a 100644 --- a/src/pkg/packager/sources/split.go +++ b/src/pkg/packager/sources/split.go @@ -15,10 +15,10 @@ import ( "strings" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/packager/filters" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/packager/filters" + "github.com/zarf-dev/zarf/src/types" ) var ( diff --git a/src/pkg/packager/sources/tarball.go b/src/pkg/packager/sources/tarball.go index 663a4bd31c..b99253c0a5 100644 --- a/src/pkg/packager/sources/tarball.go +++ b/src/pkg/packager/sources/tarball.go @@ -14,12 +14,12 @@ import ( "path/filepath" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/packager/filters" - "github.com/defenseunicorns/zarf/src/pkg/zoci" - "github.com/defenseunicorns/zarf/src/types" "github.com/mholt/archiver/v3" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/packager/filters" + "github.com/zarf-dev/zarf/src/pkg/zoci" + "github.com/zarf-dev/zarf/src/types" ) var ( diff --git a/src/pkg/packager/sources/url.go b/src/pkg/packager/sources/url.go index 9fa3cfb8e0..02fc785d81 100644 --- a/src/pkg/packager/sources/url.go +++ b/src/pkg/packager/sources/url.go @@ -12,11 +12,11 @@ import ( "strings" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/pkg/packager/filters" - "github.com/defenseunicorns/zarf/src/pkg/utils" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/pkg/packager/filters" + "github.com/zarf-dev/zarf/src/pkg/utils" + "github.com/zarf-dev/zarf/src/types" ) var ( diff --git a/src/pkg/packager/sources/utils.go b/src/pkg/packager/sources/utils.go index f880e11d0e..bb2e3227d9 100644 --- a/src/pkg/packager/sources/utils.go +++ b/src/pkg/packager/sources/utils.go @@ -12,12 +12,12 @@ import ( "strings" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/pkg/zoci" - "github.com/defenseunicorns/zarf/src/types" goyaml "github.com/goccy/go-yaml" "github.com/mholt/archiver/v3" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/pkg/zoci" + "github.com/zarf-dev/zarf/src/types" ) // GetValidPackageExtensions returns the valid package extensions. diff --git a/src/pkg/packager/sources/validate.go b/src/pkg/packager/sources/validate.go index 1d8a4f6255..427d05708a 100644 --- a/src/pkg/packager/sources/validate.go +++ b/src/pkg/packager/sources/validate.go @@ -14,10 +14,10 @@ import ( "strings" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/pkg/utils" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/utils" ) var ( diff --git a/src/pkg/pki/pki.go b/src/pkg/pki/pki.go index 6923042393..0eaf5ea82b 100644 --- a/src/pkg/pki/pki.go +++ b/src/pkg/pki/pki.go @@ -16,7 +16,7 @@ import ( "time" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/types" ) // Based off of https://github.com/dmcgowan/quicktls/blob/master/main.go diff --git a/src/pkg/transform/git_test.go b/src/pkg/transform/git_test.go index 70145275aa..19c5778966 100644 --- a/src/pkg/transform/git_test.go +++ b/src/pkg/transform/git_test.go @@ -13,9 +13,9 @@ import ( var gitURLs = []string{ // Normal git repos and references for pushing/pulling "https://repo1.dso.mil/platform-one/big-bang/apps/security-tools/twistlock.git", - "https://github.com/defenseunicorns/zarf.git", + "https://github.com/zarf-dev/zarf.git", "https://ghcr.io/stefanprodan/podinfo_fasd-123.git", - "git://k3d-cluster.localhost/defenseunicorns/zarf-agent", + "git://k3d-cluster.localhost/zarf-dev/zarf-agent", "http://localhost:5000/some-cool-repo", "ssh://ghcr.io/stefanprodan/podinfo@6.0.0", "https://stefanprodan/podinfo.git@adf0fasd10.1.223124123123-asdf", @@ -23,19 +23,19 @@ var gitURLs = []string{ "file:///srv/git/stefanprodan/podinfo@adf0fasd10.1.223124123123-asdf", "https://me0515@dev.azure.com/me0515/zarf-public-test/_git/zarf-public-test", "https://me0515@dev.azure.com/me0515/zarf-public-test/_git/zarf-public-test@524980951ff16e19dc25232e9aea8fd693989ba6", - "https://github.com/defenseunicorns/zarf.helm.git", - "https://github.com/defenseunicorns/zarf.git@refs/tags/v0.16.0", + "https://github.com/zarf-dev/zarf.helm.git", + "https://github.com/zarf-dev/zarf.git@refs/tags/v0.16.0", "https://github.com/DoD-Platform-One/big-bang.git@refs/heads/release-1.54.x", "https://github.com/prometheus-community/helm-charts.git@kube-prometheus-stack-47.3.0", "https://github.com/prometheus-community/", "https://github.com/", // Smart Git Protocol URLs for proxying (https://www.git-scm.com/docs/http-protocol) - "https://github.com/defenseunicorns/zarf.helm.git/info/refs", - "https://github.com/defenseunicorns/zarf.helm.git/info/refs?service=git-upload-pack", - "https://github.com/defenseunicorns/zarf.helm.git/info/refs?service=git-receive-pack", - "https://github.com/defenseunicorns/zarf.helm.git/git-upload-pack", - "https://github.com/defenseunicorns/zarf.helm.git/git-receive-pack", + "https://github.com/zarf-dev/zarf.helm.git/info/refs", + "https://github.com/zarf-dev/zarf.helm.git/info/refs?service=git-upload-pack", + "https://github.com/zarf-dev/zarf.helm.git/info/refs?service=git-receive-pack", + "https://github.com/zarf-dev/zarf.helm.git/git-upload-pack", + "https://github.com/zarf-dev/zarf.helm.git/git-receive-pack", } var badGitURLs = []string{ @@ -48,11 +48,11 @@ func TestMutateGitURLsInText(t *testing.T) { originalText := ` # Here we handle invalid URLs (see below comment) # We transform https://*/*.git URLs - https://github.com/defenseunicorns/zarf.git + https://github.com/zarf-dev/zarf.git # Even URLs with things on either side - stuff https://github.com/defenseunicorns/zarf.git andthings + stuff https://github.com/zarf-dev/zarf.git andthings # Including ssh://*/*.git URLs - ssh://git@github.com/defenseunicorns/zarf.git + ssh://git@github.com/zarf-dev/zarf.git # Or non .git URLs https://www.defenseunicorns.com/ ` @@ -60,11 +60,11 @@ func TestMutateGitURLsInText(t *testing.T) { expectedText := ` # Here we handle invalid URLs (see below comment) # We transform https://*/*.git URLs - https://gitlab.com/repo-owner/zarf-1211668992.git + https://gitlab.com/repo-owner/zarf-4156197301.git # Even URLs with things on either side - stuff https://gitlab.com/repo-owner/zarf-1211668992.git andthings + stuff https://gitlab.com/repo-owner/zarf-4156197301.git andthings # Including ssh://*/*.git URLs - https://gitlab.com/repo-owner/zarf-2566185087.git + https://gitlab.com/repo-owner/zarf-1231196790.git # Or non .git URLs https://www.defenseunicorns.com/ ` @@ -77,9 +77,9 @@ func TestGitURLSplitRef(t *testing.T) { var expectedResult = [][]string{ // Normal git repos and references for pushing/pulling {"https://repo1.dso.mil/platform-one/big-bang/apps/security-tools/twistlock.git", ""}, - {"https://github.com/defenseunicorns/zarf.git", ""}, + {"https://github.com/zarf-dev/zarf.git", ""}, {"https://ghcr.io/stefanprodan/podinfo_fasd-123.git", ""}, - {"git://k3d-cluster.localhost/defenseunicorns/zarf-agent", ""}, + {"git://k3d-cluster.localhost/zarf-dev/zarf-agent", ""}, {"http://localhost:5000/some-cool-repo", ""}, {"ssh://ghcr.io/stefanprodan/podinfo", "6.0.0"}, {"https://stefanprodan/podinfo.git", "adf0fasd10.1.223124123123-asdf"}, @@ -87,19 +87,19 @@ func TestGitURLSplitRef(t *testing.T) { {"file:///srv/git/stefanprodan/podinfo", "adf0fasd10.1.223124123123-asdf"}, {"https://me0515@dev.azure.com/me0515/zarf-public-test/_git/zarf-public-test", ""}, {"https://me0515@dev.azure.com/me0515/zarf-public-test/_git/zarf-public-test", "524980951ff16e19dc25232e9aea8fd693989ba6"}, - {"https://github.com/defenseunicorns/zarf.helm.git", ""}, - {"https://github.com/defenseunicorns/zarf.git", "refs/tags/v0.16.0"}, + {"https://github.com/zarf-dev/zarf.helm.git", ""}, + {"https://github.com/zarf-dev/zarf.git", "refs/tags/v0.16.0"}, {"https://github.com/DoD-Platform-One/big-bang.git", "refs/heads/release-1.54.x"}, {"https://github.com/prometheus-community/helm-charts.git", "kube-prometheus-stack-47.3.0"}, {"https://github.com/prometheus-community", ""}, {"https://github.com/", ""}, // Smart Git Protocol URLs for proxying (https://www.git-scm.com/docs/http-protocol) - {"https://github.com/defenseunicorns/zarf.helm.git", ""}, - {"https://github.com/defenseunicorns/zarf.helm.git", ""}, - {"https://github.com/defenseunicorns/zarf.helm.git", ""}, - {"https://github.com/defenseunicorns/zarf.helm.git", ""}, - {"https://github.com/defenseunicorns/zarf.helm.git", ""}, + {"https://github.com/zarf-dev/zarf.helm.git", ""}, + {"https://github.com/zarf-dev/zarf.helm.git", ""}, + {"https://github.com/zarf-dev/zarf.helm.git", ""}, + {"https://github.com/zarf-dev/zarf.helm.git", ""}, + {"https://github.com/zarf-dev/zarf.helm.git", ""}, } for idx, url := range gitURLs { @@ -119,9 +119,9 @@ func TestGitURLtoFolderName(t *testing.T) { var expectedResult = []string{ // Normal git repos and references for pushing/pulling "twistlock-1590638614", - "zarf-3863619701", + "zarf-3457133088", "podinfo_fasd-123-1478387306", - "zarf-agent-802453811", + "zarf-agent-927663661", "some-cool-repo-1916670310", "podinfo-1350532569", "podinfo-1853010387", @@ -129,19 +129,19 @@ func TestGitURLtoFolderName(t *testing.T) { "podinfo-122075437", "zarf-public-test-612413317", "zarf-public-test-634307705", - "zarf.helm-2570741950", - "zarf-2175050463", + "zarf.helm-93697844", + "zarf-2360044954", "big-bang-2705706079", "helm-charts-1319967699", "prometheus-community-3453166319", "-1276058275", // Smart Git Protocol URLs for proxying (https://www.git-scm.com/docs/http-protocol) - "zarf.helm-2570741950", - "zarf.helm-2570741950", - "zarf.helm-2570741950", - "zarf.helm-2570741950", - "zarf.helm-2570741950", + "zarf.helm-93697844", + "zarf.helm-93697844", + "zarf.helm-93697844", + "zarf.helm-93697844", + "zarf.helm-93697844", } for idx, url := range gitURLs { @@ -160,9 +160,9 @@ func TestGitURLtoRepoName(t *testing.T) { var expectedResult = []string{ // Normal git repos and references for pushing/pulling "twistlock-97328248", - "zarf-1211668992", + "zarf-4156197301", "podinfo_fasd-123-84577122", - "zarf-agent-3633494462", + "zarf-agent-1776579160", "some-cool-repo-926913879", "podinfo-2985051089", "podinfo-2197246515", @@ -170,19 +170,19 @@ func TestGitURLtoRepoName(t *testing.T) { "podinfo-1175499642", "zarf-public-test-2170732467", "zarf-public-test-2170732467", - "zarf.helm-842267124", - "zarf-1211668992", + "zarf.helm-693435256", + "zarf-4156197301", "big-bang-2366614037", "helm-charts-3648076006", "prometheus-community-2749132599", "-98306241", // Smart Git Protocol URLs for proxying (https://www.git-scm.com/docs/http-protocol) - "zarf.helm-842267124", - "zarf.helm-842267124", - "zarf.helm-842267124", - "zarf.helm-842267124", - "zarf.helm-842267124", + "zarf.helm-693435256", + "zarf.helm-693435256", + "zarf.helm-693435256", + "zarf.helm-693435256", + "zarf.helm-693435256", } for idx, url := range gitURLs { @@ -201,9 +201,9 @@ func TestGitURL(t *testing.T) { var expectedResult = []string{ // Normal git repos and references for pushing/pulling "https://gitlab.com/repo-owner/twistlock-97328248.git", - "https://gitlab.com/repo-owner/zarf-1211668992.git", + "https://gitlab.com/repo-owner/zarf-4156197301.git", "https://gitlab.com/repo-owner/podinfo_fasd-123-84577122.git", - "https://gitlab.com/repo-owner/zarf-agent-3633494462", + "https://gitlab.com/repo-owner/zarf-agent-1776579160", "https://gitlab.com/repo-owner/some-cool-repo-926913879", "https://gitlab.com/repo-owner/podinfo-2985051089", "https://gitlab.com/repo-owner/podinfo-2197246515.git", @@ -211,19 +211,19 @@ func TestGitURL(t *testing.T) { "https://gitlab.com/repo-owner/podinfo-1175499642", "https://gitlab.com/repo-owner/zarf-public-test-2170732467", "https://gitlab.com/repo-owner/zarf-public-test-2170732467", - "https://gitlab.com/repo-owner/zarf.helm-842267124.git", - "https://gitlab.com/repo-owner/zarf-1211668992.git", + "https://gitlab.com/repo-owner/zarf.helm-693435256.git", + "https://gitlab.com/repo-owner/zarf-4156197301.git", "https://gitlab.com/repo-owner/big-bang-2366614037.git", "https://gitlab.com/repo-owner/helm-charts-3648076006.git", "https://gitlab.com/repo-owner/prometheus-community-2749132599", "https://gitlab.com/repo-owner/-98306241", // Smart Git Protocol URLs for proxying (https://www.git-scm.com/docs/http-protocol) - "https://gitlab.com/repo-owner/zarf.helm-842267124.git/info/refs", - "https://gitlab.com/repo-owner/zarf.helm-842267124.git/info/refs?service=git-upload-pack", - "https://gitlab.com/repo-owner/zarf.helm-842267124.git/info/refs?service=git-receive-pack", - "https://gitlab.com/repo-owner/zarf.helm-842267124.git/git-upload-pack", - "https://gitlab.com/repo-owner/zarf.helm-842267124.git/git-receive-pack", + "https://gitlab.com/repo-owner/zarf.helm-693435256.git/info/refs", + "https://gitlab.com/repo-owner/zarf.helm-693435256.git/info/refs?service=git-upload-pack", + "https://gitlab.com/repo-owner/zarf.helm-693435256.git/info/refs?service=git-receive-pack", + "https://gitlab.com/repo-owner/zarf.helm-693435256.git/git-upload-pack", + "https://gitlab.com/repo-owner/zarf.helm-693435256.git/git-receive-pack", } for idx, url := range gitURLs { diff --git a/src/pkg/transform/image_test.go b/src/pkg/transform/image_test.go index cc61154efa..13fd300c25 100644 --- a/src/pkg/transform/image_test.go +++ b/src/pkg/transform/image_test.go @@ -13,11 +13,11 @@ import ( var imageRefs = []string{ "nginx", "nginx:1.23.3", - "defenseunicorns/zarf-agent:v0.22.1", - "defenseunicorns/zarf-agent@sha256:84605f731c6a18194794c51e70021c671ab064654b751aa57e905bce55be13de", + "zarf-dev/zarf-agent:v0.22.1", + "zarf-dev/zarf-agent@sha256:84605f731c6a18194794c51e70021c671ab064654b751aa57e905bce55be13de", "busybox:latest@sha256:3fbc632167424a6d997e74f52b878d7cc478225cffac6bc977eedfe51c7f4e79", "ghcr.io/stefanprodan/podinfo:6.3.3", - "registry1.dso.mil/ironbank/opensource/defenseunicorns/zarf/zarf-agent:v0.25.0", + "registry1.dso.mil/ironbank/opensource/zarf-dev/zarf/zarf-agent:v0.25.0", "gitlab.com/project/gitea/gitea:1.19.3-rootless-zarf-3431384023", "oci://10.43.130.183:5000/stefanprodan/manifests/podinfo", } @@ -33,11 +33,11 @@ func TestImageTransformHost(t *testing.T) { // Normal git repos and references for pushing/pulling "gitlab.com/project/library/nginx:latest-zarf-3793515731", "gitlab.com/project/library/nginx:1.23.3-zarf-3793515731", - "gitlab.com/project/defenseunicorns/zarf-agent:v0.22.1-zarf-4283503412", - "gitlab.com/project/defenseunicorns/zarf-agent@sha256:84605f731c6a18194794c51e70021c671ab064654b751aa57e905bce55be13de", + "gitlab.com/project/zarf-dev/zarf-agent:v0.22.1-zarf-2183797434", + "gitlab.com/project/zarf-dev/zarf-agent@sha256:84605f731c6a18194794c51e70021c671ab064654b751aa57e905bce55be13de", "gitlab.com/project/library/busybox@sha256:3fbc632167424a6d997e74f52b878d7cc478225cffac6bc977eedfe51c7f4e79", "gitlab.com/project/stefanprodan/podinfo:6.3.3-zarf-2985051089", - "gitlab.com/project/ironbank/opensource/defenseunicorns/zarf/zarf-agent:v0.25.0-zarf-2003217571", + "gitlab.com/project/ironbank/opensource/zarf-dev/zarf/zarf-agent:v0.25.0-zarf-1211467612", "gitlab.com/project/gitea/gitea:1.19.3-rootless-zarf-3431384023", "gitlab.com/project/stefanprodan/manifests/podinfo:latest-zarf-531355090", } @@ -58,11 +58,11 @@ func TestImageTransformHostWithoutChecksum(t *testing.T) { var expectedResult = []string{ "gitlab.com/project/library/nginx:latest", "gitlab.com/project/library/nginx:1.23.3", - "gitlab.com/project/defenseunicorns/zarf-agent:v0.22.1", - "gitlab.com/project/defenseunicorns/zarf-agent@sha256:84605f731c6a18194794c51e70021c671ab064654b751aa57e905bce55be13de", + "gitlab.com/project/zarf-dev/zarf-agent:v0.22.1", + "gitlab.com/project/zarf-dev/zarf-agent@sha256:84605f731c6a18194794c51e70021c671ab064654b751aa57e905bce55be13de", "gitlab.com/project/library/busybox@sha256:3fbc632167424a6d997e74f52b878d7cc478225cffac6bc977eedfe51c7f4e79", "gitlab.com/project/stefanprodan/podinfo:6.3.3", - "gitlab.com/project/ironbank/opensource/defenseunicorns/zarf/zarf-agent:v0.25.0", + "gitlab.com/project/ironbank/opensource/zarf-dev/zarf/zarf-agent:v0.25.0", "gitlab.com/project/gitea/gitea:1.19.3-rootless-zarf-3431384023", "gitlab.com/project/stefanprodan/manifests/podinfo:latest", } @@ -83,11 +83,11 @@ func TestParseImageRef(t *testing.T) { var expectedResult = [][]string{ {"docker.io/", "library/nginx", "latest", ""}, {"docker.io/", "library/nginx", "1.23.3", ""}, - {"docker.io/", "defenseunicorns/zarf-agent", "v0.22.1", ""}, - {"docker.io/", "defenseunicorns/zarf-agent", "", "sha256:84605f731c6a18194794c51e70021c671ab064654b751aa57e905bce55be13de"}, + {"docker.io/", "zarf-dev/zarf-agent", "v0.22.1", ""}, + {"docker.io/", "zarf-dev/zarf-agent", "", "sha256:84605f731c6a18194794c51e70021c671ab064654b751aa57e905bce55be13de"}, {"docker.io/", "library/busybox", "latest", "sha256:3fbc632167424a6d997e74f52b878d7cc478225cffac6bc977eedfe51c7f4e79"}, {"ghcr.io/", "stefanprodan/podinfo", "6.3.3", ""}, - {"registry1.dso.mil/", "ironbank/opensource/defenseunicorns/zarf/zarf-agent", "v0.25.0", ""}, + {"registry1.dso.mil/", "ironbank/opensource/zarf-dev/zarf/zarf-agent", "v0.25.0", ""}, {"gitlab.com/", "project/gitea/gitea", "1.19.3-rootless-zarf-3431384023", ""}, {"10.43.130.183:5000/", "stefanprodan/manifests/podinfo", "latest", ""}, } diff --git a/src/pkg/utils/auth.go b/src/pkg/utils/auth.go index 69a313cc13..0bc5cf501a 100644 --- a/src/pkg/utils/auth.go +++ b/src/pkg/utils/auth.go @@ -6,13 +6,12 @@ package utils import ( "bufio" - "io" + "errors" "net/url" "os" "path/filepath" "strings" - "github.com/defenseunicorns/zarf/src/pkg/message" "github.com/go-git/go-git/v5/plumbing/transport/http" ) @@ -23,47 +22,47 @@ type Credential struct { } // FindAuthForHost finds the authentication scheme for a given host using .git-credentials then .netrc. -func FindAuthForHost(baseURL string) *Credential { +func FindAuthForHost(baseURL string) (*Credential, error) { homePath, _ := os.UserHomeDir() // Read the ~/.git-credentials file credentialsPath := filepath.Join(homePath, ".git-credentials") - // Dogsled the error since we are ok if this file doesn't exist (error message debugged on close) - credentialsFile, _ := os.Open(credentialsPath) - gitCreds := credentialParser(credentialsFile) + gitCreds, err := credentialParser(credentialsPath) + if err != nil { + return nil, err + } // Read the ~/.netrc file netrcPath := filepath.Join(homePath, ".netrc") - // Dogsled the error since we are ok if this file doesn't exist (error message debugged on close) - netrcFile, _ := os.Open(netrcPath) - netrcCreds := netrcParser(netrcFile) + netrcCreds, err := netrcParser(netrcPath) + if err != nil { + return nil, err + } // Combine the creds together (.netrc second because it could have a default) creds := append(gitCreds, netrcCreds...) - - // Look for a match for the given host path in the creds file for _, cred := range creds { // An empty credPath means that we have reached the default from the .netrc hasPath := strings.Contains(baseURL, cred.Path) || cred.Path == "" if hasPath { - return &cred + return &cred, nil } } - - return nil + return nil, nil } // credentialParser parses a user's .git-credentials file to find git creds for hosts. -func credentialParser(file io.ReadCloser) []Credential { - var credentials []Credential - - defer func(file io.ReadCloser) { - err := file.Close() - if err != nil { - message.Debugf("Unable to load an existing git credentials file: %s", err.Error()) - } - }(file) +func credentialParser(path string) ([]Credential, error) { + file, err := os.Open(path) + if errors.Is(err, os.ErrNotExist) { + return nil, nil + } + if err != nil { + return nil, err + } + defer file.Close() + var credentials []Credential scanner := bufio.NewScanner(file) for scanner.Scan() { gitURL, err := url.Parse(scanner.Text()) @@ -80,27 +79,25 @@ func credentialParser(file io.ReadCloser) []Credential { } credentials = append(credentials, credential) } - - return credentials + return credentials, nil } // netrcParser parses a user's .netrc file using the method curl did pre 7.84.0: https://daniel.haxx.se/blog/2022/05/31/netrc-pains/. -func netrcParser(file io.ReadCloser) []Credential { - var credentials []Credential - - defer func(file io.ReadCloser) { - err := file.Close() - if err != nil { - message.Debugf("Unable to load an existing netrc file: %s", err.Error()) - } - }(file) +func netrcParser(path string) ([]Credential, error) { + file, err := os.Open(path) + if errors.Is(err, os.ErrNotExist) { + return nil, nil + } + if err != nil { + return nil, err + } + defer file.Close() + var credentials []Credential scanner := bufio.NewScanner(file) - activeMacro := false activeCommand := "" var activeMachine map[string]string - for scanner.Scan() { line := scanner.Text() @@ -154,13 +151,11 @@ func netrcParser(file io.ReadCloser) []Credential { } } } - // Append the last machine (if exists) at the end of the file if activeMachine != nil { credentials = appendNetrcMachine(activeMachine, credentials) } - - return credentials + return credentials, nil } func appendNetrcMachine(machine map[string]string, credentials []Credential) []Credential { diff --git a/src/pkg/utils/auth_test.go b/src/pkg/utils/auth_test.go index 6260e7af0d..bad85c2c4a 100644 --- a/src/pkg/utils/auth_test.go +++ b/src/pkg/utils/auth_test.go @@ -5,23 +5,25 @@ package utils import ( + "os" + "path/filepath" "testing" - mocks "github.com/defenseunicorns/zarf/src/test/mocks" "github.com/go-git/go-git/v5/plumbing/transport/http" "github.com/stretchr/testify/require" ) func TestCredentialParser(t *testing.T) { - credentialsFile := &mocks.MockReadCloser{ - MockData: []byte( - `https://wayne:password@github.com/ + t.Parallel() + + data := `https://wayne:password@github.com/ bad line https://wayne:p%40ss%20word%2520@zarf.dev -http://google.com`, - ), - } +http://google.com` + path := filepath.Join(t.TempDir(), "file") + err := os.WriteFile(path, []byte(data), 0o644) + require.NoError(t, err) expectedCreds := []Credential{ { @@ -47,15 +49,15 @@ http://google.com`, }, } - gitCredentials := credentialParser(credentialsFile) + gitCredentials, err := credentialParser(path) + require.NoError(t, err) require.Equal(t, expectedCreds, gitCredentials) } func TestNetRCParser(t *testing.T) { + t.Parallel() - netrcFile := &mocks.MockReadCloser{ - MockData: []byte( - `# top of file comment + data := `# top of file comment machine github.com login wayne password password @@ -70,9 +72,10 @@ machine google.com #comment password fun and login info! default login anonymous - password password`, - ), - } + password password` + path := filepath.Join(t.TempDir(), "file") + err := os.WriteFile(path, []byte(data), 0o644) + require.NoError(t, err) expectedCreds := []Credential{ { @@ -105,6 +108,7 @@ default }, } - netrcCredentials := netrcParser(netrcFile) + netrcCredentials, err := netrcParser(path) + require.NoError(t, err) require.Equal(t, expectedCreds, netrcCredentials) } diff --git a/src/pkg/utils/bytes.go b/src/pkg/utils/bytes.go index 4ff6c06d59..032cc65334 100644 --- a/src/pkg/utils/bytes.go +++ b/src/pkg/utils/bytes.go @@ -13,7 +13,7 @@ import ( "time" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/message" ) // RoundUp rounds a float64 to the given number of decimal places. diff --git a/src/pkg/utils/cosign.go b/src/pkg/utils/cosign.go index fc66d92ba9..ae8e553cda 100644 --- a/src/pkg/utils/cosign.go +++ b/src/pkg/utils/cosign.go @@ -12,13 +12,13 @@ import ( "strings" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/config/lang" - "github.com/defenseunicorns/zarf/src/pkg/message" "github.com/google/go-containerregistry/pkg/authn" "github.com/google/go-containerregistry/pkg/name" "github.com/google/go-containerregistry/pkg/v1/remote" "github.com/pkg/errors" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/pkg/message" "github.com/sigstore/cosign/v2/cmd/cosign/cli/fulcio" "github.com/sigstore/cosign/v2/cmd/cosign/cli/options" diff --git a/src/pkg/utils/image.go b/src/pkg/utils/image.go index a6490375dc..828fea84ad 100644 --- a/src/pkg/utils/image.go +++ b/src/pkg/utils/image.go @@ -11,10 +11,10 @@ import ( "path/filepath" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/pkg/transform" v1 "github.com/google/go-containerregistry/pkg/v1" "github.com/google/go-containerregistry/pkg/v1/layout" ocispec "github.com/opencontainers/image-spec/specs-go/v1" + "github.com/zarf-dev/zarf/src/pkg/transform" ) // LoadOCIImage returns a v1.Image with the image ref specified from a location provided, or an error if the image cannot be found. diff --git a/src/pkg/utils/io.go b/src/pkg/utils/io.go index 16c1abf377..06885d623a 100755 --- a/src/pkg/utils/io.go +++ b/src/pkg/utils/io.go @@ -10,8 +10,8 @@ import ( "path/filepath" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/pkg/message" ) const ( diff --git a/src/pkg/utils/network.go b/src/pkg/utils/network.go index 8a4a93821f..e17c086161 100644 --- a/src/pkg/utils/network.go +++ b/src/pkg/utils/network.go @@ -15,8 +15,8 @@ import ( "strings" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/config/lang" - "github.com/defenseunicorns/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/pkg/message" ) func parseChecksum(src string) (string, string, error) { diff --git a/src/pkg/utils/network_test.go b/src/pkg/utils/network_test.go index c2f059d7fe..d2357f907d 100644 --- a/src/pkg/utils/network_test.go +++ b/src/pkg/utils/network_test.go @@ -21,7 +21,7 @@ import ( func TestParseChecksum(t *testing.T) { t.Parallel() - adr := "https://raw.githubusercontent.com/defenseunicorns/zarf/main/.adr-dir" + adr := "https://raw.githubusercontent.com/zarf-dev/zarf/main/.adr-dir" sum := "930f4d5a191812e57b39bd60fca789ace07ec5acd36d63e1047604c8bdf998a3" tests := []struct { diff --git a/src/pkg/utils/wait.go b/src/pkg/utils/wait.go index 4ccc3d2481..fd2d7f1422 100644 --- a/src/pkg/utils/wait.go +++ b/src/pkg/utils/wait.go @@ -14,9 +14,9 @@ import ( "strings" "time" - "github.com/defenseunicorns/zarf/src/pkg/utils/exec" + "github.com/zarf-dev/zarf/src/pkg/utils/exec" - "github.com/defenseunicorns/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/pkg/message" ) // isJSONPathWaitType checks if the condition is a JSONPath or condition. diff --git a/src/pkg/utils/wait_test.go b/src/pkg/utils/wait_test.go index 1c66400ae1..30ca050a1e 100644 --- a/src/pkg/utils/wait_test.go +++ b/src/pkg/utils/wait_test.go @@ -7,9 +7,9 @@ package utils import ( "testing" - "github.com/defenseunicorns/zarf/src/pkg/message" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" + "github.com/zarf-dev/zarf/src/pkg/message" ) type TestIsJSONPathWaitTypeSuite struct { diff --git a/src/pkg/utils/yaml.go b/src/pkg/utils/yaml.go index bc49d46502..e61083bc51 100644 --- a/src/pkg/utils/yaml.go +++ b/src/pkg/utils/yaml.go @@ -15,13 +15,13 @@ import ( "regexp" "strings" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/pkg/message" "github.com/fatih/color" goyaml "github.com/goccy/go-yaml" "github.com/goccy/go-yaml/lexer" "github.com/goccy/go-yaml/printer" "github.com/pterm/pterm" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/pkg/message" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" kubeyaml "k8s.io/apimachinery/pkg/util/yaml" diff --git a/src/pkg/variables/types.go b/src/pkg/variables/types.go index 216f352989..b106e911fa 100644 --- a/src/pkg/variables/types.go +++ b/src/pkg/variables/types.go @@ -8,7 +8,7 @@ import ( "fmt" "regexp" - "github.com/defenseunicorns/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/config/lang" ) // VariableType represents a type of a Zarf package variable diff --git a/src/pkg/zoci/common.go b/src/pkg/zoci/common.go index 8a19d58cc7..41cf415d1b 100644 --- a/src/pkg/zoci/common.go +++ b/src/pkg/zoci/common.go @@ -8,9 +8,9 @@ import ( "log/slog" "github.com/defenseunicorns/pkg/oci" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/pkg/message" ocispec "github.com/opencontainers/image-spec/specs-go/v1" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/pkg/message" ) const ( diff --git a/src/pkg/zoci/copier.go b/src/pkg/zoci/copier.go index d6ed8dffb4..74c8636a74 100644 --- a/src/pkg/zoci/copier.go +++ b/src/pkg/zoci/copier.go @@ -10,8 +10,8 @@ import ( "fmt" "github.com/defenseunicorns/pkg/oci" - "github.com/defenseunicorns/zarf/src/pkg/message" ocispec "github.com/opencontainers/image-spec/specs-go/v1" + "github.com/zarf-dev/zarf/src/pkg/message" "oras.land/oras-go/v2/content" ) diff --git a/src/pkg/zoci/fetch.go b/src/pkg/zoci/fetch.go index 33f155059f..3a2d04bb9f 100644 --- a/src/pkg/zoci/fetch.go +++ b/src/pkg/zoci/fetch.go @@ -8,9 +8,9 @@ import ( "context" "github.com/defenseunicorns/pkg/oci" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/types" ocispec "github.com/opencontainers/image-spec/specs-go/v1" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/types" ) // FetchZarfYAML fetches the zarf.yaml file from the remote repository. diff --git a/src/pkg/zoci/pull.go b/src/pkg/zoci/pull.go index bd259259e1..c74e66588d 100644 --- a/src/pkg/zoci/pull.go +++ b/src/pkg/zoci/pull.go @@ -11,11 +11,11 @@ import ( "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/pkg/oci" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/pkg/transform" - "github.com/defenseunicorns/zarf/src/pkg/utils" - "github.com/defenseunicorns/zarf/src/types" ocispec "github.com/opencontainers/image-spec/specs-go/v1" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/pkg/transform" + "github.com/zarf-dev/zarf/src/pkg/utils" + "github.com/zarf-dev/zarf/src/types" "oras.land/oras-go/v2/content/file" ) diff --git a/src/pkg/zoci/push.go b/src/pkg/zoci/push.go index 19ee37a761..63a80b425f 100644 --- a/src/pkg/zoci/push.go +++ b/src/pkg/zoci/push.go @@ -10,10 +10,10 @@ import ( "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/pkg/oci" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/types" ocispec "github.com/opencontainers/image-spec/specs-go/v1" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/types" "oras.land/oras-go/v2" "oras.land/oras-go/v2/content/file" ) diff --git a/src/pkg/zoci/utils.go b/src/pkg/zoci/utils.go index e63910a738..e9ac1f57e3 100644 --- a/src/pkg/zoci/utils.go +++ b/src/pkg/zoci/utils.go @@ -10,7 +10,7 @@ import ( "strings" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/types" + "github.com/zarf-dev/zarf/src/types" "oras.land/oras-go/v2/registry" ) @@ -43,5 +43,5 @@ func ReferenceFromMetadata(registryLocation string, metadata *types.ZarfMetadata // GetInitPackageURL returns the URL for the init package for the given version. func GetInitPackageURL(version string) string { - return fmt.Sprintf("ghcr.io/defenseunicorns/packages/init:%s", version) + return fmt.Sprintf("ghcr.io/zarf-dev/packages/init:%s", version) } diff --git a/src/test/common.go b/src/test/common.go index 4eb9844045..0339fe0f48 100644 --- a/src/test/common.go +++ b/src/test/common.go @@ -17,8 +17,8 @@ import ( "slices" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/pkg/utils/exec" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/pkg/utils/exec" ) // ZarfE2ETest Struct holding common fields most of the tests will utilize. @@ -27,7 +27,6 @@ type ZarfE2ETest struct { Arch string ApplianceMode bool ApplianceModeKeep bool - RunClusterTests bool } var logRegex = regexp.MustCompile(`Saving log file to (?P .*?\.log)`) @@ -53,14 +52,6 @@ func GetCLIName() string { return binaryName } -// SetupWithCluster performs actions for each test that requires a K8s cluster. -func (e2e *ZarfE2ETest) SetupWithCluster(t *testing.T) { - if !e2e.RunClusterTests { - t.Skip("") - } - _ = exec.CmdWithPrint("sh", "-c", fmt.Sprintf("%s tools kubectl describe nodes | grep -A 99 Non-terminated", e2e.ZarfBinPath)) -} - // Zarf executes a Zarf command. func (e2e *ZarfE2ETest) Zarf(args ...string) (string, string, error) { if !slices.Contains(args, "--tmpdir") && !slices.Contains(args, "tools") { diff --git a/src/test/e2e/05_tarball_test.go b/src/test/e2e/05_tarball_test.go index e4ebfde06d..ab91e06e4d 100644 --- a/src/test/e2e/05_tarball_test.go +++ b/src/test/e2e/05_tarball_test.go @@ -12,10 +12,10 @@ import ( "testing" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/pkg/utils" - "github.com/defenseunicorns/zarf/src/types" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/pkg/utils" + "github.com/zarf-dev/zarf/src/types" ) func TestMultiPartPackage(t *testing.T) { diff --git a/src/test/e2e/07_create_git_test.go b/src/test/e2e/07_create_git_test.go index 115558ace9..af475a3593 100644 --- a/src/test/e2e/07_create_git_test.go +++ b/src/test/e2e/07_create_git_test.go @@ -9,8 +9,8 @@ import ( "path/filepath" "testing" - "github.com/defenseunicorns/zarf/src/pkg/utils/exec" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/pkg/utils/exec" ) func TestCreateGit(t *testing.T) { @@ -26,7 +26,7 @@ func TestCreateGit(t *testing.T) { defer e2e.CleanFiles(extractDir) // Verify the full-repo component - gitDir := fmt.Sprintf("%s/components/full-repo/repos/zarf-public-test-1143224168/.git", extractDir) + gitDir := fmt.Sprintf("%s/components/full-repo/repos/zarf-public-test-2395699829/.git", extractDir) verifyGitRepo(t, gitDir, "0a6b587", "(HEAD -> main, online-upstream/main)", "Adjust dragon spacing", "v0.0.1\n", " dragons\n* main\n") @@ -38,13 +38,13 @@ func TestCreateGit(t *testing.T) { "v0.0.1\n", " dragons\n* main\n") // Verify specific tag component shorthand tag - gitDir = fmt.Sprintf("%s/components/specific-tag/repos/zarf-public-test-443792367/.git", extractDir) + gitDir = fmt.Sprintf("%s/components/specific-tag/repos/zarf-public-test-470731282/.git", extractDir) verifyGitRepo(t, gitDir, "5249809", "(HEAD -> zarf-ref-v0.0.1, tag: v0.0.1)", "Added README.md", "v0.0.1\n", "* zarf-ref-v0.0.1\n") // Verify specific tag component refspec tag - gitDir = fmt.Sprintf("%s/components/specific-tag/repos/zarf-public-test-1981411475/.git", extractDir) + gitDir = fmt.Sprintf("%s/components/specific-tag/repos/zarf-public-test-482869567/.git", extractDir) verifyGitRepo(t, gitDir, "5249809", "(HEAD -> zarf-ref-v0.0.1, tag: v0.0.1)", "Added README.md", "v0.0.1\n", "* zarf-ref-v0.0.1\n") @@ -56,7 +56,7 @@ func TestCreateGit(t *testing.T) { "v0.0.1\n", "* zarf-ref-v0.0.1\n") // Verify specific branch component - gitDir = fmt.Sprintf("%s/components/specific-branch/repos/zarf-public-test-1670574289/.git", extractDir) + gitDir = fmt.Sprintf("%s/components/specific-branch/repos/zarf-public-test-2265377406/.git", extractDir) verifyGitRepo(t, gitDir, "01a2321", "(HEAD -> dragons, online-upstream/dragons)", "Explain what this repo does", "", "* dragons\n") @@ -68,7 +68,7 @@ func TestCreateGit(t *testing.T) { "", "* dragons\n") // Verify specific hash component - gitDir = fmt.Sprintf("%s/components/specific-hash/repos/zarf-public-test-2357350897/.git", extractDir) + gitDir = fmt.Sprintf("%s/components/specific-hash/repos/zarf-public-test-3231174532/.git", extractDir) verifyGitRepo(t, gitDir, "01a2321", "(HEAD -> zarf-ref-01a23218923f24194133b5eb11268cf8d73ff1bb, online-upstream/dragons)", "Explain what this repo does", "v0.0.1\n", " main\n* zarf-ref-01a23218923f24194133b5eb11268cf8d73ff1bb\n") diff --git a/src/test/e2e/08_create_differential_test.go b/src/test/e2e/08_create_differential_test.go index 042ed2e185..d692d1b9cc 100644 --- a/src/test/e2e/08_create_differential_test.go +++ b/src/test/e2e/08_create_differential_test.go @@ -9,12 +9,12 @@ import ( "path/filepath" "testing" - "github.com/defenseunicorns/zarf/src/config/lang" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/pkg/utils" - "github.com/defenseunicorns/zarf/src/types" "github.com/mholt/archiver/v3" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/pkg/utils" + "github.com/zarf-dev/zarf/src/types" ) // TestCreateDifferential creates several differential packages and ensures the reference package images and repos are not included in the new package. @@ -63,7 +63,7 @@ func TestCreateDifferential(t *testing.T) { expectedGitRepos := []string{ "https://github.com/stefanprodan/podinfo.git", "https://github.com/kelseyhightower/nocode.git", - "https://github.com/defenseunicorns/zarf.git@refs/tags/v0.26.0", + "https://github.com/zarf-dev/zarf.git@refs/tags/v0.26.0", } require.Len(t, actualGitRepos, 4, "zarf.yaml from the differential package does not contain the correct number of repos") for _, expectedRepo := range expectedGitRepos { @@ -73,7 +73,7 @@ func TestCreateDifferential(t *testing.T) { /* Validate we have ONLY the images we expect to have */ expectedImages := []string{ "ghcr.io/stefanprodan/podinfo:latest", - "ghcr.io/defenseunicorns/zarf/agent:v0.26.0", + "ghcr.io/zarf-dev/zarf/agent:v0.26.0", } require.Len(t, actualImages, 2, "zarf.yaml from the differential package does not contain the correct number of images") for _, expectedImage := range expectedImages { diff --git a/src/test/e2e/09_component_compose_test.go b/src/test/e2e/09_component_compose_test.go index c5edaeb682..176b96207e 100644 --- a/src/test/e2e/09_component_compose_test.go +++ b/src/test/e2e/09_component_compose_test.go @@ -139,8 +139,8 @@ func (suite *CompositionSuite) Test_1_FullComposability() { - ghcr.io/stefanprodan/podinfo:6.4.0 - ghcr.io/stefanprodan/podinfo:6.4.1 repos: - - https://github.com/defenseunicorns/zarf-public-test.git - - https://github.com/defenseunicorns/zarf-public-test.git@refs/heads/dragons + - https://github.com/zarf-dev/zarf-public-test.git + - https://github.com/zarf-dev/zarf-public-test.git@refs/heads/dragons `) // Check dataInjections diff --git a/src/test/e2e/11_oci_pull_inspect_test.go b/src/test/e2e/11_oci_pull_inspect_test.go index 47d31232fb..98e5e4ff52 100644 --- a/src/test/e2e/11_oci_pull_inspect_test.go +++ b/src/test/e2e/11_oci_pull_inspect_test.go @@ -42,7 +42,7 @@ func (suite *PullInspectTestSuite) Test_0_Pull() { out := fmt.Sprintf("zarf-package-dos-games-%s-1.0.0.tar.zst", e2e.Arch) // Build the fully qualified reference. - ref := fmt.Sprintf("oci://ghcr.io/defenseunicorns/packages/dos-games:1.0.0-%s", e2e.Arch) + ref := fmt.Sprintf("oci://ghcr.io/zarf-dev/packages/dos-games:1.0.0-%s", e2e.Arch) // Pull the package via OCI. stdOut, stdErr, err := e2e.Zarf("package", "pull", ref) @@ -74,7 +74,7 @@ func (suite *PullInspectTestSuite) Test_1_Remote_Inspect() { // Test inspect on a public package. // NOTE: This also makes sure that Zarf does not attempt auth when inspecting a public package. - ref := fmt.Sprintf("oci://ghcr.io/defenseunicorns/packages/dos-games:1.0.0-%s", e2e.Arch) + ref := fmt.Sprintf("oci://ghcr.io/zarf-dev/packages/dos-games:1.0.0-%s", e2e.Arch) _, stdErr, err = e2e.Zarf("package", "inspect", ref) suite.NoError(err, stdErr) } diff --git a/src/test/e2e/12_lint_test.go b/src/test/e2e/12_lint_test.go index dc31217601..a577bb397f 100644 --- a/src/test/e2e/12_lint_test.go +++ b/src/test/e2e/12_lint_test.go @@ -9,8 +9,8 @@ import ( "path/filepath" "testing" - "github.com/defenseunicorns/zarf/src/config/lang" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/config/lang" ) func TestLint(t *testing.T) { diff --git a/src/test/e2e/13_find_images_test.go b/src/test/e2e/13_find_images_test.go index fbb0185320..27e7bbe715 100644 --- a/src/test/e2e/13_find_images_test.go +++ b/src/test/e2e/13_find_images_test.go @@ -53,7 +53,7 @@ func TestFindImages(t *testing.T) { stdOut, _, err := e2e.Zarf("prepare", "find-images", ".", "--registry-url", registry, "--create-set", fmt.Sprintf("agent_image_tag=%s", agentTag)) require.NoError(t, err) - internalRegistryImage := fmt.Sprintf("%s/%s:%s", registry, "defenseunicorns/zarf/agent", agentTag) + internalRegistryImage := fmt.Sprintf("%s/%s:%s", registry, "zarf-dev/zarf/agent", agentTag) require.Contains(t, stdOut, internalRegistryImage, "registry image should be found with registry url") require.Contains(t, stdOut, "busybox:latest", "Busybox image should be found as long as helm chart doesn't error") diff --git a/src/test/e2e/13_zarf_package_generate_test.go b/src/test/e2e/13_zarf_package_generate_test.go index ad613ba96a..305141739c 100644 --- a/src/test/e2e/13_zarf_package_generate_test.go +++ b/src/test/e2e/13_zarf_package_generate_test.go @@ -8,10 +8,10 @@ import ( "path/filepath" "testing" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/pkg/utils" - "github.com/defenseunicorns/zarf/src/types" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/pkg/utils" + "github.com/zarf-dev/zarf/src/types" ) func TestZarfDevGenerate(t *testing.T) { diff --git a/src/test/e2e/14_create_sha_index_test.go b/src/test/e2e/14_create_sha_index_test.go index 9dee622c85..59993c5874 100644 --- a/src/test/e2e/14_create_sha_index_test.go +++ b/src/test/e2e/14_create_sha_index_test.go @@ -21,7 +21,7 @@ func TestCreateIndexShaErrors(t *testing.T) { { name: "Image Index", packagePath: "src/test/packages/14-index-sha/image-index", - expectedImageInStderr: "ghcr.io/defenseunicorns/zarf/agent:v0.32.6@sha256:b3fabdc7d4ecd0f396016ef78da19002c39e3ace352ea0ae4baa2ce9d5958376", + expectedImageInStderr: "ghcr.io/zarf-dev/zarf/agent:v0.32.6@sha256:b3fabdc7d4ecd0f396016ef78da19002c39e3ace352ea0ae4baa2ce9d5958376", }, { name: "Manifest List", diff --git a/src/test/e2e/20_zarf_init_test.go b/src/test/e2e/20_zarf_init_test.go index 92fe26bc98..572cedea0f 100644 --- a/src/test/e2e/20_zarf_init_test.go +++ b/src/test/e2e/20_zarf_init_test.go @@ -12,13 +12,12 @@ import ( "encoding/json" - "github.com/defenseunicorns/zarf/src/types" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/types" ) func TestZarfInit(t *testing.T) { t.Log("E2E: Zarf init") - e2e.SetupWithCluster(t) initComponents := "git-server" if e2e.ApplianceMode { diff --git a/src/test/e2e/21_connect_creds_test.go b/src/test/e2e/21_connect_creds_test.go index 5c68277ff7..b96d6c579b 100644 --- a/src/test/e2e/21_connect_creds_test.go +++ b/src/test/e2e/21_connect_creds_test.go @@ -13,8 +13,8 @@ import ( "strings" "testing" - "github.com/defenseunicorns/zarf/src/pkg/cluster" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/pkg/cluster" ) type RegistryResponse struct { @@ -23,7 +23,6 @@ type RegistryResponse struct { func TestConnectAndCreds(t *testing.T) { t.Log("E2E: Connect") - e2e.SetupWithCluster(t) prevAgentSecretData, _, err := e2e.Kubectl("get", "secret", "agent-hook-tls", "-n", "zarf", "-o", "jsonpath={.data}") require.NoError(t, err) @@ -44,7 +43,6 @@ func TestConnectAndCreds(t *testing.T) { func TestMetrics(t *testing.T) { t.Log("E2E: Emits metrics") - e2e.SetupWithCluster(t) c, err := cluster.NewCluster() require.NoError(t, err) @@ -90,7 +88,7 @@ func connectToZarfServices(ctx context.Context, t *testing.T) { // We assert greater than or equal to since the base init has 8 images // HOWEVER during an upgrade we could have mismatched versions/names resulting in more images require.GreaterOrEqual(t, len(registryList), 3) - require.Contains(t, stdOut, "defenseunicorns/zarf/agent") + require.Contains(t, stdOut, "zarf-dev/zarf/agent") require.Contains(t, stdOut, "gitea/gitea") require.Contains(t, stdOut, "library/registry") diff --git a/src/test/e2e/22_git_and_gitops_test.go b/src/test/e2e/22_git_and_gitops_test.go index 8b53bacfaf..559bb79e3f 100644 --- a/src/test/e2e/22_git_and_gitops_test.go +++ b/src/test/e2e/22_git_and_gitops_test.go @@ -13,15 +13,14 @@ import ( "path/filepath" "testing" - "github.com/defenseunicorns/zarf/src/internal/packager/git" - "github.com/defenseunicorns/zarf/src/pkg/cluster" - "github.com/defenseunicorns/zarf/src/types" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/internal/packager/git" + "github.com/zarf-dev/zarf/src/pkg/cluster" + "github.com/zarf-dev/zarf/src/types" ) func TestGit(t *testing.T) { t.Log("E2E: Git") - e2e.SetupWithCluster(t) buildPath := filepath.Join("src", "test", "packages", "22-git-data") stdOut, stdErr, err := e2e.Zarf("package", "create", buildPath, "-o=build", "--confirm") @@ -48,14 +47,12 @@ func TestGit(t *testing.T) { func TestGitOpsFlux(t *testing.T) { t.Log("E2E: GitOps / Flux") - e2e.SetupWithCluster(t) waitFluxPodInfoDeployment(t) } func TestGitOpsArgoCD(t *testing.T) { t.Log("E2E: ArgoCD / Flux") - e2e.SetupWithCluster(t) waitArgoDeployment(t) } @@ -80,7 +77,7 @@ func testGitServerReadOnly(ctx context.Context, t *testing.T, gitURL string) { gitCfg := git.New(zarfState.GitServer) // Get the repo as the readonly user - repoName := "zarf-public-test-2469062884" + repoName := "zarf-public-test-2363058019" getRepoRequest, _ := http.NewRequest("GET", fmt.Sprintf("%s/api/v1/repos/%s/%s", gitURL, zarfState.GitServer.PushUsername, repoName), nil) getRepoResponseBody, _, err := gitCfg.DoHTTPThings(getRepoRequest, types.ZarfGitReadUser, zarfState.GitServer.PullPassword) require.NoError(t, err) @@ -104,7 +101,7 @@ func testGitServerTagAndHash(ctx context.Context, t *testing.T, gitURL string) { // Init the state variable zarfState, err := c.LoadZarfState(ctx) require.NoError(t, err, "Failed to load Zarf state") - repoName := "zarf-public-test-2469062884" + repoName := "zarf-public-test-2363058019" gitCfg := git.New(zarfState.GitServer) diff --git a/src/test/e2e/23_data_injection_test.go b/src/test/e2e/23_data_injection_test.go index efbce9bc13..08f913fc41 100644 --- a/src/test/e2e/23_data_injection_test.go +++ b/src/test/e2e/23_data_injection_test.go @@ -12,14 +12,13 @@ import ( "testing" "time" - "github.com/defenseunicorns/zarf/src/pkg/cluster" - "github.com/defenseunicorns/zarf/src/pkg/utils/exec" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/pkg/cluster" + "github.com/zarf-dev/zarf/src/pkg/utils/exec" ) func TestDataInjection(t *testing.T) { t.Log("E2E: Data injection") - e2e.SetupWithCluster(t) ctx := context.Background() diff --git a/src/test/e2e/24_variables_test.go b/src/test/e2e/24_variables_test.go index c0f546ad83..765c8902bf 100644 --- a/src/test/e2e/24_variables_test.go +++ b/src/test/e2e/24_variables_test.go @@ -15,7 +15,6 @@ import ( func TestVariables(t *testing.T) { t.Log("E2E: Package variables") - e2e.SetupWithCluster(t) evilSrc := filepath.Join("src", "test", "packages", "24-evil-variables") evilPath := fmt.Sprintf("zarf-package-evil-variables-%s.tar.zst", e2e.Arch) diff --git a/src/test/e2e/25_helm_test.go b/src/test/e2e/25_helm_test.go index 7c643288c0..071732da10 100644 --- a/src/test/e2e/25_helm_test.go +++ b/src/test/e2e/25_helm_test.go @@ -17,7 +17,6 @@ var helmChartsPkg string func TestHelm(t *testing.T) { t.Log("E2E: Helm chart") - e2e.SetupWithCluster(t) helmChartsPkg = filepath.Join("build", fmt.Sprintf("zarf-package-helm-charts-%s-0.0.1.tar.zst", e2e.Arch)) @@ -133,7 +132,7 @@ func testHelmUninstallRollback(t *testing.T) { // Ensure this leaves behind a dos-games chart. // We do not want to uninstall charts that had failed installs/upgrades // to prevent unintentional deletion and/or data loss in production environments. - // https://github.com/defenseunicorns/zarf/issues/2455 + // https://github.com/zarf-dev/zarf/issues/2455 helmOut, err := exec.Command("helm", "list", "-n", "dos-games").Output() require.NoError(t, err) require.Contains(t, string(helmOut), "zarf-f53a99d4a4dd9a3575bedf59cd42d48d751ae866") diff --git a/src/test/e2e/26_simple_packages_test.go b/src/test/e2e/26_simple_packages_test.go index 347aad89fd..05a95d97d2 100644 --- a/src/test/e2e/26_simple_packages_test.go +++ b/src/test/e2e/26_simple_packages_test.go @@ -11,13 +11,12 @@ import ( "path/filepath" "testing" - "github.com/defenseunicorns/zarf/src/pkg/cluster" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/pkg/cluster" ) func TestDosGames(t *testing.T) { t.Log("E2E: Dos games") - e2e.SetupWithCluster(t) path := filepath.Join("build", fmt.Sprintf("zarf-package-dos-games-%s-1.0.0.tar.zst", e2e.Arch)) @@ -53,7 +52,6 @@ func TestDosGames(t *testing.T) { func TestManifests(t *testing.T) { t.Log("E2E: Local, Remote, and Kustomize Manifests") - e2e.SetupWithCluster(t) path := filepath.Join("build", fmt.Sprintf("zarf-package-manifests-%s-0.0.1.tar.zst", e2e.Arch)) @@ -68,7 +66,6 @@ func TestManifests(t *testing.T) { func TestAgentIgnore(t *testing.T) { t.Log("E2E: Test Manifests that are Agent Ignored") - e2e.SetupWithCluster(t) testCreate := filepath.Join("src", "test", "packages", "26-agent-ignore") testDeploy := filepath.Join("build", fmt.Sprintf("zarf-package-agent-ignore-namespace-%s.tar.zst", e2e.Arch)) diff --git a/src/test/e2e/27_deploy_regression_test.go b/src/test/e2e/27_deploy_regression_test.go index 0f70365a63..49808addff 100644 --- a/src/test/e2e/27_deploy_regression_test.go +++ b/src/test/e2e/27_deploy_regression_test.go @@ -9,13 +9,12 @@ import ( "fmt" "testing" - "github.com/defenseunicorns/zarf/src/pkg/utils/exec" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/pkg/utils/exec" ) func TestGHCRDeploy(t *testing.T) { t.Log("E2E: GHCR OCI deploy") - e2e.SetupWithCluster(t) var sha string // shas for package published 2023-08-08T22:13:51Z @@ -36,7 +35,6 @@ func TestGHCRDeploy(t *testing.T) { func TestCosignDeploy(t *testing.T) { t.Log("E2E: Cosign deploy") - e2e.SetupWithCluster(t) // Test with command from https://docs.zarf.dev/getting-started/install/ command := fmt.Sprintf("%s package deploy sget://defenseunicorns/zarf-hello-world:$(uname -m) --confirm", e2e.ZarfBinPath) diff --git a/src/test/e2e/28_wait_test.go b/src/test/e2e/28_wait_test.go index 16d2ddff4f..e1b22b4f28 100644 --- a/src/test/e2e/28_wait_test.go +++ b/src/test/e2e/28_wait_test.go @@ -10,8 +10,8 @@ import ( "testing" - "github.com/defenseunicorns/zarf/src/test" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/test" ) type zarfCommandResult struct { @@ -27,7 +27,6 @@ func zarfCommandWStruct(e2e test.ZarfE2ETest, path string) (result zarfCommandRe func TestNoWait(t *testing.T) { t.Log("E2E: Helm Wait") - e2e.SetupWithCluster(t) stdOut, stdErr, err := e2e.Zarf("package", "create", "src/test/packages/28-helm-no-wait", "-o=build", "--confirm") require.NoError(t, err, stdOut, stdErr) diff --git a/src/test/e2e/29_config_file_test.go b/src/test/e2e/29_config_file_test.go index 5095efa91f..40c66b4204 100644 --- a/src/test/e2e/29_config_file_test.go +++ b/src/test/e2e/29_config_file_test.go @@ -15,7 +15,6 @@ import ( func TestConfigFile(t *testing.T) { t.Log("E2E: Config file") - e2e.SetupWithCluster(t) var ( path = fmt.Sprintf("zarf-package-config-file-%s.tar.zst", e2e.Arch) diff --git a/src/test/e2e/30_component_action_cluster_test.go b/src/test/e2e/30_component_action_cluster_test.go index 47efd3a6a4..5d6658152f 100644 --- a/src/test/e2e/30_component_action_cluster_test.go +++ b/src/test/e2e/30_component_action_cluster_test.go @@ -14,7 +14,6 @@ import ( func TestComponentActionRemove(t *testing.T) { t.Log("E2E: Component action remove") - e2e.SetupWithCluster(t) packagePath := filepath.Join("build", fmt.Sprintf("zarf-package-component-actions-%s.tar.zst", e2e.Arch)) @@ -31,7 +30,6 @@ func TestComponentActionRemove(t *testing.T) { func TestComponentActionEdgeCases(t *testing.T) { t.Log("E2E: Component action edge cases") - e2e.SetupWithCluster(t) sourcePath := filepath.Join("src", "test", "packages", "31-component-actions-edgecases") packagePath := fmt.Sprintf("zarf-package-component-actions-edgecases-%s.tar.zst", e2e.Arch) diff --git a/src/test/e2e/31_checksum_and_signature_test.go b/src/test/e2e/31_checksum_and_signature_test.go index 957deaeaa8..2b3856779f 100644 --- a/src/test/e2e/31_checksum_and_signature_test.go +++ b/src/test/e2e/31_checksum_and_signature_test.go @@ -13,7 +13,6 @@ import ( func TestChecksumAndSignature(t *testing.T) { t.Log("E2E: Checksum and Signature") - e2e.SetupWithCluster(t) testPackageDirPath := "examples/dos-games" pkgName := fmt.Sprintf("zarf-package-dos-games-%s-1.0.0.tar.zst", e2e.Arch) diff --git a/src/test/e2e/32_component_webhooks_test.go b/src/test/e2e/32_component_webhooks_test.go index cbb8321b08..d409e62521 100644 --- a/src/test/e2e/32_component_webhooks_test.go +++ b/src/test/e2e/32_component_webhooks_test.go @@ -13,7 +13,6 @@ import ( func TestComponentWebhooks(t *testing.T) { t.Log("E2E: Component Webhooks") - e2e.SetupWithCluster(t) // Deploy example Pepr webhook. webhookPath := fmt.Sprintf("build/zarf-package-component-webhooks-%s-0.0.1.tar.zst", e2e.Arch) diff --git a/src/test/e2e/34_custom_init_package_test.go b/src/test/e2e/34_custom_init_package_test.go index aae69e30e9..6229255aca 100644 --- a/src/test/e2e/34_custom_init_package_test.go +++ b/src/test/e2e/34_custom_init_package_test.go @@ -14,7 +14,7 @@ import ( func TestCustomInit(t *testing.T) { t.Log("E2E: Custom Init Package") - e2e.SetupWithCluster(t) + buildPath := filepath.Join("src", "test", "packages", "35-custom-init-package") pkgName := fmt.Sprintf("zarf-init-%s-%s.tar.zst", e2e.Arch, e2e.GetZarfVersion(t)) privateKeyFlag := "--signing-key=src/test/packages/zarf-test.prv-key" diff --git a/src/test/e2e/35_custom_retries_test.go b/src/test/e2e/35_custom_retries_test.go index cbe5428a25..92d7e2fffe 100644 --- a/src/test/e2e/35_custom_retries_test.go +++ b/src/test/e2e/35_custom_retries_test.go @@ -15,7 +15,6 @@ import ( func TestRetries(t *testing.T) { t.Log("E2E: Custom Retries") - e2e.SetupWithCluster(t) tmpDir := t.TempDir() diff --git a/src/test/e2e/50_oci_publish_deploy_test.go b/src/test/e2e/50_oci_publish_deploy_test.go index 96f0d6c7f1..81e5e39f54 100644 --- a/src/test/e2e/50_oci_publish_deploy_test.go +++ b/src/test/e2e/50_oci_publish_deploy_test.go @@ -13,9 +13,9 @@ import ( "time" "github.com/defenseunicorns/pkg/oci" - "github.com/defenseunicorns/zarf/src/pkg/zoci" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" + "github.com/zarf-dev/zarf/src/pkg/zoci" "oras.land/oras-go/v2/registry" "oras.land/oras-go/v2/registry/remote" ) @@ -164,7 +164,6 @@ func (suite *PublishDeploySuiteTestSuite) Test_3_Copy() { } func TestPublishDeploySuite(t *testing.T) { - e2e.SetupWithCluster(t) suite.Run(t, new(PublishDeploySuiteTestSuite)) } diff --git a/src/test/e2e/51_oci_compose_test.go b/src/test/e2e/51_oci_compose_test.go index c59d7477c1..b38db002a6 100644 --- a/src/test/e2e/51_oci_compose_test.go +++ b/src/test/e2e/51_oci_compose_test.go @@ -13,12 +13,12 @@ import ( "testing" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/pkg/layout" - "github.com/defenseunicorns/zarf/src/pkg/transform" - "github.com/defenseunicorns/zarf/src/pkg/utils" - "github.com/defenseunicorns/zarf/src/types" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" + "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/pkg/transform" + "github.com/zarf-dev/zarf/src/pkg/utils" + "github.com/zarf-dev/zarf/src/types" corev1 "k8s.io/api/core/v1" "oras.land/oras-go/v2/registry" ) @@ -284,7 +284,6 @@ func (suite *SkeletonSuite) verifyComponentPaths(unpackedPath string, components } func TestSkeletonSuite(t *testing.T) { - e2e.SetupWithCluster(t) suite.Run(t, new(SkeletonSuite)) } diff --git a/src/test/e2e/99_appliance_remove_test.go b/src/test/e2e/99_appliance_remove_test.go index 1e34af99e0..321f353228 100644 --- a/src/test/e2e/99_appliance_remove_test.go +++ b/src/test/e2e/99_appliance_remove_test.go @@ -19,8 +19,6 @@ func TestApplianceRemove(t *testing.T) { return } - e2e.SetupWithCluster(t) - initPackageVersion := e2e.GetZarfVersion(t) path := fmt.Sprintf("build/zarf-init-%s-%s.tar.zst", e2e.Arch, initPackageVersion) diff --git a/src/test/e2e/99_yolo_test.go b/src/test/e2e/99_yolo_test.go index bce9ab1450..93a9b9ed60 100644 --- a/src/test/e2e/99_yolo_test.go +++ b/src/test/e2e/99_yolo_test.go @@ -10,8 +10,8 @@ import ( "net/http" "testing" - "github.com/defenseunicorns/zarf/src/pkg/cluster" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/pkg/cluster" ) func TestYOLOMode(t *testing.T) { @@ -22,8 +22,6 @@ func TestYOLOMode(t *testing.T) { return } - e2e.SetupWithCluster(t) - // Destroy the cluster to test Zarf cleaning up after itself stdOut, stdErr, err := e2e.Zarf("destroy", "--confirm", "--remove-components") require.NoError(t, err, stdOut, stdErr) @@ -54,7 +52,6 @@ func TestDevDeploy(t *testing.T) { if e2e.ApplianceMode { return } - e2e.SetupWithCluster(t) stdOut, stdErr, err := e2e.Zarf("dev", "deploy", "examples/dos-games") require.NoError(t, err, stdOut, stdErr) diff --git a/src/test/e2e/main_test.go b/src/test/e2e/main_test.go index 9670335641..9fe02d40df 100644 --- a/src/test/e2e/main_test.go +++ b/src/test/e2e/main_test.go @@ -10,9 +10,9 @@ import ( "path/filepath" "testing" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/pkg/message" - "github.com/defenseunicorns/zarf/src/test" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/zarf-dev/zarf/src/test" ) var ( @@ -38,7 +38,6 @@ func TestMain(m *testing.M) { e2e.ZarfBinPath = filepath.Join("build", test.GetCLIName()) e2e.ApplianceMode = os.Getenv(applianceModeEnvVar) == "true" e2e.ApplianceModeKeep = os.Getenv(applianceModeKeepEnvVar) == "true" - e2e.RunClusterTests = true message.SetLogLevel(message.TraceLevel) diff --git a/src/test/external/common.go b/src/test/external/common.go index 2e9cd8bb68..36e8405a25 100644 --- a/src/test/external/common.go +++ b/src/test/external/common.go @@ -12,10 +12,10 @@ import ( "testing" "time" - "github.com/defenseunicorns/zarf/src/pkg/utils/exec" - "github.com/defenseunicorns/zarf/src/test" "github.com/otiai10/copy" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/pkg/utils/exec" + "github.com/zarf-dev/zarf/src/test" ) var zarfBinPath = path.Join("../../../build", test.GetCLIName()) diff --git a/src/test/external/ext_in_cluster_test.go b/src/test/external/ext_in_cluster_test.go index 655cb7c59a..97a52fda0a 100644 --- a/src/test/external/ext_in_cluster_test.go +++ b/src/test/external/ext_in_cluster_test.go @@ -15,10 +15,10 @@ import ( "time" pkgkubernetes "github.com/defenseunicorns/pkg/kubernetes" - "github.com/defenseunicorns/zarf/src/pkg/cluster" - "github.com/defenseunicorns/zarf/src/pkg/utils/exec" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" + "github.com/zarf-dev/zarf/src/pkg/cluster" + "github.com/zarf-dev/zarf/src/pkg/utils/exec" "k8s.io/apimachinery/pkg/runtime/schema" "sigs.k8s.io/cli-utils/pkg/object" ) diff --git a/src/test/external/ext_out_cluster_test.go b/src/test/external/ext_out_cluster_test.go index b32960c318..dfcc9da580 100644 --- a/src/test/external/ext_out_cluster_test.go +++ b/src/test/external/ext_out_cluster_test.go @@ -16,10 +16,10 @@ import ( "testing" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/pkg/utils" - "github.com/defenseunicorns/zarf/src/pkg/utils/exec" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" + "github.com/zarf-dev/zarf/src/pkg/utils" + "github.com/zarf-dev/zarf/src/pkg/utils/exec" "helm.sh/helm/v3/pkg/repo" ) diff --git a/src/test/mocks/read_closer_mock.go b/src/test/mocks/read_closer_mock.go deleted file mode 100644 index 494215f41e..0000000000 --- a/src/test/mocks/read_closer_mock.go +++ /dev/null @@ -1,24 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2021-Present The Zarf Authors - -// Package mocks contains all the mocks used in Zarf tests. -package mocks - -// MockReadCloser is a mock for the go ReadCloser object. -type ( - MockReadCloser struct { - MockData []byte - MockReadErr error - MockCloseErr error - } -) - -// Read copies a tests expected data and returns an expectedError. -func (mrc *MockReadCloser) Read(buf []byte) (n int, err error) { - numBytes := copy(buf, mrc.MockData) - mrc.MockData = mrc.MockData[numBytes:len(mrc.MockData)] - return numBytes, mrc.MockReadErr -} - -// Close simply returns the expected close err from a test. -func (mrc *MockReadCloser) Close() error { return mrc.MockCloseErr } diff --git a/src/test/nightly/ecr_publish_test.go b/src/test/nightly/ecr_publish_test.go index a1d07e73e1..2d872c16e1 100644 --- a/src/test/nightly/ecr_publish_test.go +++ b/src/test/nightly/ecr_publish_test.go @@ -11,9 +11,9 @@ import ( "path/filepath" "testing" - "github.com/defenseunicorns/zarf/src/config" - "github.com/defenseunicorns/zarf/src/test" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/config" + "github.com/zarf-dev/zarf/src/test" ) var ( @@ -39,16 +39,14 @@ func TestECRPublishing(t *testing.T) { // Set up the e2e configs e2e.Arch = config.GetArch() e2e.ZarfBinPath = path.Join("build", test.GetCLIName()) - e2e.ApplianceMode = true - e2e.RunClusterTests = false // Set up variables for common names/locations testPackageName := "helm-charts" testPackageVersion := "0.0.1" testPackageFileName := fmt.Sprintf("zarf-package-%s-%s-%s.tar.zst", testPackageName, e2e.Arch, testPackageVersion) testPackageLocation := filepath.Join(tmpDir, testPackageFileName) - registryURL := "oci://public.ecr.aws/t8y5r5z5/zarf-nightly" - upstreamPackageURL := fmt.Sprintf("%s/%s:%s-%s", registryURL, testPackageName, testPackageVersion, e2e.Arch) + registryURL := "oci://public.ecr.aws/z6q5p6f7/zarf-nightly" + upstreamPackageURL := fmt.Sprintf("%s/%s:%s", registryURL, testPackageName, testPackageVersion) keyFlag := fmt.Sprintf("--key=%s", "./src/test/packages/zarf-test.pub") // Build the package with our test signature diff --git a/src/test/packages/00-remote-pull-fail/zarf.yaml b/src/test/packages/00-remote-pull-fail/zarf.yaml index f44d99d4b1..b2212b15d6 100644 --- a/src/test/packages/00-remote-pull-fail/zarf.yaml +++ b/src/test/packages/00-remote-pull-fail/zarf.yaml @@ -5,4 +5,4 @@ components: - name: doesnotexist-docker required: true images: - - ghcr.io/defenseunicorns/doesnotexist:1.3.3.7 + - ghcr.io/zarf-dev/doesnotexist:1.3.3.7 diff --git a/src/test/packages/08-differential-package/zarf.yaml b/src/test/packages/08-differential-package/zarf.yaml index 9d911a66d0..5f5fae02c0 100644 --- a/src/test/packages/08-differential-package/zarf.yaml +++ b/src/test/packages/08-differential-package/zarf.yaml @@ -9,10 +9,10 @@ components: required: true images: - ghcr.io/stefanprodan/podinfo:6.0.0 - - ghcr.io/defenseunicorns/zarf/agent:###ZARF_PKG_TMPL_PACKAGE_VERSION### + - ghcr.io/zarf-dev/zarf/agent:###ZARF_PKG_TMPL_PACKAGE_VERSION### repos: - - https://github.com/defenseunicorns/zarf.git@c74e2e9626da0400e0a41e78319b3054c53a5d4e - - https://github.com/defenseunicorns/zarf.git@refs/tags/###ZARF_PKG_TMPL_PACKAGE_VERSION### + - https://github.com/zarf-dev/zarf.git@c74e2e9626da0400e0a41e78319b3054c53a5d4e + - https://github.com/zarf-dev/zarf.git@refs/tags/###ZARF_PKG_TMPL_PACKAGE_VERSION### - name: generalized-assets required: true @@ -22,4 +22,4 @@ components: # Do a full Git Repo Mirror - https://github.com/stefanprodan/podinfo.git - https://github.com/kelseyhightower/nocode.git - - https://github.com/defenseunicorns/zarf.git@refs/heads/main + - https://github.com/zarf-dev/zarf.git@refs/heads/main diff --git a/src/test/packages/09-composable-packages/sub-package/zarf.yaml b/src/test/packages/09-composable-packages/sub-package/zarf.yaml index 20b0a5b323..a749d669fb 100644 --- a/src/test/packages/09-composable-packages/sub-package/zarf.yaml +++ b/src/test/packages/09-composable-packages/sub-package/zarf.yaml @@ -26,7 +26,7 @@ components: images: - ghcr.io/stefanprodan/podinfo:6.4.0 repos: - - https://github.com/defenseunicorns/zarf-public-test.git + - https://github.com/zarf-dev/zarf-public-test.git files: - source: ../files/coffee-ipsum.txt target: coffee-ipsum.txt diff --git a/src/test/packages/09-composable-packages/zarf.yaml b/src/test/packages/09-composable-packages/zarf.yaml index cf121120e6..6ec2dd49b8 100644 --- a/src/test/packages/09-composable-packages/zarf.yaml +++ b/src/test/packages/09-composable-packages/zarf.yaml @@ -40,7 +40,7 @@ components: images: - ghcr.io/stefanprodan/podinfo:6.4.1 repos: - - https://github.com/defenseunicorns/zarf-public-test.git@refs/heads/dragons + - https://github.com/zarf-dev/zarf-public-test.git@refs/heads/dragons files: - source: files/coffee-ipsum.txt target: coffee-ipsum.txt diff --git a/src/test/packages/12-lint/zarf.yaml b/src/test/packages/12-lint/zarf.yaml index 84f5b53c72..a77e3f89c9 100644 --- a/src/test/packages/12-lint/zarf.yaml +++ b/src/test/packages/12-lint/zarf.yaml @@ -14,7 +14,7 @@ components: - name: full-repo repos: - - https://github.com/defenseunicorns/zarf-public-test.git + - https://github.com/zarf-dev/zarf-public-test.git - https://dev.azure.com/defenseunicorns/zarf-public-test/_git/zarf-public-test@v0.0.1 - https://gitlab.com/gitlab-org/build/omnibus-mirror/pcre2/-/tree/vreverse?ref_type=heads images: diff --git a/src/test/packages/14-index-sha/image-index/zarf.yaml b/src/test/packages/14-index-sha/image-index/zarf.yaml index a29c4380b9..76d3e6ab4f 100644 --- a/src/test/packages/14-index-sha/image-index/zarf.yaml +++ b/src/test/packages/14-index-sha/image-index/zarf.yaml @@ -6,4 +6,4 @@ components: - name: baseline required: true images: - - ghcr.io/defenseunicorns/zarf/agent:v0.32.6@sha256:05a82656df5466ce17c3e364c16792ae21ce68438bfe06eeab309d0520c16b48 + - ghcr.io/zarf-dev/zarf/agent:v0.32.6@sha256:05a82656df5466ce17c3e364c16792ae21ce68438bfe06eeab309d0520c16b48 diff --git a/src/test/packages/22-git-data/zarf.yaml b/src/test/packages/22-git-data/zarf.yaml index 2e3b56d75c..8051918672 100644 --- a/src/test/packages/22-git-data/zarf.yaml +++ b/src/test/packages/22-git-data/zarf.yaml @@ -9,19 +9,17 @@ components: required: true repos: # Do a full Git Repo Mirror - - https://github.com/defenseunicorns/zarf-public-test.git + - https://github.com/zarf-dev/zarf-public-test.git # The following performs a full Git Repo Mirror forcing a fallback to host `git` - https://dev.azure.com/defenseunicorns/zarf-public-test/_git/zarf-public-test - # Perform a full repo mirror of a simple repository with a single branch - (this causes an "already up to date" error in go-git) - - https://github.com/defenseunicorns/golang-tekton-hello-world.git - name: specific-tag required: true repos: # The following performs a tag Git Repo Mirror with `go-git` (internal to Zarf) - - https://github.com/defenseunicorns/zarf-public-test.git@v0.0.1 + - https://github.com/zarf-dev/zarf-public-test.git@v0.0.1 # The following performs a refspec tag Git Repo Mirror with `go-git` - - https://github.com/defenseunicorns/zarf-public-test.git@refs/tags/v0.0.1 + - https://github.com/zarf-dev/zarf-public-test.git@refs/tags/v0.0.1 # The following performs a tag Git Repo Mirror forcing a fallback to host `git` - https://dev.azure.com/defenseunicorns/zarf-public-test/_git/zarf-public-test@v0.0.1 actions: @@ -36,7 +34,7 @@ components: required: true repos: # The following performs a branch Git Repo Mirror with `go-git` (internal to Zarf) - - https://github.com/defenseunicorns/zarf-public-test.git@refs/heads/dragons + - https://github.com/zarf-dev/zarf-public-test.git@refs/heads/dragons # The following performs a branch Git Repo Mirror forcing a fallback to host `git` - https://dev.azure.com/defenseunicorns/zarf-public-test/_git/zarf-public-test@refs/heads/dragons actions: @@ -51,7 +49,7 @@ components: required: true repos: # The following performs a SHA Git Repo Mirror with `go-git` (internal to Zarf) - - https://github.com/defenseunicorns/zarf-public-test.git@01a23218923f24194133b5eb11268cf8d73ff1bb + - https://github.com/zarf-dev/zarf-public-test.git@01a23218923f24194133b5eb11268cf8d73ff1bb # The following performs a SHA Git Repo Mirror forcing a fallback to host `git` - https://dev.azure.com/defenseunicorns/zarf-public-test/_git/zarf-public-test@01a23218923f24194133b5eb11268cf8d73ff1bb actions: diff --git a/src/test/packages/51-import-everything/zarf.yaml b/src/test/packages/51-import-everything/zarf.yaml index b69ef73086..2f29435f1e 100644 --- a/src/test/packages/51-import-everything/zarf.yaml +++ b/src/test/packages/51-import-everything/zarf.yaml @@ -39,7 +39,7 @@ components: - source: ../09-composable-packages/files/coffee-ipsum.txt target: ../09-composable-packages/coffee-ipsum.txt # Import of a file from a URL - - source: https://raw.githubusercontent.com/defenseunicorns/zarf/main/README.md + - source: https://raw.githubusercontent.com/zarf-dev/zarf/main/README.md target: files/zarf-readme.md actions: onDeploy: diff --git a/src/test/upgrade/previously_built_test.go b/src/test/upgrade/previously_built_test.go index 179bad0432..a7c42e87a1 100644 --- a/src/test/upgrade/previously_built_test.go +++ b/src/test/upgrade/previously_built_test.go @@ -9,9 +9,9 @@ import ( "path" "testing" - "github.com/defenseunicorns/zarf/src/pkg/utils/exec" - test "github.com/defenseunicorns/zarf/src/test" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/pkg/utils/exec" + test "github.com/zarf-dev/zarf/src/test" ) func kubectl(args ...string) (string, string, error) { diff --git a/src/types/component.go b/src/types/component.go index 958d60e74d..4ccf392970 100644 --- a/src/types/component.go +++ b/src/types/component.go @@ -5,10 +5,10 @@ package types import ( - "github.com/defenseunicorns/zarf/src/pkg/utils/exec" - "github.com/defenseunicorns/zarf/src/pkg/variables" - "github.com/defenseunicorns/zarf/src/types/extensions" "github.com/invopop/jsonschema" + "github.com/zarf-dev/zarf/src/pkg/utils/exec" + "github.com/zarf-dev/zarf/src/pkg/variables" + "github.com/zarf-dev/zarf/src/types/extensions" ) // ZarfComponent is the primary functional grouping of assets to deploy by Zarf. diff --git a/src/types/k8s.go b/src/types/k8s.go index 2c2c6b3527..a8f61856ce 100644 --- a/src/types/k8s.go +++ b/src/types/k8s.go @@ -9,7 +9,7 @@ import ( "time" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/config/lang" ) // WebhookStatus defines the status of a Component Webhook operating on a Zarf package secret. diff --git a/src/types/package.go b/src/types/package.go index 072319da5f..cb097d6e42 100644 --- a/src/types/package.go +++ b/src/types/package.go @@ -4,7 +4,7 @@ // Package types contains all the types used by Zarf. package types -import "github.com/defenseunicorns/zarf/src/pkg/variables" +import "github.com/zarf-dev/zarf/src/pkg/variables" // ZarfPackageKind is an enum of the different kinds of Zarf packages. type ZarfPackageKind string @@ -49,6 +49,7 @@ type ZarfMetadata struct { Description string `json:"description,omitempty" jsonschema:"description=Additional information about this package"` Version string `json:"version,omitempty" jsonschema:"description=Generic string set by a package author to track the package version (Note: ZarfInitConfigs will always be versioned to the CLIVersion they were created with)"` URL string `json:"url,omitempty" jsonschema:"description=Link to package information when online"` + Image string `json:"image,omitempty" jsonschema:"description=An image URL to embed in this package (Reserved for future use in Zarf UI)"` Uncompressed bool `json:"uncompressed,omitempty" jsonschema:"description=Disable compression of this package"` Architecture string `json:"architecture,omitempty" jsonschema:"description=The target cluster architecture for this package,example=arm64,example=amd64"` YOLO bool `json:"yolo,omitempty" jsonschema:"description=Yaml OnLy Online (YOLO): True enables deploying a Zarf package without first running zarf init against the cluster. This is ideal for connected environments where you want to use existing VCS and container registries."` diff --git a/src/types/validate.go b/src/types/validate.go index 56f5307f79..a589ed802d 100644 --- a/src/types/validate.go +++ b/src/types/validate.go @@ -11,7 +11,7 @@ import ( "regexp" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/config/lang" ) const ( diff --git a/src/types/validate_test.go b/src/types/validate_test.go index eea97ec097..b0ebc60e8f 100644 --- a/src/types/validate_test.go +++ b/src/types/validate_test.go @@ -11,9 +11,9 @@ import ( "testing" "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/defenseunicorns/zarf/src/config/lang" - "github.com/defenseunicorns/zarf/src/pkg/variables" "github.com/stretchr/testify/require" + "github.com/zarf-dev/zarf/src/config/lang" + "github.com/zarf-dev/zarf/src/pkg/variables" ) func TestZarfPackageValidate(t *testing.T) { diff --git a/zarf-config.toml b/zarf-config.toml index eb549dac54..09afb3eed3 100644 --- a/zarf-config.toml +++ b/zarf-config.toml @@ -1,7 +1,7 @@ [package.create.set] # The image reference to use for the Zarf agent, defaults to a locally built image agent_image_domain = 'ghcr.io/' -agent_image = 'defenseunicorns/zarf/agent' +agent_image = 'zarf-dev/zarf/agent' agent_image_tag = 'local' # Tag for the zarf injector binary to use diff --git a/zarf.schema.json b/zarf.schema.json index 3004a424b1..b5c7a971d4 100644 --- a/zarf.schema.json +++ b/zarf.schema.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://github.com/defenseunicorns/zarf/src/types/zarf-package", + "$id": "https://github.com/zarf-dev/zarf/src/types/zarf-package", "$defs": { "BigBang": { "properties": { @@ -1023,6 +1023,10 @@ "type": "string", "description": "Link to package information when online" }, + "image": { + "type": "string", + "description": "An image URL to embed in this package (Reserved for future use in Zarf UI)" + }, "uncompressed": { "type": "boolean", "description": "Disable compression of this package"