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

Feature: Add plugin system - plugin execution #1040

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

FedericoAntoniazzi
Copy link

What

Add plugin system in k3d. This allows expanding k3d functionalities by loading third party scripts/programs.

Why

This feature has been requested in #304 and backed by a discussion (#741)

Implications

This feature extends k3d command by dynamically adding subcommands loaded from plugins located in .k3d/plugins.

@FedericoAntoniazzi FedericoAntoniazzi marked this pull request as draft March 30, 2022 22:04
@FedericoAntoniazzi FedericoAntoniazzi force-pushed the feature/plugins branch 2 times, most recently from c475444 to 392e138 Compare March 30, 2022 22:10
Add a new command `k3d plugin list` that lists plugins inside a folder,
by default it is `$HOME/.k3d/plugins`.

Every folder inside the plugins directory is considered a plugin and it
must contain a manifest named `k3d-plugin.yaml`. This file describes a
plugin, so it must have a name, a version, a description and an help
message.

Here's an example of a plugin manifest:
```yaml
    ---
    name: env
    version: "0.0.1"
    shortHelpMessage: "Print k3d env variables"
    helpMessage: "Print k3d env variables"
    command: <command to list env variables>
```
Load plugins as k3d subcommands and execute the one specified.
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.

None yet

1 participant