Skip to content

Publish the avd.netclab.dev API as its own Configuration package - #17

Merged
mbakalarski merged 1 commit into
mainfrom
configuration-avd
Jul 30, 2026
Merged

Publish the avd.netclab.dev API as its own Configuration package#17
mbakalarski merged 1 commit into
mainfrom
configuration-avd

Conversation

@mbakalarski

Copy link
Copy Markdown
Member

A Function package cannot carry XRDs or Compositions. crossplane xpkg build rejects both with object is not a CRD — a Function package takes only the CRDs describing its input, and this function has none, because the XRs are its API.

So the API this function serves was publishable from nowhere: not from here, and not from a consumer without copying it. It is now a second package, built from apis/ with apis/crossplane.yaml as its metadata, depending on the function.

Nothing moves out of this repo. kind-up.sh and both e2e suites keep exercising the real API rather than a fixture — which is the whole reason the API stays where the lab is.

Supporting changes

Function renamed to netclab-function-avd. That is what Crossplane calls a dependency-installed function (<org>-<name> from the package path — observed as netclab-function-eapi and crossplane-contrib-function-go-templating on a live cluster). The compositions and kind-up.sh follow it, so the dev cluster now uses the same name a real install does. Previously the e2e suite exercised a name no consumer would ever have.

apis/function/dev/. Those are dev-only manifests, not API, and with them under apis/ the Configuration build fails outright with no kind "Function" is registered for version "pkg.crossplane.io/v1". Out of the package root, the build needs no --ignore, so a future directory under apis/ cannot silently fall out of the package.

CI and release. CI builds the Configuration on every PR — xpkg build is not a lint, it parses every manifest, so a green build is a real statement about both XRDs, both Compositions and all six examples. The release publishes it to GHCR and Upbound under the same version as the function. It is deliberately not an xpkg-* artifact: the existing publish job globs those into one multi-platform index, and this package must not join it.

Verified locally

  • configuration package builds (14848 B), function package still builds (13824 B)
  • 31 offline tests pass
  • the render manifest and both compositions agree on the new function name

Note for the repo owner

ruleset-01 requires offline suite + runtime image. The new configuration package job runs but is not required — worth adding to the ruleset, since it is the only thing that would catch a broken XRD or Composition before a tag.

🤖 Generated with Claude Code

A Function package cannot carry XRDs or Compositions. `xpkg build`
rejects both with "object is not a CRD" -- a Function package takes only
the CRDs describing its input, and this function has none, because the
XRs are its API. So the API this function serves was publishable from
nowhere: not from here, and not from a consumer without copying it.

It is now a second package, built from `apis/` with `apis/crossplane.yaml`
as its metadata and depending on the function. Nothing moves out of this
repo, so `kind-up.sh` and both e2e suites keep exercising the real API
rather than a fixture -- which is the whole reason the API stays where the
lab is.

Three supporting changes:

- The `Function` object is renamed to `netclab-function-avd`, because
  that is what Crossplane calls a dependency-installed function
  (`<org>-<name>`). The compositions and kind-up.sh follow it, so the dev
  cluster now uses the same name a real install does -- previously the
  e2e suite exercised a name no consumer would ever have.
- The dev-only Function manifests move from `apis/function/` to `dev/`.
  They are not API, and with them under `apis/` the Configuration build
  fails outright ("no kind Function is registered"). Out of the package
  root, the build needs no --ignore, so a future directory under `apis/`
  cannot silently fall out of the package.
- CI builds the Configuration on every PR, and the release publishes it
  to GHCR and Upbound under the same version as the function. It is
  deliberately not an `xpkg-*` artifact: the publish job globs those into
  one multi-platform index, and this package must not join it.

Verified: both packages build, 31 offline tests pass, and the render
manifest and compositions agree on the new function name.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mbakalarski
mbakalarski merged commit 5a2eef0 into main Jul 30, 2026
4 checks passed
@mbakalarski
mbakalarski deleted the configuration-avd branch July 30, 2026 14:44
@mbakalarski mbakalarski mentioned this pull request Jul 30, 2026
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