feat: add ability to supply custom init package#4562
Conversation
Signed-off-by: Allen Conlon <software@conlon.dev>
✅ Deploy Preview for zarf-docs canceled.
|
|
So I wanted to update However I wanted to ask what would be the best way to go about testing it? Should I first install an older version of zarf, say zarf init oci://ghcr.io/zarf-dev/packages/init:v0.70.1Then try to just a: zarf init? |
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
AustinAbro321
left a comment
There was a problem hiding this comment.
A few small comments. I think this is a positive change
|
@a1994sc I actually have a different request for how you should test this. Could you create a new workflow that tests the previouses release of the init package, deployed with the Zarf binary in the PR? This feature makes it easier for older init package versions to be deployed, so I want to make sure we have a proper test for that. |
Signed-off-by: Allen Conlon <software@conlon.dev>
7576424 to
700eeff
Compare
I do think that would be a good idea. Should I create a new one, or update To install the latest release, but with the PR binary, and then upgrade? |
|
hmm I can see the argument both ways. I think test upgrade flow would work if we did:
The argument against adding it is that it makes our longest job longer, but given that a secondary init is only about a ~45 second increase, I think it'd be fine in test-upgrade. |
Signed-off-by: Allen Conlon <software@conlon.dev>
Signed-off-by: Allen Conlon <software@conlon.dev>
Signed-off-by: Allen Conlon <software@conlon.dev>
Signed-off-by: Allen Conlon <software@conlon.dev>
Signed-off-by: Allen Conlon <software@conlon.dev>
Signed-off-by: Allen Conlon <software@conlon.dev>
de6b900 to
ca7ca71
Compare
|
@AustinAbro321 can you let me know if the changes to |
Signed-off-by: Allen Conlon <software@conlon.dev>
| - name: Initialize the cluster with the release version | ||
| # NOTE: "PATH=$PATH" preserves the default user $PATH. This is needed to maintain the version of zarf installed | ||
| # in a previous step. This test run will the current release to create a K3s cluster. | ||
| # Test will initialize the cluster with the latest released version package, with the current built binary | ||
| run: | | ||
| sudo env CI=true ./build/zarf init --components k3s,git-server --nodeport 31337 --confirm ${HOME}/.zarf-cache/zarf-init-amd64-$(zarf version).tar.zst | ||
|
|
||
| - name: Upgrade the cluster with the build version | ||
| run: | | ||
| sudo env "PATH=$PATH" CI=true zarf init --components k3s,git-server --nodeport 31337 --confirm | ||
| sudo env CI=true ./build/zarf init --components k3s,git-server --nodeport 31337 --confirm ./build/zarf-init-amd64-$(./build/zarf version).tar.zst |
There was a problem hiding this comment.
After some more consideration, I actually am going to advocate for a separate workflow to test using the build version of Zarf with the release init package
I don't want to lose the core case we're testing here, which is taking a zarf cluster initialized with version X to version Y. This is the most common use case, so I want to keep it first class within this test, and not risk a situation where it ends up passing, but only because the cluster was first initialized with the build version of Zarf.
From a code clarity perspective should help keep it more clear what each workflow is testing too.
There was a problem hiding this comment.
So just for my own understanding, do you like the current flow in .github/workflows/test-upgrade.yml in general? If so, I can work on creating a new workflow based off it
There was a problem hiding this comment.
The test upgrade workflow can be a bit confusing I think, but overall it's fine. I don't think we'll need to duplicate the workflow though. I think just proving we can run a build/zarf init using the latest release version of Zarf is enough.
There was a problem hiding this comment.
So do you want it to look like this?
sudo env CI=true ./build/zarf init --components k3s,git-server --nodeport 31337 --confirmThat should use the init package in the same folder as build/zarf right?
There was a problem hiding this comment.
Yeah the command should mostly look like this, but I'd have it use the last release version of Zarf. Essentially, I'm thinking the command should look like this. We use the build Zarf, but the last release version
sudo env CI=true ./build/zarf init --components k3s,git-server --nodeport 31337 --confirm ${HOME}/.zarf-cache/zarf-init-amd64-$(zarf version).tar.zstThere was a problem hiding this comment.
Isn't that what I have on line 76?
There was a problem hiding this comment.
Yes, but I'd like it to be outside of the test upgrade workflow.
Right now we're not preforming the test case of release zarf + release zarf init. I don't want to risk there being a difference, between that and build zarf + release zarf init, especially given that using release Zarf to the next version is the the most common flow users will preform when upgrading. I believe having it in a separate workflow also decreases the complexity of this workflow, and makes what we're testing more obvious in both scenarios
Signed-off-by: Allen Conlon <software@conlon.dev>
Signed-off-by: Allen Conlon <software@conlon.dev>
Description
Allow for passing custom init packages to
zarf initRelated Issue
Fixes #4560
Checklist before merging