Publish the avd.netclab.dev API as its own Configuration package - #17
Merged
Conversation
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>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A Function package cannot carry XRDs or Compositions.
crossplane xpkg buildrejects both withobject 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/withapis/crossplane.yamlas its metadata, depending on the function.Nothing moves out of this repo.
kind-up.shand 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
Functionrenamed tonetclab-function-avd. That is what Crossplane calls a dependency-installed function (<org>-<name>from the package path — observed asnetclab-function-eapiandcrossplane-contrib-function-go-templatingon a live cluster). The compositions andkind-up.shfollow 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 underapis/the Configuration build fails outright withno kind "Function" is registered for version "pkg.crossplane.io/v1". Out of the package root, the build needs no--ignore, so a future directory underapis/cannot silently fall out of the package.CI and release. CI builds the Configuration on every PR —
xpkg buildis 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 anxpkg-*artifact: the existing publish job globs those into one multi-platform index, and this package must not join it.Verified locally
Note for the repo owner
ruleset-01requiresoffline suite+runtime image. The newconfiguration packagejob 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