Skip to content

OCI plugin installer - #2

Merged
scottrigby merged 3 commits into
plugin-systemfrom
plugin-oci-installer
Aug 6, 2025
Merged

scottrigby merged 3 commits into
plugin-systemfrom
plugin-oci-installer

Conversation

@scottrigby

Copy link
Copy Markdown
Owner

This PR adds an OCI installer to Helm 4 plugins.

⚠️ Note this PR is against the shared plugin-types branch on a fork of helm/helm, for collaboration during integrating work by multiple people.

Try it out

  1. In one console tab, make two OCI artifacts from a local plugin dir. Each artifact is a tarball. One tarball with plugin files in the root, and one with plugin files in a directory with the same name as the plugin:

    % git clone [email protected]:scottrigby/h4-simple-plugin-types.git && cd h4-simple-plugin-types
    
    # make one with file in root
    % tar -C example-cli -czvf example-cli-0.1.0.tar.gz .
    
    # make one with files in dir
    % tar -czvf example-cli-0.1.1.tar.gz example-cli
    
    # push both to github artifact registry (GITHUB_PAT registry scope)
    % echo $GITHUB_PAT | oras login -u username --password-stdin
    % oras push ghcr.io/$GITHUB_USER/example-cli:v0.1.0 example-cli.tar.gz
    % oras push ghcr.io/$GITHUB_USER/example-cli:v0.1.1 example-cli.tar.gz
    
    # inspect layers for fun, etc
    % oras manifest fetch ghcr.io/scottrigby/example-cli:v0.1.0 --pretty
  2. In a separate console tab, clone this PR branch

    # start with a clean slate
    % go run ./cmd/helm plugin uninstall example-cli
    
    # this example is a tarball with plugin files in the root, packaged as OCI artifact
    % go run ./cmd/helm plugin install oci://ghcr.io/scottrigby/example-cli:v0.1.0
    Installed plugin: example-cli
    
    % go run ./cmd/helm plugin list                                               
    NAME                   	VERSION	TYPE      	APIVERSION	SOURCE                                              
    example-cli            	0.1.0  	cli       	v1        	https://github.com/scottrigby/h4-simple-plugin-types
    
    % go run ./cmd/helm example-cli foo bar --baz=qux quxx                                            
    running command example-cli with subcommand foo and args bar --baz=qux quxx
  3. now uninstall and try with example-cli:v0.1.1. Works as well!

Q&A

  1. Why tarball instead of flat files?

    This PR only supports a OCI artifacts containing a tarball of a plugin, either with plugin files at the root of the tarball or in a directory by the same name as the plugin. Because:

    • OCI artifact files in layers directly don't preserve mode unless you compress them (if we install a plugin file that's supposed to be executable but isn't, users will get a helm error and can't even uninstall again until they make the file executable. Bad DX)
    • smaller. good to encourage compressing plugins in advance of Wasm anyway?
    • chart also store as tarballs in OCI artifacts
  2. Why not a custom Media Type like Charts?

    When we first created OCI Artifact support for Helm, we needed to create custom Media Types. Things have changed since then. We can now use a standard OCI artifact to hold the files that comprise the plugin. We can also used the updated artifactType (rather than the older config.MediaType) to specify this is a helm plugin for registry queries. This PR does not require artifactType.

@scottrigby scottrigby mentioned this pull request Jul 25, 2025
1 task done
@scottrigby scottrigby changed the title Plugin OCI installer OCI plugin installer Jul 25, 2025
Signed-off-by: Scott Rigby <[email protected]>
… way to preserve file mode for executables

Signed-off-by: Scott Rigby <[email protected]>
@scottrigby
scottrigby force-pushed the plugin-oci-installer branch from 766a12e to 4ac9fd4 Compare August 5, 2025 16:30
@scottrigby
scottrigby changed the base branch from plugin-types to plugin-system August 6, 2025 06:15
…update plugin OCI installer accordingly

Signed-off-by: Scott Rigby <[email protected]>
@scottrigby
scottrigby force-pushed the plugin-oci-installer branch from 5b436d0 to e623fd1 Compare August 6, 2025 07:03
@scottrigby
scottrigby merged commit 055974c into plugin-system Aug 6, 2025
scottrigby added a commit that referenced this pull request Aug 13, 2026
…26-6061

backport of helm#32450

updated with:

```
go get google.golang.org/[email protected]
go mod tidy
```

example actions failure:
https://github.com/helm/helm/actions/runs/31733009013/job/94557780520

```
  Vulnerability #1: GO-2026-6061
      Vulnerabilities in the xDS RBAC authorization engine and the HTTP/2
      transport server implementation in google.golang.org/grpc
    More info: https://pkg.go.dev/vuln/GO-2026-6061
    Module: google.golang.org/grpc
      Found in: google.golang.org/[email protected]
      Fixed in: google.golang.org/[email protected]
      Example traces found:
  Error:       #1: pkg/repo/repotest/server.go:128:32: repotest.NewOCIServer calls registry.NewRegistry, which eventually calls transport.ClientStream.Close
  Error:       #2: pkg/repo/repotest/server.go:128:32: repotest.NewOCIServer calls registry.NewRegistry, which eventually calls transport.ClientStream.Header
  Error:       #3: pkg/repo/repotest/server.go:128:32: repotest.NewOCIServer calls registry.NewRegistry, which eventually calls transport.ClientStream.Read
  Error:       #4: pkg/repo/repotest/server.go:128:32: repotest.NewOCIServer calls registry.NewRegistry, which eventually calls transport.ClientStream.RecvCompress
  Error:       #5: pkg/repo/repotest/server.go:128:32: repotest.NewOCIServer calls registry.NewRegistry, which eventually calls transport.ClientStream.TrailersOnly
  Error:       #6: pkg/repo/repotest/server.go:128:32: repotest.NewOCIServer calls registry.NewRegistry, which eventually calls transport.ClientStream.Write
  Error:       #7: pkg/action/lazyclient.go:49:17: action.lazyClient.init calls sync.Once.Do, which eventually calls transport.NewHTTP2Client
  Error:       #8: pkg/repo/repotest/server.go:128:32: repotest.NewOCIServer calls registry.NewRegistry, which eventually calls transport.Stream.ReadMessageHeader
  Error:       #9: pkg/action/lazyclient.go:49:17: action.lazyClient.init calls sync.Once.Do, which eventually calls transport.http2Client.Close
  Error:       #10: pkg/action/lazyclient.go:49:17: action.lazyClient.init calls sync.Once.Do, which eventually calls transport.http2Client.GracefulClose
  Error:       #11: pkg/repo/repotest/server.go:128:32: repotest.NewOCIServer calls registry.NewRegistry, which eventually calls transport.http2Client.NewStream
```

Signed-off-by: Scott Rigby <[email protected]>
scottrigby added a commit that referenced this pull request Aug 13, 2026
…26-6061 (helm#32536)

backport of helm#32450

updated with:

```
go get google.golang.org/[email protected]
go mod tidy
```

example actions failure:
https://github.com/helm/helm/actions/runs/31733009013/job/94557780520

```
  Vulnerability #1: GO-2026-6061
      Vulnerabilities in the xDS RBAC authorization engine and the HTTP/2
      transport server implementation in google.golang.org/grpc
    More info: https://pkg.go.dev/vuln/GO-2026-6061
    Module: google.golang.org/grpc
      Found in: google.golang.org/[email protected]
      Fixed in: google.golang.org/[email protected]
      Example traces found:
  Error:       #1: pkg/repo/repotest/server.go:128:32: repotest.NewOCIServer calls registry.NewRegistry, which eventually calls transport.ClientStream.Close
  Error:       #2: pkg/repo/repotest/server.go:128:32: repotest.NewOCIServer calls registry.NewRegistry, which eventually calls transport.ClientStream.Header
  Error:       #3: pkg/repo/repotest/server.go:128:32: repotest.NewOCIServer calls registry.NewRegistry, which eventually calls transport.ClientStream.Read
  Error:       #4: pkg/repo/repotest/server.go:128:32: repotest.NewOCIServer calls registry.NewRegistry, which eventually calls transport.ClientStream.RecvCompress
  Error:       #5: pkg/repo/repotest/server.go:128:32: repotest.NewOCIServer calls registry.NewRegistry, which eventually calls transport.ClientStream.TrailersOnly
  Error:       #6: pkg/repo/repotest/server.go:128:32: repotest.NewOCIServer calls registry.NewRegistry, which eventually calls transport.ClientStream.Write
  Error:       #7: pkg/action/lazyclient.go:49:17: action.lazyClient.init calls sync.Once.Do, which eventually calls transport.NewHTTP2Client
  Error:       #8: pkg/repo/repotest/server.go:128:32: repotest.NewOCIServer calls registry.NewRegistry, which eventually calls transport.Stream.ReadMessageHeader
  Error:       #9: pkg/action/lazyclient.go:49:17: action.lazyClient.init calls sync.Once.Do, which eventually calls transport.http2Client.Close
  Error:       #10: pkg/action/lazyclient.go:49:17: action.lazyClient.init calls sync.Once.Do, which eventually calls transport.http2Client.GracefulClose
  Error:       #11: pkg/repo/repotest/server.go:128:32: repotest.NewOCIServer calls registry.NewRegistry, which eventually calls transport.http2Client.NewStream
```

Signed-off-by: Scott Rigby <[email protected]>
scottrigby added a commit that referenced this pull request Aug 13, 2026
Related to helm#32310
however cherry-picking is not working well here
and for this patch release, this was fixed in v0.39.0 so not bumping to v0.40.0 here

fixed with:

```
go get golang.org/x/[email protected]
go mod tidy
```

example actions fail:

```
  Vulnerability #2: GO-2026-5970
      Infinite loop on invalid input in golang.org/x/text
    More info: https://pkg.go.dev/vuln/GO-2026-5970
    Module: golang.org/x/text
      Found in: golang.org/x/[email protected]
      Fixed in: golang.org/x/[email protected]
      Example traces found:
  Error:       #1: pkg/repo/repotest/server.go:148:2: repotest.OCIServer.Run calls registry.Registry.ListenAndServe, which eventually calls norm.Form.Bytes
  Error:       #2: pkg/repo/repotest/server.go:148:2: repotest.OCIServer.Run calls registry.Registry.ListenAndServe, which eventually calls norm.Form.IsNormalString
  Error:       #3: cmd/helm/docs.go:89:61: helm.run calls cases.Caser.String, which eventually calls norm.Form.Properties
  Error:       #4: pkg/repo/repotest/server.go:148:2: repotest.OCIServer.Run calls registry.Registry.ListenAndServe, which eventually calls norm.Form.QuickSpan
  Error:       #5: pkg/repo/repotest/server.go:148:2: repotest.OCIServer.Run calls registry.Registry.ListenAndServe, which eventually calls norm.Form.String
```

Signed-off-by: Scott Rigby <[email protected]>
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.

1 participant