12 Commits
Author SHA1 Message Date
Ron Compos 4b7866bde7 fix(e2e): get amd64 tenant nodes to join on the site lane (#1358)
* fix(agent): report which cloud-init stage failed, not just that it did

`cloud-init status` prints one word. When a node fails it, the preflight
check reports "status: error" and the reason stays on the node.

Run 37745107586 is what that costs. A tenant node failed cloud-init two
minutes after the cluster was created; the check reported the same four
words 44 times over the next 90 minutes until the suite's provision wait
expired, and the node was released on teardown before anyone could log
in. The run produced 97KB of diagnostics and not one byte saying what
cloud-init had failed to do. The node was reachable throughout -- all 44
checks got a reply -- so the answer was sitting on a healthy machine the
whole time, unasked for.

`--long` adds the failing stage and its message after the status line.
evaluateCloudInitStatus matches on substrings, so the longer report
parses exactly as before and the extra lines ride along into the error
the controller logs.

Signed-off-by: Ron Compos <rcompos@nvidia.com>

* fix(e2e): export the deploy assets the way the ref under test lays them out

The lane exports its deploy assets from the release tag being qualified,
but asked every tag for a top-level deploy/ that #1291 created on 8
October. Run 37830345659 died on `git archive controller/v0.1.1: fatal:
pathspec 'deploy' did not match any files`, so no existing controller
release could be qualified on main, and no dispatch input worked around
it: the ref is a config field with no workflow input.

Replace the one hardcoded asset list and executor with a Layout, holding
the four things that moved together -- the directories to export, the
executor's name, the customer deploy path, and the flag spelling that
executor takes. Two so far: deploy/nke-deploy.sh with --deploy-path from
#1291 onwards, and build/use-nke-sbom.sh with --sbom/--target on every
tag before it. What is inside a deploy path did not move, so both read
controller/release.yaml from the same place within it.

ResolveLayout probes for each executor rather than reading the version,
because the move is a property of the tree and a version string only
correlates with it: a backport, a branch or a hand-cut tag can carry
either shape. A ref older than both layouts now says which executors
were looked for and that a layout is owed, rather than failing in git
plumbing.

Signed-off-by: Ron Compos <rcompos@nvidia.com>

* fix(e2e): take the controller's name from the deploy path that installs it

The deploy path decides the name the controller is installed under, and a
configured name is a second place to say the same thing. Nothing kept the
two in step: the suite default tracks main, the lane's job is qualifying
release tags, and since #1271 the default is nke-controller while every
tag cut before the rename installs cloud-workflow-engine. Run 37828716287
stopped before provisioning for exactly that reason, with neither
CWE_NAMESPACE nor CWE_SERVICE set in the repository.

Read the name out of the exported deploy path and point the suite at it.
An explicitly configured name still wins and still has to agree, which is
what the old check was worth -- someone who pins one has a reason, and a
wrong one costs an hour on a machine. What it no longer does is fail on a
name nobody chose.

The environment carries it rather than a package variable because that is
how the value already reaches subprocesses. It has to be set before
anything reads controller.Namespace(); nothing reads it at init and the
suite is serial, so newStack in BeforeAll is that point, and the doc
comment says so.

Also correct the workflow's own account of this. Its comment said an
empty cwe-name leaves the suite on "the older name", which stopped being
true at #1271 and is what makes leaving the field blank look safe.

Signed-off-by: Ron Compos <rcompos@nvidia.com>

* refactor(e2e): address review of the layout and controller-name fixes

Three things a reader would stop on.

ResolveLayout now runs ahead of ExportRef, which is where the "does this
ref exist" check lives, so a version with a typo in it reported that the
executor had moved and a layout was owed -- sending the reader to add an
entry for a ref that does not exist. Check the ref resolves first.

Stack.DeployPath was set by no caller and had become a second spelling of
Layout.DeployPath, and TargetArgs took the path as an argument purely to
support overriding it. Drop both, and the test that asserted the override,
which defended a capability nothing uses.

TestLayoutsMatchTheReleaseTags is the only test that checks the layout
table against the tags the lane exports from, and it skipped in CI
forever: the unit-test job checks out shallow with no tags, so it found
none and quietly passed. Fetch tags there, and tell a tag that is absent
from the clone apart from one that genuinely carries no executor, so the
test is honest in both places.

Signed-off-by: Ron Compos <rcompos@nvidia.com>

* fix(e2e): decode node labels from controllers either side of #1306

#1306 changed nodeLabels from a list of "key=value" strings to an object.
The suite's API client is generated from the checkout and the controller
it talks to is the release under qualification, so across that change the
two disagree and no single generated client is right for both.

NodePool declares nodeLabels required, so a controller older than #1306
sends "nodeLabels": [] on every node-pool list and the whole response
fails to decode -- including on the readiness path, which reads nothing
but pool names. That is what stopped run 37854934923 after the site
controller came up and the tenant cluster provisioned.

Reshape the field at the transport instead of the model: the generated
code stays generated, the controller is untouched, and the whole
accommodation is one file to delete once the oldest release the lane
qualifies carries #1306. Responses only -- nothing here sends labels, and
the field is omitempty everywhere it would be sent.

Also stop polling a disagreement. A node becomes ready with time; a
client and a controller that disagree about a schema never do. The
readiness spec retried that decode once a second for 45 minutes on a
held GB200 and then reported a timeout rather than the mismatch.

Signed-off-by: Ron Compos <rcompos@nvidia.com>

* fix(e2e): wait for a default route before tenant nodes download anything

Tenant pre-kubeadm commands opened with set -eu and then fetched the apt
key, with nothing waiting for the network. On a node whose default route
was not up yet the fetch failed at once, set -eu stopped the script, and
the node never installed what it needs to join. Run 37873467928 hit this
on an amd64 control plane, whose kernel line lacks the ip=dhcp the arm64
one carries; an arm64 worker running the same commands passed.

The site node already waited for a route in its own user data. Move that
bounded wait into the shared template, ahead of the first download, so
the site node and every tenant node get it from one place.

Signed-off-by: Ron Compos <rcompos@nvidia.com>

* fix(e2e): count node milestones as provisioning progress

WaitForClusterReady called a cluster stuck when its provisioning message
had not changed for the stall window. That message reads "Waiting for a
control plane node to be ready to join" for the whole of the control
plane's boot, which on bare metal can outlast the window while the node
is still advancing. Run 37882425829 stopped an amd64 control plane
sixteen minutes into a 45-minute budget, after it had gained an address
and a reachable agent and while its setup script was running.

Progress is now the cluster message plus each node's milestones: an
address, agent ready, ready to join, joined, provisioned and Kubernetes
ready. Statuses, not messages, since a node's provisioning message
changes on every retry and would hide a node retrying forever.

Signed-off-by: Ron Compos <rcompos@nvidia.com>

* fix(ci): keep a failed tenant's nodes when keep-site is set

-e2e.keep-site held only the site node. The tenant cleanup still
deleted a failed tenant's cluster, releasing the instances the site
was kept to inspect. When KEEP_SITE is true the generated e2e config
now also sets lifecycle.preserveOnFailure.

Signed-off-by: Ron Compos <rcompos@nvidia.com>

* fix(e2e): address review of the stall check, schema check and route wait

A failed node list skipped the stall check for that poll, so repeated
failures could hide a stall until the deadline. It now reuses the last
nodes seen, which neither hides a stall nor looks like progress when the
next list succeeds.

SchemaMismatch matched JSON syntax errors as well as type errors, so a
truncated response stopped the readiness poll instead of being retried.
Only a type error means the client and controller will never agree.

The site node's user data relied on its node commands opening with the
route wait. It waits on its own again; the second wait returns at once.

Signed-off-by: Ron Compos <rcompos@nvidia.com>

* fix(capd): answer cloud-init status --long in the container-node shim

The node agent now runs `cloud-init status --long`. The CAPD node
image's shim accepted only the bare form and exited 2 with a usage line,
which the agent treats as not done, so NodePreflight never passed on a
container node and the e2e clusters never provisioned.

The shim now accepts `status` and `status --long`, prints the status
line first, and with --long adds extended_status, boot_status_code and
detail lines. Anything else still exits 2. The shim test runs every
state through both forms and checks the rejections.

Signed-off-by: Ron Compos <rcompos@nvidia.com>

* fix(agent): decide cloud-init status from the status line alone

The check searched the whole report for "status: done" before
"status: error". With --long the report carries free-text detail and
error lines, so a failed node whose detail contained "status: done"
would have been reported ready. The state now comes from the first line
that starts with "status:"; the rest is reported, not evaluated.

The proto comment for check_cloud_init_status said the agent runs
`cloud-init status` and matches anywhere in the output. Updated and
regenerated; node_agent.pb.go changes in comments only.

Signed-off-by: Ron Compos <rcompos@nvidia.com>

* refactor(e2e): name deploy layouts plainly and export assets in one constructor

Rename Layout to DeployLayout, LayoutDeploy/LayoutBuild to
CurrentLayout/LegacyLayout, and sbomStyleTarget to legacyTargetFlags.

Add ExportDeployAssets, which resolves the layout, exports the ref and
adopts the controller name, returning one DeployAssets value and a
cleanup. Stack carries that value instead of Assets, AssetPaths and
Layout. It is still called from BeforeAll so a conflicting controller
name fails before any machine is taken.

Signed-off-by: Ron Compos <rcompos@nvidia.com>

* fix(ci): clear name-check and gitleaks on the site lane

name-check failed on the old deploy path names the site lane's layout
table has to carry, build/use-nke-sbom.sh and controller/deploy/nke-sbom,
because every controller release tag before #1291 ships them. Allowlist
the token with that reason, and reword the CurrentLayout comment so it no
longer names the old script.

gitleaks flagged the synthetic nats-io/nkeys module hash in the CLEAN
fixture of hack/test_name_check.py, which reaches this branch's scan
through the merge of main. Allow that one literal in that one file.

Signed-off-by: Ron Compos <rcompos@nvidia.com>

* fix(e2e): restore the controller name when the site lane cleans up

ExportDeployAssets adopts the qualified release's controller name into
NKE_CONTROLLER_NAMESPACE and NKE_CONTROLLER_SERVICE, and nothing put
them back, so in an unfiltered run every spec after the site container
read the qualified release's name instead of the suite's. Record both
before adopting and restore them, set or unset, in the cleanup that
already removes the export. The cleanup runs after the container's
AfterAll, so teardown diagnostics still see the adopted name.

Signed-off-by: Ron Compos <rcompos@nvidia.com>

* refactor(e2e): drop support for controller releases before v0.2.0-rc.1

The site lane qualifies the latest controller tag, which is now
controller/v0.2.0-rc.1, and nothing pins an older one. Remove what only
older releases needed:

- the second deploy layout, for tags that keep the executor under build/.
  A tag without deploy/nvke-deploy.sh now fails before any machine is
  taken, saying the lane qualifies v0.2.0-rc.1 and later.
- the node-label shim for controllers older than #1306, and the
  fail-fast on a response schema mismatch that only it needed.
- controller-name adoption and the cleanup that restored it. The check
  main had, CheckControllerName, comes back: it reads the name the
  release installs and fails early when the suite is not looking for it.

Signed-off-by: Ron Compos <rcompos@nvidia.com>

---------

Signed-off-by: Ron Compos <rcompos@nvidia.com>
2026-10-13 08:46:55 -06:00
John Griffith 7c7c02949e chore: Rename nke to nvnke for images segment of codebase https://github.com/dsx-ai-factory/nvke/issues/1498 (#1548)
* chore: Rename nke to nvnke for images segment of codebase #1498

This is a "brute force" grep/replace approach to the image related
occurences of the nke name.  The goal is basically just a s/nke/nvnke/g
for everything in the repo that is associated with os-images.

This replacement bleeds into some other components (controller and agent)
that includes references to os-image names.

Closes #1498

* Keep existing image names valid

* Chore: Fix/Add DCO

Signed-off-by: jgriffith <jgriffith@nvidia.com>

---------

Signed-off-by: jgriffith <jgriffith@nvidia.com>
2026-10-12 17:08:48 -06:00
Chao 6bc0e1c9e8 fix(agent): rename node agent package and contracts to nvke (#1565)
* fix(agent): rename node agent package and contracts to nvke

Signed-off-by: Chao Chen <chaoch@nvidia.com>
2026-10-12 14:14:32 -07:00
Davanum SrinivasandClaude Fable 5.1 6029bf16ab chore: say NVKE in the comments and display text that still said NKE (#1470)
* chore: say NVKE in the comments that still said NKE

The word NKE in comments becomes NVKE: Go comments through the token
scanner, so no string literal moves; proto doc comments, with the
generated *.pb.go files regenerated by `make -C agent protos`; and the
comment lines of YAML, shell, Make, Tilt, systemd, Packer, Nix and
template files. The provisioned provider's CRD description comes from a
doc comment, so `make -C cluster-api-provider-provisioned manifests` and
`make -C cli provider-manifest` regenerated the CRD and the CLI's
embedded copy of it.

Kept on purpose: the comment quoting the "NKE Agent Version:" line the
updater parses, and the comments about the NGC organisation that is
named NKE.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com>

* chore: say NVKE in the display text that still said NKE

User-facing text that carried the word NKE now says NVKE: nvkectl help
text; log, error and condition messages; Ginkgo suite and spec names;
deb and OCI package metadata; systemd unit descriptions; workflow step
names and input descriptions; Helm render failures; and the nine
Markdown lines the prose sweep (#1462) missed. The tests that assert
these strings move with them.

Kept on purpose, because something parses or persists them: the
"NKE Agent Version:" and "NKE Agent Updater Version:" lines the updater
reads; the "update NKE RBAC:" errors of the UpdateNKERBAC rpc; the 2025
migration text; the OIDC upstream CA's CN and OU, since re-issuing that
CA would break tenant trust; the nico-sim tenant "Forge-Tenant-NKE"; the
Keycloak lab realm; and the NGC organisation that is named NKE.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com>

---------

Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-10 18:28:35 -04:00
Aaron Patten 418ed5c55c chore(e2e): say controller, not CWE, in the e2e harness, CI and Tilt (#1394)
Signed-off-by: Aaron Patten <apatten@nvidia.com>
2026-10-09 09:44:03 -06:00
Alexander Greene 92a3039bae feat: default CNI to ovn-kubernetes (#1303)
* feat: default omitted CNI to ovn-kubernetes

Empty cniPlugin and cniName now select ovn-kubernetes, and local images, examples, and create scripts follow that default. calico remains an explicit override.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix: build OVN packages outside the gitignored bin directory

crane was installed into the package tree's bin directory, which a checkout sync can delete while the download is still running. Stage the tool in the build scratch directory and create its destination immediately before moving it.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix(agent): complete pod checksums on the userspace datapath

veth pods send partial checksums, and the netdev datapath forwarded them unfinished, so receivers dropped pod traffic to services and the node. Enable userspace TSO and restart ovs-vswitchd only when the setting changes.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix(tilt): label the local NICo cluster button inputs

The create dialog showed the defaults with no captions because text_input was called without label.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* feat(controller): ensure host vTPM proxy for nico-containers on Linux

Share ensure-vtpm-proxy.sh between Colima and bare Linux hosts, fail fast
from Tilt and nico-sim when /dev/vtpmx is missing, and document the one-time
host prep so remote Tilt targets do not hang waiting for kubeconfig secrets.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix: load the vTPM proxy on the kernel that runs Docker

Container nodes need /dev/vtpmx. Without it, swtpm never starts and nke-agent blocks while setting up SPIFFE, so provisioning looks stuck. Colima already loaded the module inside its VM, but a Linux host never did. One script now does that load, and make host-up runs it on either machine.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix(agent): keep an explicit OVN version when the plugin name is omitted

Kubeadm init with no plugin name defaults to OVN, but a version sent with that request was discarded and 1.4.0 was installed instead. The requested version is used, and 1.4.0 is applied only when none was given.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix(agent): retry userspace TSO after a failed ovs-vswitchd restart

ovs-vswitchd reads userspace-tso-enable only at startup. A failed restart left the setting enabled, so the next attempt treated it as already applied and never restarted the daemon. The previous value is restored on failure so the restart is tried again.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix(hack): install the CNI image package selected for a Forge sample cluster

The Forge sample accepts CNI_PLUGIN=calico, but both node pools always installed the OVN image package. The pre-kubeadm commands now install the Calico images for Calico and the OVN images for OVN.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix: rebuild CAPD OVN assets when any package is missing

capd-image skipped preparing OVN assets when the charts package was present and newer than the script, even if the images or Helm package was gone. It now rebuilds when any of those packages is missing, and still rebuilds when the prepare script is newer than the charts package.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix(hack): fail the nico-vms sample create on HTTP errors

The create request returned success on a 400 or 401 because curl exits 0 unless --fail is set, and --fail hides the body. The response stays visible, and the script now exits from the HTTP status.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix(hack): check the vTPM device in the configured Colima profile

The macOS check ran colima ssh without a profile, so a non-default COLIMA_PROFILE could be reported missing or present against the wrong VM. The device checks now use the same profile colima-start.sh prepares.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix: default each CAPD OVN package path on its own

Setting CAPD_CNI_CHARTS_DEB_PATH skipped the images and Helm packages, so the node image was built without them. Each path is filled in when it is unset, and each one is checked before the image build.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix(agent): run container nodes on the kernel Open vSwitch datapath

Userspace Open vSwitch encapsulates Geneve but has no port that can emit it, so traffic between container nodes is dropped. Container nodes now load the host kernel module and keep the dummy gateway bridge.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix: drop the duplicate /lib/modules mount from CAPD nodes

Kind already bind-mounts the host module tree read-only, so listing it again in extraMounts makes Docker reject the node container.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix(cli): load the vTPM proxy without sudo when already root

The arm64 bootstrap runner executes the job as root, and its sudoers file rejects sudo from root, so the e2e died after the fake nodes were ready.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix: rebuild the CAPD Helm package when the OVN asset script changes

The Helm freshness check compared prepare-ovn-assets.sh with the charts package, so a newer script could leave a stale nke-e2e-helm.deb in place.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix(hack): create the sample CAPD cluster through controlPlaneConfig

The local controller rejects control-plane node pools, so the sample script's node pool was rejected before a cluster was stored.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix: build the CAPD bundle mirror for the Docker daemon's architecture

The legacy bundle path defaulted to amd64 OVN packages, so an arm64 daemon was served image debs it cannot install.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix(agent): reject an unknown CNI plugin instead of installing OVN

The empty-plugin default already lives in the kubeadm init helper. The installer was also rewriting a typo to ovn and mutating the request.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix: rebuild the CAPD OVN images package when the asset script changes

The images freshness check compared prepare-ovn-assets.sh with the charts package, so a newer script could leave a stale images deb in place.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix(api): waive omitting cniPlugin on cluster create

An omitted plugin selects ovn-kubernetes. Clients built against the published spec were required to send the field, so the compatibility gate needs a named waiver.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix(hack): target the configured Colima profile for VM setup

SSH, stop, and the failure hints used Colima's default VM, so a non-default profile never received the vTPM module or the Docker limits.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* docs(agent): note that bare metal also uses the kernel datapath

The container check keys off NKE_OVS_DATAPATH_TYPE. An unset variable keeps bare metal and VM nodes off the dummy-bridge path even though they run the kernel datapath.

Signed-off-by: Alex Greene <algreene@nvidia.com>

---------

Signed-off-by: Alex Greene <algreene@nvidia.com>
2026-10-08 16:45:49 -04:00
Eric Staples 427d6513e5 fix(e2e): configure CAPD userspace tunnel networking (#1314)
* fix(e2e): configure CAPD userspace tunnel networking

Signed-off-by: Eric Staples <estaples@nvidia.com>

* fix(e2e): keep the nkectl substrate off the OVS uplink bridge

The nkectl bootstrap substrate builds FROM the CAPD node image and runs Calico. Since the uplink is always moved into the userspace br-phy bridge, kind and the fake nodes cannot reach each other on the substrate network.

Signed-off-by: Eric Staples <estaples@nvidia.com>

---------

Signed-off-by: Eric Staples <estaples@nvidia.com>
2026-10-08 09:34:23 -06:00
Chao c3fad3abff test(ci): use ovn-kubernetes in the default container lane (#1192)
* test(ci): use ovn-kubernetes in the default container lane

Signed-off-by: Chao Chen <chaoch@nvidia.com>
2026-10-05 17:18:47 -07:00
Guillermo Gaston 472610d634 feat(nico-sim): unify nico-vms and mock-nico
Adds a Docker-backed NICo simulator backend alongside the existing VM backend, dispatched per site with a shared instances table. Existing databases migrate automatically at startup. Unifies the nico-mock and nico-vm Tilt providers into a single nico-sim provider.
2026-09-08 19:33:50 -04:00
Davanum Srinivas a3c868615c fix(license): normalise SPDX headers to Apache-2.0, and assert it (#197)
* chore(license): normalise SPDX headers to Apache-2.0 [machine generated]

MACHINE GENERATED. Every added line in this commit is
`SPDX-License-Identifier: Apache-2.0` and nothing else; every removed line is
the identifier it replaces, or the notice paragraph that followed it. Verified:
0 added lines are anything other than that SPDX line.

829 files. The repository ships Apache-2.0 -- LICENSE says so and GitHub
reports it -- while 676 Go files and 153 others declared a different
identifier, followed by a notice that contradicted it.

The copyright line, the comment style and the indentation are left alone. Files
carrying the short form, two SPDX lines with no notice paragraph, have the
identifier swapped and nothing else.

Markdown is excluded: there the identifier appears in prose describing the
mismatch rather than in a header, so rewriting it would turn the sentence into
a tautology. That file is handled in the next commit.

Three shapes needed care, and each is worth knowing about if this is ever
repeated. controller/api/prepend-license.go carries the block inside a Go raw
string, so the paragraph's last line ends with a backtick; the closing
delimiter is carried back onto the SPDX line rather than dropped, or the string
would be left unterminated. Two shell scripts under controller/hack/ word the
final sentence differently, so matching on the common ending alone misses them.
And controller/.golangci.yml prefixes each line with "# //", which has to be
stripped before the paragraph text can be recognised.

The templates that produce these headers are rewritten here too, so this commit
is self-consistent: the five addlicense boilerplates, the five goheader
templates in .golangci.yml, and the block in prepend-license.go. Every header
in the tree now names the same identifier.

Review the next commit. This one is a substitution.

Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com>

* fix(license): one header template, and a check that reads it

The previous commit fixed the headers. This one stops them drifting again, and
is the part worth reviewing.

Nothing here could catch a header that named the wrong licence. addlicense only
ADDS a header to a file that has none; it never rewrites one already present.
So `make file-license-check` runs addlicense, finds every file already stamped,
produces no diff, and passes -- whatever the header says. agent/ is the proof:
its template and its check have both been correct all along, and six of its
files disagreed with them.

Three mechanisms defined the header and could disagree with each other: an
addlicense boilerplate per module, a goheader template in five .golangci.yml
files, and a hardcoded block in controller/api/prepend-license.go that stamps
generated API code. They are now one file, hack/license-header.tmpl, and every
module reads it.

make license-header-check replaces the per-module matrix and asserts two things
rather than one: that a header exists, and that it names Apache-2.0. The second
assertion is what this repository never had. Verified by planting a different
identifier in a file and confirming the check fails and names it.

Modules resolve the template through `git rev-parse --show-toplevel`, not a
relative path. A relative ../hack path silently changes meaning when a module
moves, which is how cli/ broke when it moved out of controller/.

The file set is the union of what the per-module targets already ignored, so
this covers exactly the files stamped today. 120 files carry no header at all
-- generated output, testdata, fixtures, build tooling, three .github files --
and widening the set to reach them is a separate change. Mixing headers that
are WRONG with headers that are MISSING would hide both.

Dockerfiles stay out: addlicense keys off the file extension and gives
Dockerfile.proto C-style // comments, which Docker cannot parse.

AGENTS.md's licence-header rule now describes the current state: one identifier,
added by `make license` rather than copied from a neighbouring file. The ban on
relicensing as a side effect of unrelated work stays.

The header-check job is renamed from "License headers (<module>)" to "License
headers". The merge gate calls this workflow whole rather than naming its jobs,
and the branch ruleset requires only `gate` and `DCO`, so no required check
changes name.

Verified: GOPROXY=off make build links all five binaries with no credentials;
golangci-lint goheader reports 0 issues on cli and controller; `make license`
is a no-op in all five modules; make license-header-check passes over 828 files
and fails on a planted mismatched header.

Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com>

stderr is not captured when reading addlicense's output. addlicense prints the
offending paths to stdout, while `go run` writes "go: downloading ..." on a
cold module cache and "exit status 1" on failure -- both to stderr. Folding the
two together reports a module download as a file with no header, which is how
the first CI run of this check failed while passing on a machine whose cache
was already warm. Reproduced locally against an empty GOMODCACHE.

Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com>

---------

Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com>
2026-08-18 20:42:45 -04:00
nhammernik fd95309ade chore: re-sync cwe from gitlab (#136) 2026-08-15 19:32:05 -04:00
nhammernik 7ce92b69ce feat: import cloud-workflow-engine (#7) 2026-08-05 16:25:10 -06:00