Skip to content

Commit 22fe880

Browse files
committed
Add support for direct binary URLs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
1 parent cf95179 commit 22fe880

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

rfcs/xxxx-cli-plugin-system/README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ The `flux-<name>` binary maps to the `flux <name>` command. For example,
5959
`flux-operator` becomes `flux operator`.
6060

6161
The default plugin directory is `~/.fluxcd/plugins/`. Users can override it with the
62-
`$FLUXCD_PLUGINS` environment variable. Only this single directory is scanned.
62+
`FLUXCD_PLUGINS` environment variable. Only this single directory is scanned.
6363

6464
When a plugin is discovered, it appears under a "Plugin Commands:" group in `flux --help`:
6565

@@ -118,6 +118,19 @@ versions:
118118
checksum: sha256:9712026094a5...
119119
```
120120
121+
The plugin manifest includes metadata (name, description, homepage, source repo), the binary name
122+
(`bin`), and a list of versions with platform-specific download URLs and checksums.
123+
124+
The download URLs can point to one of the following formats:
125+
126+
- An archive containing the binary (`tar`, `tar.gz` or `zip`), with the binary at the root of the archive. The binary name inside the archive must match the `bin` field in the manifest.
127+
- A direct binary URL. The binary is downloaded and saved without extraction. The `bin` field is used for naming the installed plugin, not for discovery in this case.
128+
- Note that when the OS is Windows, the binary name is composed by appending `.exe` to the `bin` field (e.g., `flux-operator.exe`).
129+
130+
The Flux Operator CLI detects if the URL points to an archive by checking the file extension.
131+
If no extension is present, it checks the content type by probing for archive magic bytes after downloading the file.
132+
If the content is not an archive, it treats it as a direct binary URL.
133+
121134
A generated `catalog.yaml` (`PluginCatalog` kind) contains static metadata for all
122135
plugins, enabling `flux plugin search` with a single HTTP fetch.
123136

@@ -265,7 +278,7 @@ directly without filesystem fixtures.
265278
266279
- **Default**: `~/.fluxcd/plugins/` -- auto-created by install/update commands
267280
(best-effort, no error if filesystem is read-only).
268-
- **Override**: `$FLUXCD_PLUGINS` env var replaces the default directory path.
281+
- **Override**: `FLUXCD_PLUGINS` env var replaces the default directory path.
269282
When set, the CLI does not auto-create the directory.
270283
271284
### Startup Behavior

0 commit comments

Comments
 (0)