-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Support Using Zarf With an External Registry and Repository (#…
…754) ## Description This PR introduces the ability to connect to an already existing (and reachable) Container Registry and/or Git Repository during the `zarf init` command. Closes #570 (Support using an external git server) Closes #560 (Support using an external registry) This implementation will serve as a good midway point on having a fully HA in-cluster registry #375. ## PR Feature List - Added several flags to the `init` command to support using an external git repository - Added several flags to the `init` command to support using an external container registry - Update `zarf connect registry` to direct to `{HOST}/v2/_catalog` (this was confusing some other people since it would originally seem like the registry was returning an empty page) - Add utility function to create a tunnel to a service URL - Created slightly better regexp for replacing the host from a `containerImage` url - semi-refactored the `zarf package deploy` logic ## Breaking Changes List - We are changing the structure of the names of repos & containers we are pushing (we are simplifying the name and adding a sha1 hash of the original name to the end of the name) Co-authored-by: Wayne Starr <Racer159@users.noreply.github.com> Co-authored-by: Megamind <882485+jeff-mccoy@users.noreply.github.com>
- Loading branch information
1 parent
89bb63d
commit a79bcde
Showing
48 changed files
with
1,505 additions
and
523 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: test-external | ||
on: | ||
pull_request: | ||
paths-ignore: | ||
- "**.md" | ||
- "**.jpg" | ||
- "**.png" | ||
- "**.gif" | ||
- "**.svg" | ||
- "adr/**" | ||
- "docs/**" | ||
|
||
# Abort prior jobs in the same workflow / PR | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
validate: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Dependency: Install Golang" | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19.x | ||
|
||
- name: "Dependency: Install Docker Buildx" | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: "Dependency: Install K3d" | ||
run: "curl -s https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | sudo bash" | ||
|
||
- name: "Dependency: K3d cluster init" | ||
run: k3d cluster delete && k3d cluster create | ||
|
||
- name: "Dependency: Install Helm" | ||
run: "curl -s https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash" | ||
|
||
- name: "Install Kubectl" | ||
run: | | ||
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" | ||
curl -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256" | ||
echo "$(cat kubectl.sha256) kubectl" | sha256sum --check | ||
chmod +x kubectl | ||
mv ./kubectl /usr/local/bin/kubectl | ||
- name: "Checkout Repo" | ||
uses: actions/checkout@v3 | ||
|
||
- name: "Build CLI" | ||
run: make build-cli-linux-amd ARCH=amd64 | ||
|
||
- name: "Zarf Agent: Login to Docker Hub" | ||
uses: docker/login-action@v2 | ||
with: | ||
username: zarfdev | ||
password: ${{ secrets.ZARF_DEV_DOCKERHUB }} | ||
|
||
- name: "Zarf Agent: Build and Publish the Image" | ||
run: | | ||
cp build/zarf build/zarf-linux-amd64 | ||
docker buildx build --push --platform linux/amd64 --tag zarfdev/agent:$GITHUB_SHA . | ||
- name: "Make Init Package" | ||
run: make init-package AGENT_IMAGE=zarfdev/agent:$GITHUB_SHA | ||
|
||
- name: "Run Tests" | ||
# NOTE: This test run will create its own K3d cluster. A single cluster will be used throughout the test run. | ||
run: make test-external | ||
|
||
- name: "Cleanup" | ||
run: make destroy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
docs/4-user-guide/1-the-zarf-cli/100-cli-commands/zarf_tools_get-git-password.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
## zarf tools get-git-password | ||
|
||
Returns the push user's password for the Git server | ||
|
||
### Synopsis | ||
|
||
Reads the password for a user with push access to the configured Git server from the zarf-state secret in the zarf namespace | ||
|
||
``` | ||
zarf tools get-git-password [flags] | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
-h, --help help for get-git-password | ||
``` | ||
|
||
### Options inherited from parent commands | ||
|
||
``` | ||
-a, --architecture string Architecture for OCI images | ||
-l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace | ||
--no-progress Disable fancy UI progress bars, spinners, logos, etc. | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [zarf tools](zarf_tools.md) - Collection of additional tools to make airgap easier | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.