Description
The wash plugin test command currently supports loading plugins from local filesystem paths (files or directories) but does not support OCI (Open Container Initiative) references. Adding OCI support would allow testing plugins directly from container registries.
Location
crates/wash/src/cli/plugin.rs:401 in the TestCommand::handle method
Current Behavior
The plugin test command loads WebAssembly components in two ways:
- Directory: Builds the component from source and reads the built artifact
- File: Reads the component directly from a local file path
let wasm = if self.plugin.is_dir() {
// Build and read from directory
tokio::fs::read(&built_path.artifact_path)
.await
.context("Failed to read built component file")?
} else {
tokio::fs::read(&self.plugin)
.await
.context("Failed to read component file")?
// TODO(GFI): support OCI references too
};
Proposed Solution
Add support for OCI references by:
- Detecting OCI references: Check if the
plugin parameter is an OCI reference (starts with registry URL pattern)
- Fetching from registry: Use OCI client to download the component from the registry
- Caching: Consider caching downloaded components locally
Example Usage
After implementation, users should be able to run:
wash plugin test ghcr.io/wasmcloud/plugin-example:latest --hook pre_invoke
Context
This enhancement would improve the plugin development workflow by allowing developers to test plugins distributed via container registries without needing to download them manually first.
Description
The
wash plugin testcommand currently supports loading plugins from local filesystem paths (files or directories) but does not support OCI (Open Container Initiative) references. Adding OCI support would allow testing plugins directly from container registries.Location
crates/wash/src/cli/plugin.rs:401in theTestCommand::handlemethodCurrent Behavior
The plugin test command loads WebAssembly components in two ways:
Proposed Solution
Add support for OCI references by:
pluginparameter is an OCI reference (starts with registry URL pattern)Example Usage
After implementation, users should be able to run:
wash plugin test ghcr.io/wasmcloud/plugin-example:latest --hook pre_invokeContext
This enhancement would improve the plugin development workflow by allowing developers to test plugins distributed via container registries without needing to download them manually first.