-
Notifications
You must be signed in to change notification settings - Fork 2
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
Added support for legacy Helm chart repositories #58
base: main
Are you sure you want to change the base?
Conversation
The PR looks fine, as it extends functionality and maintains API compatibility. |
@frizzr Could you perhaps give us an example usage of |
Yes. I'll get something together in the next day or two. |
I'll need to create additional code to send a Helm chart package to a legacy Helm repository. There is no built-in helm command to upload a chart to a non-OCI repository. Helm only added the push command for OCI. A legacy Helm repository is just a file server that handles HTTP(S) file uploads. In a CI/CD process we normally use The way I will write it is that the user will need to prefix any vendor-specific pathing as part of the repository string. For example, JFrog Artifactory usually requires So, for those who want to send a chart to Artifactory hosted at
Another difference with non-OCI repositories is that you can put the packaged chart in any subpath in the destination repository, so similarly, we would allow the user to suffix that pathing to the repository parameter. Continuing the example, if the user wanted to put the chart in a
Finally, I'm open to even adding a new Dagger function to your API if you feel this is overloading things too much with the existing API, or creating additional optional parameters with the existing function. In short, I'm flexible and willing to abide by any API guidance you provide. Still, maybe all of this is a deal-breaker for you if you only want to include commands that Helm directly supports or assume that the proposed support will only be for HTTPS Basic Authentication. I'll have to write the code either way (since I am making a wrapper around your module anyway given our in-company API is different) but I fully understand whatever you decide. |
OK, thank you for the clarifications! I think it's fine to use Basicly the existing This logic could be put in a separate function, which then could be called inside the
|
The only concern I have with your suggestion of putting the push command function in For now I will just inline the logic in |
That's actually a good point! I'll leave the further implementation up to you =) |
Okay. Initial code added. I'll now test it. |
I was able to test that non-OCI charts do upload successfully and the logic for detecting if the chart already exists on the server is also working for non-OCI charts. Would it be possible for you to test OCI charts with this code? I did have to change the new boolean flag from |
Thank you, looks great! Just one last thing: I added a test for the existing chart check. |
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.
Thank you @frizzr for your contributions!
We added tests for the PackagePush
return logic.
Please rebase your PR onto main.
Then you'll see, that a test fails.
I commented the problems of your solution.
@@ -58,7 +60,7 @@ func (h *Helm) Version( | |||
return strings.TrimSpace(version), nil | |||
} | |||
|
|||
// Packages and pushes a Helm chart to a specified OCI-compatible registry with authentication. | |||
// Packages and pushes a Helm chart to a specified OCI-compatible (by default) registry with authentication. | |||
// | |||
// Returns true if the chart was successfully pushed, or false if the chart already exists, with error handling for push failures. |
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.
This is the behavior of the method for existing or not existing versions. Errors are only thrown for technical reasons.
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 believe the commit I made resolves this. Let me know for sure. Thanks!
This change adds support for legacy (non-OCI) Helm chart repositories in the least-disruptive way to the existing API.
…nto a private function.
This change adds support for legacy (non-OCI) Helm chart repositories in the least-disruptive way to the existing API.
I will add unit tests if the maintainers are initially okay with this. If not, I could instead refactor the code to add a separate method with a different name and the different signature.
If not interested in adding legacy Helm repo support at all, just say so and I'll close my PR.
Thanks for your consideration!
Russ