Skip to content
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

Add support for OCI charts #121

Merged
merged 1 commit into from
Mar 1, 2022

Conversation

goober
Copy link

@goober goober commented Feb 16, 2022

Description of your changes

This pull request aims to add support for pulling helm charts from OCI registries.

In addition, the pull request also adds support for pulling charts from insecure registries by adding the option insecureSkipTLSVerify to the Release manifest

Since helm 3.8.0 needed some newer dependencies I decided to include a dependency upgrade in this PR as well. If it is preferable to have them as separate pull requests I can split them.

Open questions:

  • How should we handle insecure registries?
  • Should we also add support for defining the url option with oci:// prefixed protocol? And if that is the case, should we require it to define the full tar file path? Or support the url to be defined as oci://localhost:5000/myrepo/mychart:2.7.0

Fixes #75

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable to ensure this PR is ready for review.

How has this code been tested

Following manual tests have been performed:

  • repository option set to a oci:// url and also tests with version option set and without version option set.
  • url option set to a oci:// url with and without :<tag> suffix
  • with and without hitting the cache

@goober goober force-pushed the feature/oci-charts branch from e999a42 to 8e99ceb Compare February 16, 2022 09:04
pkg/clients/helm/client.go Outdated Show resolved Hide resolved
@goober goober force-pushed the feature/oci-charts branch 3 times, most recently from 5c4069f to f0ee1a5 Compare February 17, 2022 13:16
@turkenh
Copy link
Collaborator

turkenh commented Feb 18, 2022

Thanks a lot for this @goober, looking pretty good.

I would like to do some testing while reviewing this.
Could you add/extend examples under examples/sample directory

@goober
Copy link
Author

goober commented Feb 18, 2022

@turkenh Regarding the examples, do you want public hosted charts from an OCI registry that can be used or just an example url?
I have not found any good publicly available charts that can be used in the examples. Internally I have used an ECR registry in AWS during my testing

@turkenh
Copy link
Collaborator

turkenh commented Feb 18, 2022

@turkenh Regarding the examples, do you want public hosted charts from an OCI registry that can be used or just an example url? I have not found any good publicly available charts that can be used in the examples. Internally I have used an ECR registry in AWS during my testing

Ideally yes. Isn't it possible to use dockerhub for this purpose? For example, can we push the same workpress helm chart to dockerhub (e.g. under your own account) and add it to the example?

@goober
Copy link
Author

goober commented Feb 19, 2022

Ideally yes. Isn't it possible to use dockerhub for this purpose? For example, can we push the same workpress helm chart to dockerhub (e.g. under your own account) and add it to the example?

@turkenh Unfortunately it is not supported. See docker/roadmap#135
However, I have added an example for pulling from a local registry that has been setup according to the following instructions from the Helm documentation

I have also updated the PR with support for insecure repositories and registries by adding the option insecureSkipTLSVerify to the Release manifest.

@goober goober requested a review from turkenh February 22, 2022 09:19
@goober
Copy link
Author

goober commented Feb 24, 2022

Also upgraded kubebuilder after confirmation in the following slack thread

@goober goober force-pushed the feature/oci-charts branch from c4a2707 to d9b261a Compare February 24, 2022 07:39
Copy link
Collaborator

@turkenh turkenh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great, thanks @goober!

Added two nitpicks.

pkg/clients/helm/client.go Outdated Show resolved Hide resolved
pkg/clients/helm/client.go Outdated Show resolved Hide resolved
@goober goober requested a review from turkenh February 25, 2022 17:03
@turkenh
Copy link
Collaborator

turkenh commented Feb 25, 2022

@goober some checks are failing, any ideas?

@goober
Copy link
Author

goober commented Feb 25, 2022

@goober some checks are failing, any ideas?

@turkenh Unfortunately not. I am running make lint locally and it goes through. Same with make reviewable

@goober
Copy link
Author

goober commented Feb 28, 2022

@turkenh I ran golangci-lint run locally and found some linting errors. Upgraded golangci-lint to latest version and fixed the issues. I hope it will pass the build now

@goober goober force-pushed the feature/oci-charts branch 4 times, most recently from 1f29a4f to 82cd1c2 Compare February 28, 2022 09:45
@goober goober mentioned this pull request Mar 1, 2022
2 tasks
Signed-off-by: Mathias Åhsberg <[email protected]>
@goober goober force-pushed the feature/oci-charts branch from 82cd1c2 to ec820a1 Compare March 1, 2022 19:35
@goober
Copy link
Author

goober commented Mar 1, 2022

@turkenh The pull request has now been rebased after #122 and is ready for review and testing.

@turkenh turkenh merged commit d04ceff into crossplane-contrib:master Mar 1, 2022
@goober goober mentioned this pull request Mar 9, 2022
2 tasks
@hikhvar
Copy link

hikhvar commented Apr 29, 2022

Hey, I like this feature! Is there an example how to pull charts from a private OCI registry? In detail: How to configure the pull secrets for that?

@goober goober deleted the feature/oci-charts branch November 14, 2022 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Helm3 OCI Charts
4 participants