Commit Graph
6 Commits
Author SHA1 Message Date
Abhay Krishna 8c6e47fc1e feat(controller)!: read settings only from nke-controller-config (#1527)
The controller now takes the 61 settings nke-controller-config carries
from the mounted file only. Each config.Config field that moved trades
its env tag for a controllerconfig tag naming its config.yaml key, and
controllerconfig.LoadStartupConfig fills them at startup from the file
CONTROLLER_CONFIG_PATH names, which is now required. The chart stops
setting the 61 variables, and config.Validate checks only what the
environment still supplies; the file validates the rest when it loads.

With no tracing.endpoint in the file, the controller falls back to the
OTEL_EXPORTER_OTLP_* variables the OpenTelemetry Operator injects, as
it did before. The exporter gets the endpoint as a URL whose scheme
carries the resolved transport, so an injected http:// endpoint cannot
downgrade a secure tracing.endpoint, and an https:// one stays secure.

Host-local runs and the gofail e2e worker start from
hack/local-controller-config.yaml. The e2e helpers that toggled OIDC
and permissive mode on the Deployment now edit nke-controller-config
and restart the controller.

Rolling back across this change needs the chart and the image rolled
back together: an older image under this chart runs on Go defaults for
every setting the chart no longer passes.

Signed-off-by: Abhay Krishna Arunachalam <abhaykrishna@nvidia.com>
2026-10-12 15:17:34 -07:00
Ryan Bever 5af7334722 refactor: remove obsolete Forge integration remnants (#603)
Signed-off-by: Ryan Bever <rbever@nvidia.com>
2026-09-10 18:15:16 +00:00
Davanum Srinivas 8ed83494a4 fix(devx): make a local CWE run work without four undocumented workarounds (#527)
* fix(config): point PROFILES_DIR at profiles that exist

The default was ./profiles, which holds example/, README.md, Dockerfile
and runbooks/ -- no osProfiles/metadata.yaml. Every local run died in the
database migration:

  failed to read metadata file: open profiles/osProfiles/metadata.yaml

The profiles this repository ships are one level down. Deployments set
PROFILES_DIR explicitly through the chart, so only a bare local run reads
this default.

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

* fix(config): accept the dev-default database credentials in the test Forge environment

Validate rejects a DB_CONNECTION_STRING containing postgres:postgres@
unless CNPG_SUPERUSER_PASSWORD is also set. That is right for a
deployment, but the rejected string is the compiled-in default, so
'make run' on a laptop failed on config load:

  DB_CONNECTION_STRING uses weak dev-default credentials: set CNPG_SUPERUSER_PASSWORD

.env.local.example does not set the password either, so the file the
documentation points at did not help. FORGE_ENVIRONMENT=test already means
a local run that signs its own JWT instead of authenticating against NGC;
the check now skips that environment and holds everywhere else.

Adds the test the check never had, covering both environments.

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

* fix(devx): run-local without an NGC key, and find the temporal CLI where its installer puts it

Three things blocked 'FORGE_ENVIRONMENT=test make run-local':

validate_api_key demanded FWE_API_KEY unconditionally, but the test Forge
environment signs its own JWT and needs no key.

get_temporal_cmd and check_temporal_available only looked on PATH and in
flox. temporal.download/cli.sh installs to ~/.temporalio/bin and does not
touch PATH, so a non-interactive shell saw 'temporal: command not found'
with the binary sitting installed.

The missing-temporal message named only flox. It now gives the three ways
to install it.

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

* fix(devx): do not require Teleport for a local run

dev-check is a prerequisite of dev-start-local, and it exited 1 when tsh
was missing. Only 'make run-remote' reaches a cluster through Teleport, so
a local-only developer had to install it to get past the check. It is a
warning now.

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

* fix(config): gate the weak-credential check on the database, not on Forge

Review pushed back on keying this on FORGE_ENVIRONMENT, and rightly:
that variable selects a Forge backend and says nothing about which
database DB_CONNECTION_STRING names. An operator could set it on a
deployment reaching a real database and stand the guard down.

The risk is a property of the database, so the check now asks about the
database: dev-default credentials are refused unless the host is loopback.
A laptop's container passes, an in-cluster or remote Postgres does not,
whatever FORGE_ENVIRONMENT says. A test pins that.

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

* fix(devx): set the local profiles in run-local, not in the shipped default

The earlier commit pointed PROFILES_DIR's compiled-in default at
profiles/example/profiles. Review found that wrong twice over: the example
tree is full of REPLACE_ placeholders and its own README says the
controller does not load it, and runbooks/ sits beside profiles/ rather
than inside it, so EffectiveRunbooksDir would look in a directory that
does not exist.

A shipped default should not name developer data at all. The default goes
back to ./profiles, and run-local -- a developer-only target -- points at
test/fixtures/profiles, which the Tiltfile already calls the in-repo
fixture, with its sibling runbooks tree. Both stay overridable.

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

---------

Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com>
2026-09-06 14:22:54 -04:00
dependabot[bot]andgpg: Signature made Tue Aug 18 09:22:55 2026 MDTgpg: using RSA key B5690EEEBB952194gpg: Can't check signature: No public keyDavanum Srinivas 88e69d0afc build: bump the docker-images group across 9 directories with 3 updates (#187)
* build: bump the docker-images group across 9 directories with 3 updates

Bumps the docker-images group with 1 update in the /agent directory: golang.
Bumps the docker-images group with 1 update in the /controller/hack/capd-reboot-controller directory: golang.
Bumps the docker-images group with 1 update in the /controller/internal/temporal/activities directory: dns/k8s-dns-node-cache.
Bumps the docker-images group with 1 update in the /generated/aicr/observability/helm/002-postgresql directory: library/postgres.
Bumps the docker-images group with 1 update in the /generated/aicr/observability/helm/data/components/postgresql directory: library/postgres.
Bumps the docker-images group with 1 update in the /generated/aicr/quickstart/argocd/002-postgresql directory: library/postgres.
Bumps the docker-images group with 1 update in the /generated/aicr/quickstart/argocd/data/components/postgresql directory: library/postgres.
Bumps the docker-images group with 1 update in the /generated/aicr/quickstart/helm/002-postgresql directory: library/postgres.
Bumps the docker-images group with 1 update in the /generated/aicr/quickstart/helm/data/components/postgresql directory: library/postgres.


Updates `golang` from `640a234` to `0d1d3a7`

Updates `golang` from `af8d674` to `3889b42`

Updates `dns/k8s-dns-node-cache` from 1.23.1 to 1.26.8

Updates `library/postgres` from 17.4 to 18.6

Updates `library/postgres` from 17.4 to 18.6

Updates `library/postgres` from 17.4 to 18.6

Updates `library/postgres` from 17.4 to 18.6

Updates `library/postgres` from 17.4 to 18.6

Updates `library/postgres` from 17.4 to 18.6

Updates `library/postgres` from 17.4 to 18.6

Updates `library/postgres` from 17.4 to 18.6

Updates `library/postgres` from 17.4 to 18.6

Updates `library/postgres` from 17.4 to 18.6

Updates `library/postgres` from 17.4 to 18.6

Updates `library/postgres` from 17.4 to 18.6

Updates `library/postgres` from 17.4 to 18.6

Updates `library/postgres` from 17.4 to 18.6

Updates `library/postgres` from 17.4 to 18.6

Updates `library/postgres` from 17.4 to 18.6

Updates `library/postgres` from 17.4 to 18.6

Updates `library/postgres` from 17.4 to 18.6

Updates `library/postgres` from 17.4 to 18.6

Updates `library/postgres` from 17.4 to 18.6

Updates `library/postgres` from 17.4 to 18.6

Updates `library/postgres` from 17.4 to 18.6

Updates `library/postgres` from 17.4 to 18.6

Updates `library/postgres` from 17.4 to 18.6

Updates `library/postgres` from 17.4 to 18.6

Updates `library/postgres` from 17.4 to 18.6

Updates `library/postgres` from 17.4 to 18.6

Updates `library/postgres` from 17.4 to 18.6

Updates `library/postgres` from 17.4 to 18.6

Updates `library/postgres` from 17.4 to 18.6

Updates `library/postgres` from 17.4 to 18.6

Updates `library/postgres` from 17.4 to 18.6

Updates `library/postgres` from 17.4 to 18.6

Updates `library/postgres` from 17.4 to 18.6

Updates `library/postgres` from 17.4 to 18.6

Updates `library/postgres` from 17.4 to 18.6

---
updated-dependencies:
- dependency-name: dns/k8s-dns-node-cache
  dependency-version: 1.26.8
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: docker-images
- dependency-name: golang
  dependency-version: 1.26.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: docker-images
- dependency-name: golang
  dependency-version: 1.26.6-alpine
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: docker-images
- dependency-name: library/postgres
  dependency-version: '18.6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: docker-images
- dependency-name: library/postgres
  dependency-version: '18.6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: docker-images
- dependency-name: library/postgres
  dependency-version: '18.6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: docker-images
- dependency-name: library/postgres
  dependency-version: '18.6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: docker-images
- dependency-name: library/postgres
  dependency-version: '18.6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: docker-images
- dependency-name: library/postgres
  dependency-version: '18.6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: docker-images
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix: update postgres digest to match 18.6 tag

Dependabot bumped the tag from 17.4 to 18.6 but left the digest
pointing at the 17.4 image. Update all nine affected files to the
correct sha256 digest for docker.io/library/postgres:18.6.

Signed-off-by: gpg: Signature made Tue Aug 18 09:22:55 2026 MDTgpg:                using RSA key B5690EEEBB952194gpg: Can't check signature: No public keyDavanum Srinivas <thowe@nvidia.com>

* fix: keep postgres data on the mounted volume under 18.x

postgres:18 moved PGDATA from /var/lib/postgresql/data to
/var/lib/postgresql/18/docker and made the old path fatal: the entrypoint
refuses to start when it finds a mount there, even an empty one. Verified
against postgres:18.6 with an empty directory mounted at the old path --
the container exits 1 before initdb.

The bundles mount their emptyDir at /var/lib/postgresql/data, so the 17.4
-> 18.6 bump alone would leave postgresql in CrashLoopBackOff. Pin PGDATA
back to the mounted path, which keeps the data directory on the volume and
its 1Gi sizeLimit meaningful.

Signed-off-by: Terry Howe <thowe@nvidia.com>

* chore: refresh aicr bundle checksums after the postgres bump

The bump edited rendered bundle contents without updating the integrity
manifest each bundle ships, so `sha256sum -c checksums.txt` failed on 9
files across the three bundles. All three now verify clean again.

Signed-off-by: Terry Howe <thowe@nvidia.com>

* chore: bump dev-env postgres to 18.6

Keeps the local dev database on the same major version as the bundles.
The container takes no volume mount, so the PGDATA relocation in 18.x
does not apply here.

Signed-off-by: Terry Howe <thowe@nvidia.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: gpg: Signature made Tue Aug 18 09:22:55 2026 MDTgpg:                using RSA key B5690EEEBB952194gpg: Can't check signature: No public keyDavanum Srinivas <thowe@nvidia.com>
Signed-off-by: Terry Howe <thowe@nvidia.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: gpg: Signature made Tue Aug 18 09:22:55 2026 MDTgpg:                using RSA key B5690EEEBB952194gpg: Can't check signature: No public keyDavanum Srinivas <thowe@nvidia.com>
2026-08-20 16:23:41 -06: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 7ce92b69ce feat: import cloud-workflow-engine (#7) 2026-08-05 16:25:10 -06:00