Skip to content

Extism/v1 plugin runtime support - #17

Merged
gjenkins8 merged 3 commits into
scottrigby:plugin-systemfrom
gjenkins8:gjenkins/plugin-system/extismv1_runtime
Aug 13, 2025
Merged

gjenkins8 merged 3 commits into
scottrigby:plugin-systemfrom
gjenkins8:gjenkins/plugin-system/extismv1_runtime

Conversation

@gjenkins8

Copy link
Copy Markdown
Collaborator

What this PR does / why we need it:

Special notes for your reviewer:

If applicable:

  • this PR contains user facing changes (the docs needed label should be applied if so)
  • this PR contains unit tests
  • this PR has been tested for backwards compatibility

@gjenkins8
gjenkins8 force-pushed the gjenkins/plugin-system/extismv1_runtime branch from 5117861 to 7734082 Compare August 13, 2025 05:12
@gjenkins8
gjenkins8 merged commit 54258b0 into scottrigby:plugin-system Aug 13, 2025
@gjenkins8
gjenkins8 deleted the gjenkins/plugin-system/extismv1_runtime branch August 13, 2025 05:16
gjenkins8 pushed a commit that referenced this pull request Aug 16, 2025
…mand type flag

Signed-off-by: Scott Rigby <[email protected]>

TODO for execRender

Signed-off-by: Scott Rigby <[email protected]>

Replace --post-renderer arbitrary binary execution with plugin of type postrender

Signed-off-by: Scott Rigby <[email protected]>

Note this old todo for moving postrenderer to plugin system is now complete:

	// NOTE(thomastaylor312): I am leaving this code commented out here. During
	// the implementation of post-render, it was brought up that if we are
	// relying on plugins, we should actually use the plugin system so it can
	// properly handle multiple OSs. This will be a feature add in the future,
	// so I left this code for reference. It can be deleted or reused once the
	// feature is implemented

Signed-off-by: Scott Rigby <[email protected]>

Move postrenderer package to plugins. combine and fix tests

Signed-off-by: Scott Rigby <[email protected]>

Fix references to pkg/plugin

Signed-off-by: Scott Rigby <[email protected]>

Fix TestPostRendererFlagSetOnce test

Signed-off-by: Scott Rigby <[email protected]>

Fix TestLoadPluginsForCompletion

Signed-off-by: Scott Rigby <[email protected]>

Fix TestLoadPlugins

Signed-off-by: Scott Rigby <[email protected]>

Fix linting

Signed-off-by: Scott Rigby <[email protected]>

List and use legacy plugins using the same Plugin struct and removing unmarshall strict

Signed-off-by: Scott Rigby <[email protected]>

Add Plugin interface in front of PluginLegacy and Pluginv1

Signed-off-by: Scott Rigby <[email protected]>

Disambiguate API version legacy from type. There is no more legacy type (legacy plugins are either cli or download)

Signed-off-by: Scott Rigby <[email protected]>

Validate PluginV1

Signed-off-by: Scott Rigby <[email protected]>

Add apiVersion to test data

fix nil pointer dereference for tests

Signed-off-by: Scott Rigby <[email protected]>

TODO for testing

Signed-off-by: Scott Rigby <[email protected]>

Comments and TODOs

Signed-off-by: Scott Rigby <[email protected]>

Try Plugin Config interface and Config implementations per plugin type

Signed-off-by: Scott Rigby <[email protected]>

Add Runtime and RuntimeConfig interfaces, and implement per runtime (subprocess and Wasm). Move fields to the applicable config structs. TODO update tests and testdata YAML to match

Signed-off-by: Scott Rigby <[email protected]>

Attempt to reorganize fields to make sense on new structs, YAML to match, and update tests to match

Signed-off-by: Scott Rigby <[email protected]>

pkg/plugin tests pass

Signed-off-by: Scott Rigby <[email protected]>

Fix TestLoadPlugins. All tests pass now

Signed-off-by: Scott Rigby <[email protected]>

Do not attept to unmarshall into PluginLegacy if apiVersion is present but with the wrong value. Give better error instead

Signed-off-by: Scott Rigby <[email protected]>

Remove legacy field fallback for PluginV1. Users should update their plugin.yaml fully if they set apiVersion to v1

Signed-off-by: Scott Rigby <[email protected]>

Reorganize code into separate files for better readability

Signed-off-by: Scott Rigby <[email protected]>

fix runHook

Signed-off-by: Scott Rigby <[email protected]>

Add plugin sourceURL

Signed-off-by: Scott Rigby <[email protected]>

Change CLI plugin config to match cobra options

Signed-off-by: Scott Rigby <[email protected]>

Fix tests after updating shortHelp, longHelp and usage fields

Signed-off-by: Scott Rigby <[email protected]>

add missing newlines at EOF

Signed-off-by: Scott Rigby <[email protected]>

Unsuccessful attempt at consolidating all subprocess funcs into Runtime.Invoke. Tests pass but functionality doesn't work. Keeping for reference to ideas but will revert in next commit

Signed-off-by: Scott Rigby <[email protected]>

Revert "Unsuccessful attempt at consolidating all subprocess funcs into Runtime.Invoke. Tests pass but functionality doesn't work. Keeping for reference to ideas but will revert in next commit"

This reverts commit 842b1b3.

Fix regression from a3bc64a that prevented legacy CLI plugins from loading

Signed-off-by: Scott Rigby <[email protected]>

move all direct os/exec calls from any code outside pkg/plugin

Signed-off-by: Scott Rigby <[email protected]>

change all calls to exec funcs in pkg/plugin/exec.go to now use new invoke methods

Signed-off-by: Scott Rigby <[email protected]>

move runtime-specific code from runtime.go into separate files for better organization

Signed-off-by: Scott Rigby <[email protected]>

Fix gofmt

Signed-off-by: Scott Rigby <[email protected]>

Update TODOs and comments

Signed-off-by: Scott Rigby <[email protected]>

More TODOs

Signed-off-by: Scott Rigby <[email protected]>

execHook is only used within the package. don't export. consolidate with other funcs later

Signed-off-by: Scott Rigby <[email protected]>

Refactor the Postrenderer interface to use a runtime-agnostic factory pattern

Signed-off-by: Scott Rigby <[email protected]>

Add new Runtime.Postrender method to better organize runtime-specific logic for postrender type plugins

Signed-off-by: Scott Rigby <[email protected]>

Consolidate remaining exec functions into runtime_subprocess.go. Keep chipping away at them

Signed-off-by: Scott Rigby <[email protected]>

rename ExecError to plugin.Error. it's not only for exec

Signed-off-by: Scott Rigby <[email protected]>

Simplify to use just Runtime.Invoke

Signed-off-by: Scott Rigby <[email protected]>

move execHook into RuntimeSubprocess.InvokeHook

Signed-off-by: Scott Rigby <[email protected]>

Remove unused Plugin.GetRuntime

Signed-off-by: Scott Rigby <[email protected]>

Rename Plugin.GetMetadata method to Metadata

Signed-off-by: Scott Rigby <[email protected]>

Create Metadata interface. Move GetConfig, GetRuntimeConfig, GetAPIVersion, GetName, and GetType methods from Plugin to Metadata interface

Signed-off-by: Scott Rigby <[email protected]>

Shorten Plugin.GetRuntimeInstance to Plugin.Runtime

Signed-off-by: Scott Rigby <[email protected]>

Shorten RuntimeConfig.GetRuntimeType and Config.GetType to just Type

Signed-off-by: Scott Rigby <[email protected]>

Move Invoke to Plugin (and for now invoke-like commands, until we merge them). Remove old PrepareCommand properly (handle ignoreFlags). As of now clients are expected to account for the ignore flag. Un-export Runtime methods

Signed-off-by: Scott Rigby <[email protected]>

Change LoadDir to switch. Deliberately not adding conversion function

Signed-off-by: Scott Rigby <[email protected]>

Fix Load all return and error

Signed-off-by: Scott Rigby <[email protected]>

Fix some semantics. Avoid yaml package name conflict

Signed-off-by: Scott Rigby <[email protected]>

Change reflect.DeepEqual to assert.Equal for Plugin.Metadata

Signed-off-by: Scott Rigby <[email protected]>

Add more robust plugin find criteria with findFunc and filterFunc pattern

Co-authored-by: George Jenkins <[email protected]>

Signed-off-by: Scott Rigby <[email protected]>

Integrate PR #7 into old interfaces

Signed-off-by: Scott Rigby <[email protected]>

Finish integrating #7 into orig interfaces. Tests all pass ✅

Signed-off-by: Scott Rigby <[email protected]>

Integrate draft PR Convert post-renderer to invoke #9

Signed-off-by: Scott Rigby <[email protected]>

revert back to postrenderER (for the record I dislike this, but agree it's consistent)

Signed-off-by: Scott Rigby <[email protected]>

Change some naming

Signed-off-by: Scott Rigby <[email protected]>

Fix make test-style (goimports/golangci-lint) errors

Signed-off-by: Scott Rigby <[email protected]>

OCI installer for plugins

Signed-off-by: Scott Rigby <[email protected]>

Simplify. We only want to support tarballs. This is the only reliable way to preserve file mode for executables

Signed-off-by: Scott Rigby <[email protected]>

Update pkg/getter/ocigetter to work for both charts and plugins, and update plugin OCI installer accordingly

Signed-off-by: Scott Rigby <[email protected]>

Plugin runtime support (#15)

Fix linting issues (#18)

Extism/v1 plugin runtime support (#17)

Fix legacy metadata downloader convert

lint

Move pkg/plugins -> internal/plugin (#16)
gjenkins8 pushed a commit that referenced this pull request Aug 16, 2025
…mand type flag

Signed-off-by: Scott Rigby <[email protected]>

TODO for execRender

Signed-off-by: Scott Rigby <[email protected]>

Replace --post-renderer arbitrary binary execution with plugin of type postrender

Signed-off-by: Scott Rigby <[email protected]>

Note this old todo for moving postrenderer to plugin system is now complete:

	// NOTE(thomastaylor312): I am leaving this code commented out here. During
	// the implementation of post-render, it was brought up that if we are
	// relying on plugins, we should actually use the plugin system so it can
	// properly handle multiple OSs. This will be a feature add in the future,
	// so I left this code for reference. It can be deleted or reused once the
	// feature is implemented

Signed-off-by: Scott Rigby <[email protected]>

Move postrenderer package to plugins. combine and fix tests

Signed-off-by: Scott Rigby <[email protected]>

Fix references to pkg/plugin

Signed-off-by: Scott Rigby <[email protected]>

Fix TestPostRendererFlagSetOnce test

Signed-off-by: Scott Rigby <[email protected]>

Fix TestLoadPluginsForCompletion

Signed-off-by: Scott Rigby <[email protected]>

Fix TestLoadPlugins

Signed-off-by: Scott Rigby <[email protected]>

Fix linting

Signed-off-by: Scott Rigby <[email protected]>

List and use legacy plugins using the same Plugin struct and removing unmarshall strict

Signed-off-by: Scott Rigby <[email protected]>

Add Plugin interface in front of PluginLegacy and Pluginv1

Signed-off-by: Scott Rigby <[email protected]>

Disambiguate API version legacy from type. There is no more legacy type (legacy plugins are either cli or download)

Signed-off-by: Scott Rigby <[email protected]>

Validate PluginV1

Signed-off-by: Scott Rigby <[email protected]>

Add apiVersion to test data

fix nil pointer dereference for tests

Signed-off-by: Scott Rigby <[email protected]>

TODO for testing

Signed-off-by: Scott Rigby <[email protected]>

Comments and TODOs

Signed-off-by: Scott Rigby <[email protected]>

Try Plugin Config interface and Config implementations per plugin type

Signed-off-by: Scott Rigby <[email protected]>

Add Runtime and RuntimeConfig interfaces, and implement per runtime (subprocess and Wasm). Move fields to the applicable config structs. TODO update tests and testdata YAML to match

Signed-off-by: Scott Rigby <[email protected]>

Attempt to reorganize fields to make sense on new structs, YAML to match, and update tests to match

Signed-off-by: Scott Rigby <[email protected]>

pkg/plugin tests pass

Signed-off-by: Scott Rigby <[email protected]>

Fix TestLoadPlugins. All tests pass now

Signed-off-by: Scott Rigby <[email protected]>

Do not attept to unmarshall into PluginLegacy if apiVersion is present but with the wrong value. Give better error instead

Signed-off-by: Scott Rigby <[email protected]>

Remove legacy field fallback for PluginV1. Users should update their plugin.yaml fully if they set apiVersion to v1

Signed-off-by: Scott Rigby <[email protected]>

Reorganize code into separate files for better readability

Signed-off-by: Scott Rigby <[email protected]>

fix runHook

Signed-off-by: Scott Rigby <[email protected]>

Add plugin sourceURL

Signed-off-by: Scott Rigby <[email protected]>

Change CLI plugin config to match cobra options

Signed-off-by: Scott Rigby <[email protected]>

Fix tests after updating shortHelp, longHelp and usage fields

Signed-off-by: Scott Rigby <[email protected]>

add missing newlines at EOF

Signed-off-by: Scott Rigby <[email protected]>

Unsuccessful attempt at consolidating all subprocess funcs into Runtime.Invoke. Tests pass but functionality doesn't work. Keeping for reference to ideas but will revert in next commit

Signed-off-by: Scott Rigby <[email protected]>

Revert "Unsuccessful attempt at consolidating all subprocess funcs into Runtime.Invoke. Tests pass but functionality doesn't work. Keeping for reference to ideas but will revert in next commit"

This reverts commit 842b1b3.

Fix regression from a3bc64a that prevented legacy CLI plugins from loading

Signed-off-by: Scott Rigby <[email protected]>

move all direct os/exec calls from any code outside pkg/plugin

Signed-off-by: Scott Rigby <[email protected]>

change all calls to exec funcs in pkg/plugin/exec.go to now use new invoke methods

Signed-off-by: Scott Rigby <[email protected]>

move runtime-specific code from runtime.go into separate files for better organization

Signed-off-by: Scott Rigby <[email protected]>

Fix gofmt

Signed-off-by: Scott Rigby <[email protected]>

Update TODOs and comments

Signed-off-by: Scott Rigby <[email protected]>

More TODOs

Signed-off-by: Scott Rigby <[email protected]>

execHook is only used within the package. don't export. consolidate with other funcs later

Signed-off-by: Scott Rigby <[email protected]>

Refactor the Postrenderer interface to use a runtime-agnostic factory pattern

Signed-off-by: Scott Rigby <[email protected]>

Add new Runtime.Postrender method to better organize runtime-specific logic for postrender type plugins

Signed-off-by: Scott Rigby <[email protected]>

Consolidate remaining exec functions into runtime_subprocess.go. Keep chipping away at them

Signed-off-by: Scott Rigby <[email protected]>

rename ExecError to plugin.Error. it's not only for exec

Signed-off-by: Scott Rigby <[email protected]>

Simplify to use just Runtime.Invoke

Signed-off-by: Scott Rigby <[email protected]>

move execHook into RuntimeSubprocess.InvokeHook

Signed-off-by: Scott Rigby <[email protected]>

Remove unused Plugin.GetRuntime

Signed-off-by: Scott Rigby <[email protected]>

Rename Plugin.GetMetadata method to Metadata

Signed-off-by: Scott Rigby <[email protected]>

Create Metadata interface. Move GetConfig, GetRuntimeConfig, GetAPIVersion, GetName, and GetType methods from Plugin to Metadata interface

Signed-off-by: Scott Rigby <[email protected]>

Shorten Plugin.GetRuntimeInstance to Plugin.Runtime

Signed-off-by: Scott Rigby <[email protected]>

Shorten RuntimeConfig.GetRuntimeType and Config.GetType to just Type

Signed-off-by: Scott Rigby <[email protected]>

Move Invoke to Plugin (and for now invoke-like commands, until we merge them). Remove old PrepareCommand properly (handle ignoreFlags). As of now clients are expected to account for the ignore flag. Un-export Runtime methods

Signed-off-by: Scott Rigby <[email protected]>

Change LoadDir to switch. Deliberately not adding conversion function

Signed-off-by: Scott Rigby <[email protected]>

Fix Load all return and error

Signed-off-by: Scott Rigby <[email protected]>

Fix some semantics. Avoid yaml package name conflict

Signed-off-by: Scott Rigby <[email protected]>

Change reflect.DeepEqual to assert.Equal for Plugin.Metadata

Signed-off-by: Scott Rigby <[email protected]>

Add more robust plugin find criteria with findFunc and filterFunc pattern

Co-authored-by: George Jenkins <[email protected]>

Signed-off-by: Scott Rigby <[email protected]>

Integrate PR #7 into old interfaces

Signed-off-by: Scott Rigby <[email protected]>

Finish integrating #7 into orig interfaces. Tests all pass ✅

Signed-off-by: Scott Rigby <[email protected]>

Integrate draft PR Convert post-renderer to invoke #9

Signed-off-by: Scott Rigby <[email protected]>

revert back to postrenderER (for the record I dislike this, but agree it's consistent)

Signed-off-by: Scott Rigby <[email protected]>

Change some naming

Signed-off-by: Scott Rigby <[email protected]>

Fix make test-style (goimports/golangci-lint) errors

Signed-off-by: Scott Rigby <[email protected]>

OCI installer for plugins

Signed-off-by: Scott Rigby <[email protected]>

Simplify. We only want to support tarballs. This is the only reliable way to preserve file mode for executables

Signed-off-by: Scott Rigby <[email protected]>

Update pkg/getter/ocigetter to work for both charts and plugins, and update plugin OCI installer accordingly

Signed-off-by: Scott Rigby <[email protected]>

Plugin runtime support (#15)

Fix linting issues (#18)

Extism/v1 plugin runtime support (#17)

Fix legacy metadata downloader convert

lint

Move pkg/plugins -> internal/plugin (#16)
gjenkins8 pushed a commit that referenced this pull request Aug 16, 2025
…mand type flag

Signed-off-by: Scott Rigby <[email protected]>

TODO for execRender

Signed-off-by: Scott Rigby <[email protected]>

Replace --post-renderer arbitrary binary execution with plugin of type postrender

Signed-off-by: Scott Rigby <[email protected]>

Note this old todo for moving postrenderer to plugin system is now complete:

	// NOTE(thomastaylor312): I am leaving this code commented out here. During
	// the implementation of post-render, it was brought up that if we are
	// relying on plugins, we should actually use the plugin system so it can
	// properly handle multiple OSs. This will be a feature add in the future,
	// so I left this code for reference. It can be deleted or reused once the
	// feature is implemented

Signed-off-by: Scott Rigby <[email protected]>

Move postrenderer package to plugins. combine and fix tests

Signed-off-by: Scott Rigby <[email protected]>

Fix references to pkg/plugin

Signed-off-by: Scott Rigby <[email protected]>

Fix TestPostRendererFlagSetOnce test

Signed-off-by: Scott Rigby <[email protected]>

Fix TestLoadPluginsForCompletion

Signed-off-by: Scott Rigby <[email protected]>

Fix TestLoadPlugins

Signed-off-by: Scott Rigby <[email protected]>

Fix linting

Signed-off-by: Scott Rigby <[email protected]>

List and use legacy plugins using the same Plugin struct and removing unmarshall strict

Signed-off-by: Scott Rigby <[email protected]>

Add Plugin interface in front of PluginLegacy and Pluginv1

Signed-off-by: Scott Rigby <[email protected]>

Disambiguate API version legacy from type. There is no more legacy type (legacy plugins are either cli or download)

Signed-off-by: Scott Rigby <[email protected]>

Validate PluginV1

Signed-off-by: Scott Rigby <[email protected]>

Add apiVersion to test data

fix nil pointer dereference for tests

Signed-off-by: Scott Rigby <[email protected]>

TODO for testing

Signed-off-by: Scott Rigby <[email protected]>

Comments and TODOs

Signed-off-by: Scott Rigby <[email protected]>

Try Plugin Config interface and Config implementations per plugin type

Signed-off-by: Scott Rigby <[email protected]>

Add Runtime and RuntimeConfig interfaces, and implement per runtime (subprocess and Wasm). Move fields to the applicable config structs. TODO update tests and testdata YAML to match

Signed-off-by: Scott Rigby <[email protected]>

Attempt to reorganize fields to make sense on new structs, YAML to match, and update tests to match

Signed-off-by: Scott Rigby <[email protected]>

pkg/plugin tests pass

Signed-off-by: Scott Rigby <[email protected]>

Fix TestLoadPlugins. All tests pass now

Signed-off-by: Scott Rigby <[email protected]>

Do not attept to unmarshall into PluginLegacy if apiVersion is present but with the wrong value. Give better error instead

Signed-off-by: Scott Rigby <[email protected]>

Remove legacy field fallback for PluginV1. Users should update their plugin.yaml fully if they set apiVersion to v1

Signed-off-by: Scott Rigby <[email protected]>

Reorganize code into separate files for better readability

Signed-off-by: Scott Rigby <[email protected]>

fix runHook

Signed-off-by: Scott Rigby <[email protected]>

Add plugin sourceURL

Signed-off-by: Scott Rigby <[email protected]>

Change CLI plugin config to match cobra options

Signed-off-by: Scott Rigby <[email protected]>

Fix tests after updating shortHelp, longHelp and usage fields

Signed-off-by: Scott Rigby <[email protected]>

add missing newlines at EOF

Signed-off-by: Scott Rigby <[email protected]>

Unsuccessful attempt at consolidating all subprocess funcs into Runtime.Invoke. Tests pass but functionality doesn't work. Keeping for reference to ideas but will revert in next commit

Signed-off-by: Scott Rigby <[email protected]>

Revert "Unsuccessful attempt at consolidating all subprocess funcs into Runtime.Invoke. Tests pass but functionality doesn't work. Keeping for reference to ideas but will revert in next commit"

This reverts commit 842b1b3.

Fix regression from a3bc64a that prevented legacy CLI plugins from loading

Signed-off-by: Scott Rigby <[email protected]>

move all direct os/exec calls from any code outside pkg/plugin

Signed-off-by: Scott Rigby <[email protected]>

change all calls to exec funcs in pkg/plugin/exec.go to now use new invoke methods

Signed-off-by: Scott Rigby <[email protected]>

move runtime-specific code from runtime.go into separate files for better organization

Signed-off-by: Scott Rigby <[email protected]>

Fix gofmt

Signed-off-by: Scott Rigby <[email protected]>

Update TODOs and comments

Signed-off-by: Scott Rigby <[email protected]>

More TODOs

Signed-off-by: Scott Rigby <[email protected]>

execHook is only used within the package. don't export. consolidate with other funcs later

Signed-off-by: Scott Rigby <[email protected]>

Refactor the Postrenderer interface to use a runtime-agnostic factory pattern

Signed-off-by: Scott Rigby <[email protected]>

Add new Runtime.Postrender method to better organize runtime-specific logic for postrender type plugins

Signed-off-by: Scott Rigby <[email protected]>

Consolidate remaining exec functions into runtime_subprocess.go. Keep chipping away at them

Signed-off-by: Scott Rigby <[email protected]>

rename ExecError to plugin.Error. it's not only for exec

Signed-off-by: Scott Rigby <[email protected]>

Simplify to use just Runtime.Invoke

Signed-off-by: Scott Rigby <[email protected]>

move execHook into RuntimeSubprocess.InvokeHook

Signed-off-by: Scott Rigby <[email protected]>

Remove unused Plugin.GetRuntime

Signed-off-by: Scott Rigby <[email protected]>

Rename Plugin.GetMetadata method to Metadata

Signed-off-by: Scott Rigby <[email protected]>

Create Metadata interface. Move GetConfig, GetRuntimeConfig, GetAPIVersion, GetName, and GetType methods from Plugin to Metadata interface

Signed-off-by: Scott Rigby <[email protected]>

Shorten Plugin.GetRuntimeInstance to Plugin.Runtime

Signed-off-by: Scott Rigby <[email protected]>

Shorten RuntimeConfig.GetRuntimeType and Config.GetType to just Type

Signed-off-by: Scott Rigby <[email protected]>

Move Invoke to Plugin (and for now invoke-like commands, until we merge them). Remove old PrepareCommand properly (handle ignoreFlags). As of now clients are expected to account for the ignore flag. Un-export Runtime methods

Signed-off-by: Scott Rigby <[email protected]>

Change LoadDir to switch. Deliberately not adding conversion function

Signed-off-by: Scott Rigby <[email protected]>

Fix Load all return and error

Signed-off-by: Scott Rigby <[email protected]>

Fix some semantics. Avoid yaml package name conflict

Signed-off-by: Scott Rigby <[email protected]>

Change reflect.DeepEqual to assert.Equal for Plugin.Metadata

Signed-off-by: Scott Rigby <[email protected]>

Add more robust plugin find criteria with findFunc and filterFunc pattern

Co-authored-by: George Jenkins <[email protected]>

Signed-off-by: Scott Rigby <[email protected]>

Integrate PR #7 into old interfaces

Signed-off-by: Scott Rigby <[email protected]>

Finish integrating #7 into orig interfaces. Tests all pass ✅

Signed-off-by: Scott Rigby <[email protected]>

Integrate draft PR Convert post-renderer to invoke #9

Signed-off-by: Scott Rigby <[email protected]>

revert back to postrenderER (for the record I dislike this, but agree it's consistent)

Signed-off-by: Scott Rigby <[email protected]>

Change some naming

Signed-off-by: Scott Rigby <[email protected]>

Fix make test-style (goimports/golangci-lint) errors

Signed-off-by: Scott Rigby <[email protected]>

OCI installer for plugins

Signed-off-by: Scott Rigby <[email protected]>

Simplify. We only want to support tarballs. This is the only reliable way to preserve file mode for executables

Signed-off-by: Scott Rigby <[email protected]>

Update pkg/getter/ocigetter to work for both charts and plugins, and update plugin OCI installer accordingly

Signed-off-by: Scott Rigby <[email protected]>

Plugin runtime support (#15)

Fix linting issues (#18)

Extism/v1 plugin runtime support (#17)

Fix legacy metadata downloader convert

lint

Move pkg/plugins -> internal/plugin (#16)
gjenkins8 pushed a commit that referenced this pull request Aug 16, 2025
…mand type flag

Signed-off-by: Scott Rigby <[email protected]>

TODO for execRender

Signed-off-by: Scott Rigby <[email protected]>

Replace --post-renderer arbitrary binary execution with plugin of type postrender

Signed-off-by: Scott Rigby <[email protected]>

Note this old todo for moving postrenderer to plugin system is now complete:

	// NOTE(thomastaylor312): I am leaving this code commented out here. During
	// the implementation of post-render, it was brought up that if we are
	// relying on plugins, we should actually use the plugin system so it can
	// properly handle multiple OSs. This will be a feature add in the future,
	// so I left this code for reference. It can be deleted or reused once the
	// feature is implemented

Signed-off-by: Scott Rigby <[email protected]>

Move postrenderer package to plugins. combine and fix tests

Signed-off-by: Scott Rigby <[email protected]>

Fix references to pkg/plugin

Signed-off-by: Scott Rigby <[email protected]>

Fix TestPostRendererFlagSetOnce test

Signed-off-by: Scott Rigby <[email protected]>

Fix TestLoadPluginsForCompletion

Signed-off-by: Scott Rigby <[email protected]>

Fix TestLoadPlugins

Signed-off-by: Scott Rigby <[email protected]>

Fix linting

Signed-off-by: Scott Rigby <[email protected]>

List and use legacy plugins using the same Plugin struct and removing unmarshall strict

Signed-off-by: Scott Rigby <[email protected]>

Add Plugin interface in front of PluginLegacy and Pluginv1

Signed-off-by: Scott Rigby <[email protected]>

Disambiguate API version legacy from type. There is no more legacy type (legacy plugins are either cli or download)

Signed-off-by: Scott Rigby <[email protected]>

Validate PluginV1

Signed-off-by: Scott Rigby <[email protected]>

Add apiVersion to test data

fix nil pointer dereference for tests

Signed-off-by: Scott Rigby <[email protected]>

TODO for testing

Signed-off-by: Scott Rigby <[email protected]>

Comments and TODOs

Signed-off-by: Scott Rigby <[email protected]>

Try Plugin Config interface and Config implementations per plugin type

Signed-off-by: Scott Rigby <[email protected]>

Add Runtime and RuntimeConfig interfaces, and implement per runtime (subprocess and Wasm). Move fields to the applicable config structs. TODO update tests and testdata YAML to match

Signed-off-by: Scott Rigby <[email protected]>

Attempt to reorganize fields to make sense on new structs, YAML to match, and update tests to match

Signed-off-by: Scott Rigby <[email protected]>

pkg/plugin tests pass

Signed-off-by: Scott Rigby <[email protected]>

Fix TestLoadPlugins. All tests pass now

Signed-off-by: Scott Rigby <[email protected]>

Do not attept to unmarshall into PluginLegacy if apiVersion is present but with the wrong value. Give better error instead

Signed-off-by: Scott Rigby <[email protected]>

Remove legacy field fallback for PluginV1. Users should update their plugin.yaml fully if they set apiVersion to v1

Signed-off-by: Scott Rigby <[email protected]>

Reorganize code into separate files for better readability

Signed-off-by: Scott Rigby <[email protected]>

fix runHook

Signed-off-by: Scott Rigby <[email protected]>

Add plugin sourceURL

Signed-off-by: Scott Rigby <[email protected]>

Change CLI plugin config to match cobra options

Signed-off-by: Scott Rigby <[email protected]>

Fix tests after updating shortHelp, longHelp and usage fields

Signed-off-by: Scott Rigby <[email protected]>

add missing newlines at EOF

Signed-off-by: Scott Rigby <[email protected]>

Unsuccessful attempt at consolidating all subprocess funcs into Runtime.Invoke. Tests pass but functionality doesn't work. Keeping for reference to ideas but will revert in next commit

Signed-off-by: Scott Rigby <[email protected]>

Revert "Unsuccessful attempt at consolidating all subprocess funcs into Runtime.Invoke. Tests pass but functionality doesn't work. Keeping for reference to ideas but will revert in next commit"

This reverts commit 842b1b3.

Fix regression from a3bc64a that prevented legacy CLI plugins from loading

Signed-off-by: Scott Rigby <[email protected]>

move all direct os/exec calls from any code outside pkg/plugin

Signed-off-by: Scott Rigby <[email protected]>

change all calls to exec funcs in pkg/plugin/exec.go to now use new invoke methods

Signed-off-by: Scott Rigby <[email protected]>

move runtime-specific code from runtime.go into separate files for better organization

Signed-off-by: Scott Rigby <[email protected]>

Fix gofmt

Signed-off-by: Scott Rigby <[email protected]>

Update TODOs and comments

Signed-off-by: Scott Rigby <[email protected]>

More TODOs

Signed-off-by: Scott Rigby <[email protected]>

execHook is only used within the package. don't export. consolidate with other funcs later

Signed-off-by: Scott Rigby <[email protected]>

Refactor the Postrenderer interface to use a runtime-agnostic factory pattern

Signed-off-by: Scott Rigby <[email protected]>

Add new Runtime.Postrender method to better organize runtime-specific logic for postrender type plugins

Signed-off-by: Scott Rigby <[email protected]>

Consolidate remaining exec functions into runtime_subprocess.go. Keep chipping away at them

Signed-off-by: Scott Rigby <[email protected]>

rename ExecError to plugin.Error. it's not only for exec

Signed-off-by: Scott Rigby <[email protected]>

Simplify to use just Runtime.Invoke

Signed-off-by: Scott Rigby <[email protected]>

move execHook into RuntimeSubprocess.InvokeHook

Signed-off-by: Scott Rigby <[email protected]>

Remove unused Plugin.GetRuntime

Signed-off-by: Scott Rigby <[email protected]>

Rename Plugin.GetMetadata method to Metadata

Signed-off-by: Scott Rigby <[email protected]>

Create Metadata interface. Move GetConfig, GetRuntimeConfig, GetAPIVersion, GetName, and GetType methods from Plugin to Metadata interface

Signed-off-by: Scott Rigby <[email protected]>

Shorten Plugin.GetRuntimeInstance to Plugin.Runtime

Signed-off-by: Scott Rigby <[email protected]>

Shorten RuntimeConfig.GetRuntimeType and Config.GetType to just Type

Signed-off-by: Scott Rigby <[email protected]>

Move Invoke to Plugin (and for now invoke-like commands, until we merge them). Remove old PrepareCommand properly (handle ignoreFlags). As of now clients are expected to account for the ignore flag. Un-export Runtime methods

Signed-off-by: Scott Rigby <[email protected]>

Change LoadDir to switch. Deliberately not adding conversion function

Signed-off-by: Scott Rigby <[email protected]>

Fix Load all return and error

Signed-off-by: Scott Rigby <[email protected]>

Fix some semantics. Avoid yaml package name conflict

Signed-off-by: Scott Rigby <[email protected]>

Change reflect.DeepEqual to assert.Equal for Plugin.Metadata

Signed-off-by: Scott Rigby <[email protected]>

Add more robust plugin find criteria with findFunc and filterFunc pattern

Co-authored-by: George Jenkins <[email protected]>

Signed-off-by: Scott Rigby <[email protected]>

Integrate PR #7 into old interfaces

Signed-off-by: Scott Rigby <[email protected]>

Finish integrating #7 into orig interfaces. Tests all pass ✅

Signed-off-by: Scott Rigby <[email protected]>

Integrate draft PR Convert post-renderer to invoke #9

Signed-off-by: Scott Rigby <[email protected]>

revert back to postrenderER (for the record I dislike this, but agree it's consistent)

Signed-off-by: Scott Rigby <[email protected]>

Change some naming

Signed-off-by: Scott Rigby <[email protected]>

Fix make test-style (goimports/golangci-lint) errors

Signed-off-by: Scott Rigby <[email protected]>

OCI installer for plugins

Signed-off-by: Scott Rigby <[email protected]>

Simplify. We only want to support tarballs. This is the only reliable way to preserve file mode for executables

Signed-off-by: Scott Rigby <[email protected]>

Update pkg/getter/ocigetter to work for both charts and plugins, and update plugin OCI installer accordingly

Signed-off-by: Scott Rigby <[email protected]>

Plugin runtime support (#15)

Fix linting issues (#18)

Extism/v1 plugin runtime support (#17)

Fix legacy metadata downloader convert

lint

Move pkg/plugins -> internal/plugin (#16)
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