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

[Helm/Release] [Helm/V3] Add initial support for OCI registries #1892

Merged
merged 3 commits into from
Feb 15, 2022

Conversation

viveklak
Copy link
Contributor

Proposed changes

This change adds OCI registry support:

  1. Upgrades helm go module dependency to 3.8.0
  2. Updates helm invokes codepath to initialize the registry client where necessary
  3. Updates the helm release code to initialize the registry client
  4. Works around a bug in v3.8.0 of Helm where a custom registry config is not honored.
  5. Bump the integration test environment to use v3.8.0 of Helm CLI

This still needs some OCI specific integration test. This is a little more complicated since we need to provision an OCI registry first.

I followed the following for manually testing this:

  1. Provision a Google artifact registry:
import * as gcp from "@pulumi/gcp";

registry = new gcp.artifactregistry.Repository("container-registry", {
    location: "us-central1",
    repositoryId: "oci",
    description: "example docker repository",
    format: "DOCKER",
});
  1. gcloud auth configure-docker us-central1-docker.pkg.dev
  2. Push a helm chart to the registry, e.g.:
    helm push nginx-6.0.5.tgz oci://us-central1-docker.pkg.dev/pulumi-development/oci
  3. Use a pulumi program with a release set to track an OCI chart, e.g.:
nginxOci, err := helm.NewRelease(ctx, "nginx-oci", &helm.ReleaseArgs{
			Chart:     pulumi.String(`oci://us-central1-docker.pkg.dev/pulumi-development/oci/nginx`),
			Version:   pulumi.String("6.0.5"),
			Namespace: ns.Metadata.Name(),
			Values:    pulumi.Map{"service": pulumi.StringMap{"type": pulumi.String("ClusterIP")}},
		})

Related issues (optional)

Fixes #1477

@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

1 similar comment
@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

Values: rel.Values,
Version: rel.Version,
HelmChartDebug: r.settings.Debug,
IncludeTestHookResources: true,
Copy link
Member

Choose a reason for hiding this comment

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

Outside the scope of this PR, but we should probably expose this as an option for users

@made2591
Copy link

made2591 commented Feb 1, 2022

I'm looking forward to see this PR closed! 💪💪💪 keep rocking

@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@viveklak viveklak merged commit 63a0a1e into master Feb 15, 2022
@pulumi-bot pulumi-bot deleted the vl/AddOCISupport branch February 15, 2022 23:44
@SharpEdgeMarshall
Copy link
Contributor

SharpEdgeMarshall commented Feb 22, 2022

@viveklak we tried this new support for OCI registries but we were unable to dynamically pass the authentication (username, password).
After some digging looks like that your PR require you to login manually because helm sdk supports only the credentials from a config file, am I wrong?
If that's the case I think this approach is not suited for pulumi, can we do something with the component to authenticate on the fly to the registry? (like generate a helm config file on the fly)

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 for OCI helm Repositories
4 participants