Skip to content

fix(cli): make the IPAM CLI plugin installable via datumctl#67

Merged
scotwells merged 1 commit into
mainfrom
fix/plugin-manifest-min-api-version
Jul 1, 2026
Merged

fix(cli): make the IPAM CLI plugin installable via datumctl#67
scotwells merged 1 commit into
mainfrom
fix/plugin-manifest-min-api-version

Conversation

@scotwells

@scotwells scotwells commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Impact

Installing the IPAM CLI plugin fails for everyone today:

$ datumctl plugin install milo-os/ipam
error: install plugin milo-os/ipam: read plugin manifest: parse plugin manifest:
json: cannot unmarshal string into Go struct field PluginManifest.min_api_version of type int

Until this is fixed, no one can add datumctl ipam to their CLI — pools and prefixes can't be managed from the command line at all.

Cause

During install, datumctl reads a small manifest the plugin reports about itself. One field, min_api_version, was being sent as text when datumctl expects a number, so the install aborts before the plugin is ever added.

Fix

The plugin now produces its manifest from datumctl's official plugin SDK instead of a hand-maintained copy. The format matches what datumctl expects, and — because it's generated from the shared definition — it can't quietly drift out of sync again.

After this change, datumctl plugin install milo-os/ipam succeeds and datumctl ipam is available.

Shipping

The fix reaches users through a published build, so a patch release should follow merge. No change to the plugin catalog is required.

Related work

`datumctl plugin install milo-os/ipam` failed with:

    parse plugin manifest: json: cannot unmarshal string into Go struct
    field PluginManifest.min_api_version of type int

The milo-ipam binary hand-rolled its own copy of datumctl's plugin
manifest struct and declared `min_api_version` as a string holding the
Kubernetes API group/version ("ipam.miloapis.com/v1alpha1"). datumctl's
contract defines `min_api_version` as an integer plugin-contract version,
so unmarshalling the emitted manifest failed and the plugin could not be
installed.

Adopt datumctl's plugin SDK instead of duplicating the contract:

- Build `plugin.Manifest` and serve it via `plugin.ServeManifest` in
  main(), so the datumctl <-> plugin manifest contract is enforced by the
  compiler and cannot drift. (The SDK is already a dependency, used by
  transport.go and entitlement.go.)
- `min_api_version` is now the integer contract version (1); the IPAM API
  group/version stays as a human-facing string shown by `version`.
- Drop the redundant `--plugin-manifest` cobra flag; the SDK intercepts
  it before cobra runs.

Requires a patch release for the fix to reach `datumctl plugin install`,
which pulls the published binary.
@scotwells scotwells marked this pull request as ready for review July 1, 2026 21:29
@scotwells scotwells enabled auto-merge July 1, 2026 21:30
@scotwells scotwells changed the title fix(cli): emit plugin manifest via datumctl SDK so install succeeds fix(cli): make the IPAM CLI plugin installable via datumctl Jul 1, 2026
@scotwells scotwells marked this pull request as draft July 1, 2026 21:30
auto-merge was automatically disabled July 1, 2026 21:30

Pull request was converted to draft

@scotwells scotwells marked this pull request as ready for review July 1, 2026 21:44
@scotwells scotwells merged commit 5a2a9e3 into main Jul 1, 2026
12 checks passed
@scotwells scotwells deleted the fix/plugin-manifest-min-api-version branch July 1, 2026 22:18
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.

2 participants