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

fix: add missing untar flag to pull chart from oci registry #371

Merged
merged 2 commits into from
Sep 18, 2022

Conversation

toVersus
Copy link
Contributor

It seems that #290 introduced a bug and we no longer generate manifests from OCI based chart:

=== RUN   TestHelmfileTemplateWithBuildCommand/oci_chart_pull
    snapshot_test.go:172: Output from [-f testdata/snapshot/oci_chart_pull/input.yaml template]: Pulling localhost:5000/myrepo/raw:0.1.0
        Pulled: localhost:5000/myrepo/raw:0.1.0
        Digest: sha256:4c321df86a2b822e62583a45f0e9507027e10b0aca232665b1cd6be6da0cdc19

        in testdata/snapshot/oci_chart_pull/input.yaml: [release "foo": command "/usr/local/bin/helm" exited with non-zero status:

        PATH:
          /usr/local/bin/helm

        ARGS:
          0: helm (4 bytes)
          1: pull (4 bytes)
          2: oci://localhost:5000/myrepo/raw (31 bytes)
          3: --version (9 bytes)
          4: 0.1.0 (5 bytes)
          5: --destination (13 bytes)
          6: /var/folders/j5/238lrgj54dz032np_n85c8nh0000gp/T/helmfile3497684751/foo/raw/0.1.0 (81 bytes)

        ERROR:
          exit status 1

        EXIT STATUS
          1

        STDERR:
          Error: open /var/folders/j5/238lrgj54dz032np_n85c8nh0000gp/T/helmfile3497684751/foo/raw/0.1.0/raw-0.1.0.tgz1281403981: no such file or directory

        COMBINED OUTPUT:
          Pulled: localhost:5000/myrepo/raw:0.1.0
          Digest: sha256:4c321df86a2b822e62583a45f0e9507027e10b0aca232665b1cd6be6da0cdc19
          Error: open /var/folders/j5/238lrgj54dz032np_n85c8nh0000gp/T/helmfile3497684751/foo/raw/0.1.0/raw-0.1.0.tgz1281403981: no such file or directory]
    snapshot_test.go:175:
        	Error Trace:	/Users/MB-873/Documents/helmfile/test/e2e/template/helmfile/snapshot_test.go:175
        	Error:      	Received unexpected error:
        	            	exit status 1
        	Test:       	TestHelmfileTemplateWithBuildCommand/oci_chart_pull
        	Messages:   	Unable to run helmfile with args [-f testdata/snapshot/oci_chart_pull/input.yaml template]

This PR contains two commits:

  1. Add failing E2E test to generate manifests from OCI based chart
  2. Add missing --untar flag to helm pull command

Signed-off-by: Tsubasa Nagasawa <toversus2357@gmail.com>
Signed-off-by: Tsubasa Nagasawa <toversus2357@gmail.com>
Copy link
Member

@yxxhero yxxhero left a comment

Choose a reason for hiding this comment

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

LGTM

@yxxhero yxxhero merged commit 0341027 into helmfile:main Sep 18, 2022
@toVersus toVersus deleted the fix/oci-pull-bug branch September 18, 2022 13:02
// OCI based helm charts are pulled and exported under temporary directory.
// We are not sure the exact name of the temporary directory generated by helmfile,
// so redact its base directory name with $TMP.
if config.LocalDockerRegistry.Enabled {
Copy link
Contributor

Choose a reason for hiding this comment

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

Perfect! Awesome job @toVersus!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants