Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/agent-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,20 @@ jobs:
cache-dependency-path: agent/go.sum
- name: Run tests
run: make -C agent test
# `make test` first regenerates the CRDs, RBAC and deepcopy code, then
# runs `go fmt`. Whatever they change must be committed: an edited API
# type or RBAC marker, a controller-gen bump, or unformatted code.
- name: Check make test left the tree clean
if: ${{ !cancelled() }}
run: |
git diff
test -z "$(git status --porcelain)" || { git status --porcelain; exit 1; }
# Nothing else runs kustomize, so a kustomize bump would go untested.
- name: Build the manifests with kustomize
if: ${{ !cancelled() }}
run: |
make -C agent kustomize
agent/bin/kustomize build agent/config/default > /dev/null

image:
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ make -C rpm rpm EL=9 # build both RPMs into rpm/_build/

- **Generated code is committed.** After touching the API types or the RBAC
markers, run `make -C agent manifests generate` and commit the result. CI
regenerates it before running the tests but does not fail on an uncommitted
diff, so a stale CRD reaches `main` unnoticed if you skip this.
regenerates it before running the tests, and fails if the result differs
from what is committed. A controller-gen bump needs the same step.
- **Logging**: `logr` through controller-runtime, with the `logcheck` linter
enforcing balanced key-value pairs. Log a value once, at the level that owns
it: the reconciler logs outcomes, the packages it calls return errors.
Expand Down
3 changes: 2 additions & 1 deletion agent/.custom-gcl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
# with all the plugins listed below.
#
# See: https://golangci-lint.run/plugins/module-plugins/
version: v2.12.2
# renovate: datasource=github-releases depName=golangci/golangci-lint
version: v2.14.0
plugins:
# logcheck validates structured logging calls and parameters (e.g., balanced key-value pairs)
- module: "sigs.k8s.io/logtools"
Expand Down
4 changes: 2 additions & 2 deletions agent/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ Never hand-edit these; regenerate them instead:
scaffolding

They come from the markers in the Go sources, so change the marker, run
`make manifests generate`, and commit the result. Nothing in CI catches a stale
one; [../CONTRIBUTING.md](../CONTRIBUTING.md#agent-go) says why.
`make manifests generate`, and commit the result. CI fails on a stale one, see
[../CONTRIBUTING.md](../CONTRIBUTING.md#agent-go).

Leave the `+kubebuilder:scaffold:*` comments alone. They are insertion points
for the kubebuilder CLI, in `cmd/manager/main.go`, `internal/controller/suite_test.go`
Expand Down
9 changes: 7 additions & 2 deletions agent/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Image URL to use all building/pushing image targets
IMG ?= controller:latest
# YEAR defines the year value used for substituting the YEAR placeholder in the boilerplate header.
YEAR ?= $(shell date +%Y)
# Fixed to the year the project started: the current year would rewrite
# every generated header each January, and CI fails on a changed tree.
YEAR ?= 2026

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand Down Expand Up @@ -206,7 +208,9 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
GOLANGCI_LINT = $(LOCALBIN)/golangci-lint

## Tool Versions
# renovate: datasource=go depName=sigs.k8s.io/kustomize/kustomize/v5
KUSTOMIZE_VERSION ?= v5.8.1
# renovate: datasource=go depName=sigs.k8s.io/controller-tools
CONTROLLER_TOOLS_VERSION ?= v0.21.0

#ENVTEST_VERSION is the controller-runtime version to use for setup-envtest, derived from go.mod
Expand All @@ -219,7 +223,8 @@ ENVTEST_K8S_VERSION ?= $(shell v='$(call gomodver,k8s.io/api)'; \
[ -n "$$v" ] || { echo "Set ENVTEST_K8S_VERSION manually (k8s.io/api replace has no tag)" >&2; exit 1; }; \
printf '%s\n' "$$v" | sed -E 's/^v?[0-9]+\.([0-9]+).*/1.\1/')

GOLANGCI_LINT_VERSION ?= v2.12.2
# renovate: datasource=github-releases depName=golangci/golangci-lint
GOLANGCI_LINT_VERSION ?= v2.14.0
Comment thread
ezekiel-alexrod marked this conversation as resolved.
# The kind release also pins the Kubernetes version of the e2e cluster, through
# its default node image.
# renovate: datasource=github-releases depName=kubernetes-sigs/kind
Expand Down
3 changes: 1 addition & 2 deletions agent/internal/puller/puller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1132,8 +1132,7 @@ func TestRemotePullRejectsARegistrySignedByAnUnknownCA(t *testing.T) {
if !errors.Is(err, ErrPull) {
t.Fatalf("err = %v, want ErrPull", err)
}
var unknown x509.UnknownAuthorityError
if !errors.As(err, &unknown) {
if _, ok := errors.AsType[x509.UnknownAuthorityError](err); !ok {
t.Errorf("err = %v, want an unknown authority", err)
}
}
Expand Down
Loading