nflaig / semantic-release-helm

semantic-release plugin to publish Helm charts
MIT License
13 stars 11 forks source link

Failed to push to OCI registry #8

Closed lsoica closed 1 year ago

lsoica commented 1 year ago

Got this error:

[11:08:51 AM] [semantic-release] › ✘  An error occurred while running semantic-release: Error: Command failed with exit code 1: helm push <redacted> <redacted url>
Error: scheme prefix missing from remote (e.g. "oci://")

with helm:

$ helm version
version.BuildInfo{Version:"v3.10.3", GitCommit:"835b7334cfe2e5e27870ab3ed4135f136eecc704", GitTreeState:"clean", GoVersion:"go1.18.9"}
nflaig commented 1 year ago

did you try adding the scheme prefix oci:// to your registry URI?

lsoica commented 1 year ago

Yes, here's what I get with oci://

    Error: Command failed with exit code 1: helm registry login --username <redacted> --password-stdin oci:
    time="2023-03-14T11:49:14Z" level=info msg="Error logging in to endpoint, trying next endpoint" error="Get /"https://oci/v2//": dial tcp: lookup oci on 10.43.0.10:53: server misbehaving"

I think there's a split there on ':'

I was only able to make it work with helm v3.6.3

nflaig commented 1 year ago

in the log it shows https as protocol, I mean just specifying oci protocol

lsoica commented 1 year ago

I thought it's a fallback to http. Here's what I have in .releaserc:

  "plugins": [
    [
      "semantic-release-helm3",
      {
        chartPath: './chart',
        registry: 'oci://<fqdn>/<chart name>'
      }
    ]
nflaig commented 1 year ago

that looks correct, if this does not work, the only option is to downgrade helm I suppose

adloiseau commented 1 year ago

I have the same problem, any news ?

lsoica commented 1 year ago

I think the right question is, @nflaig do you accept PRs?

nflaig commented 1 year ago

@lsoica yeah for sure, contributions are always welcome, I am happy to review & release. I try to fix stuff myself if I can (see https://github.com/nflaig/semantic-release-helm/pull/12) but I really do not have that much time at the moment to work on this. I also do not use this plugin myself any longer and do not have good setup right now to test it properly.

nflaig commented 1 year ago

In case someone want to implement a fix for this, if it is related to having different syntax based on helm version, there are helpers for this

https://github.com/nflaig/semantic-release-helm/blob/c14843dbb91ff34ce803f8cf640b256610733c83/lib/utils.js#L4-L11

might just add another branch like it is done here

https://github.com/nflaig/semantic-release-helm/blob/c14843dbb91ff34ce803f8cf640b256610733c83/lib/publish.js#L67