-
Notifications
You must be signed in to change notification settings - Fork 702
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flux oci support 6: implement Update OCI repo and integration tests #5113
Flux oci support 6: implement Update OCI repo and integration tests #5113
Conversation
✅ Deploy Preview for kubeapps-dev canceled.Built without sensitive environment variables
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks for the integration tests ensuring it works as expected!
@@ -261,7 +261,14 @@ func (r *OCIRegistry) downloadChart(chart *repo.ChartVersion) (*bytes.Buffer, er | |||
|
|||
// trim the oci scheme prefix if needed | |||
getThis := strings.TrimPrefix(u.String(), fmt.Sprintf("%s://", registry.OCIScheme)) | |||
return r.helmGetter.Get(getThis, clientOpts...) | |||
log.Infof("about to call helmGetter.Get(%s)", getThis) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this log should be a debug-level one ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all these pesky log messages will be gone by end of next week. They're here only while I was actively working on this feature. See my 2nd action item in #5007 (comment). I just haven't got to it yet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, great, no problem then. Thanks for the pointer!
@@ -5,88 +5,283 @@ | |||
|
|||
# this is used to build an image that can be used to stand-up a pod that serves static test-data in | |||
# local kind cluster. Used by the integration tests. This script needs to be run once before the running | |||
# the test(s) | |||
# the test(s). This script requires GitHub CLI (gh) to be installed locally. On MacOS you can | |||
# install it via 'brew install gh' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd also add the link to the releases page:
https://github.com/cli/cli/releases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do. Thank you for the review!
The goal of this PR was to implement Update() for OCI helm repositories. I expected
flux source-controller to notify my code if the remote OCI repository contents changes,
like it does with a regular HTTP helm repository.
Like most of my PRs, this was test-driven. The plan was:
that was failing due to production code I had yet to write
(i.e. not implemented Update)
That was the plan. Unfortunately it did not work out due to reasons beyond my
control. For the integration test to be reproducible, I needed to have "my own"
OCI registry the contents of which I can modify (i.e add or delete chart versions)
and I don't have to worry about others making changes to it. In addition to serving this integration test having "my own" registry would be a big stop toward resolving an outstanding dependency to GitHub registry which is not in my ownership, so any chart version hard-coded in the test are subject to change
The PR reflects all my attempts to do so:
https://helm.sh/docs/topics/registries/ and have the integration test use that.
That effort failed due to Flux fails to login to HTTP OCI registry where helm CLI logs in fluxcd/source-controller#805
Add support for insecure registries in HelmRepositories of Type oci fluxcd/source-controller#807 and How can I push chart to an insecure OCI registry with helm v3 helm/helm#6324
GitHub. I set up access control so others can read, but not modify the repo contents.
The setup worked but the integration test was ultimately blocked due to flux not supporting
the use case I had in mind. Requested feature: flux OCI helm repositories notice when tags on remote registry change fluxcd/source-controller#839.
This discussion is ongoing. I did not want to discard my work so far, because all the scenarios
should be valid once the dependent issues are resolved
Update 7/25: added an integration test for what is arguably more important scenario that works fine:
i.e. flux server-side is auto-upgrading to latest chart when it is pushed to remote