Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
bee448f
feat(tools): rename an upstream flux crd into the internal one
drey Sep 17, 2026
a04ebd9
feat(tools): generate the internal definitions from upstream flux
drey Sep 17, 2026
8bfb9fc
fix(tools): close the kind gap in the internal CRD guard
drey Sep 17, 2026
aaf9b52
feat(rewriter): map the upstream flux groups
drey Sep 17, 2026
7ef994a
feat(rewriter): follow upstream identifiers without moving stored ones
drey Sep 17, 2026
52c550e
fix(rewriter): put resetAt in the internal namespace with its siblings
drey Sep 17, 2026
2039fca
feat(controller): build against upstream flux apis
drey Sep 17, 2026
1418f19
fix(controller): read release values with the helm v4 reader
drey Sep 17, 2026
f5719dd
feat(build): build both controllers from upstream flux
drey Sep 17, 2026
7575e4c
feat(chart): rename the source image after its upstream
drey Sep 17, 2026
46d1c51
fix(build): guard against upstream flux tag skew
drey Sep 17, 2026
fcfae1c
chore(tools): wire tools/internalcrds into the repository's tasks
drey Sep 17, 2026
5675fc8
fix(tools): correct stale comments and reject a missing CRD kind
drey Sep 17, 2026
64bd0e8
fix(tools): make both version guards fail on a missing pin
drey Sep 17, 2026
753fde3
fix(tools): rename kinds in the text of the internal definitions
drey Sep 18, 2026
3dce4fe
test(rewriter): check the rules against the generated definitions
drey Sep 18, 2026
2dfb133
chore(lint): exempt the enums upstream flux added
drey Sep 18, 2026
aa9a189
chore: resolve dmt linter issues
drey Sep 18, 2026
b0e6534
fix(tools): drop the kustomize substitute annotation
drey Sep 18, 2026
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
12 changes: 4 additions & 8 deletions .dmtlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,16 @@ linters-settings:
enum:
- "spec.versions[0].schema.openAPIV3Schema.properties.spec.properties.sts.properties.provider"
- "spec.versions[0].schema.openAPIV3Schema.properties.spec.properties.provider"
- "spec.versions[1].schema.openAPIV3Schema.properties.spec.properties.provider"
- "spec.versions[1].schema.openAPIV3Schema.properties.spec.properties.sts.properties.provider"
- "spec.versions[0].schema.openAPIV3Schema.properties.spec.properties.upgrade.properties.remediation.properties.strategy.properties"
- "spec.versions[0].schema.openAPIV3Schema.properties.spec.properties.uninstall.properties.deletionPropagation"
- "spec.versions[0].schema.openAPIV3Schema.properties.spec.properties.driftDetection.properties.mode"
- "spec.versions[0].schema.openAPIV3Schema.properties.spec.properties.upgrade.properties.remediation.properties.strategy"
- "spec.versions[0].schema.openAPIV3Schema.properties.spec.properties.chart.properties.spec.properties.verify.properties.provider"
- "spec.versions[0].schema.openAPIV3Schema.properties.status.properties.lastAttemptedReleaseAction"
- "spec.versions[1].schema.openAPIV3Schema.properties.spec.properties.chart.properties.spec.properties.verify.properties.provider"
- "spec.versions[1].schema.openAPIV3Schema.properties.spec.properties.driftDetection.properties.mode"
- "spec.versions[1].schema.openAPIV3Schema.properties.spec.properties.postRenderers.items.properties.kustomize.properties.patchesJson6902.items.properties.patch.items.properties.op"
- "spec.versions[1].schema.openAPIV3Schema.properties.spec.properties.uninstall.properties.deletionPropagation"
- "spec.versions[1].schema.openAPIV3Schema.properties.spec.properties.upgrade.properties.remediation.properties.strategy"
- "spec.versions[1].schema.openAPIV3Schema.properties.status.properties.lastAttemptedReleaseAction"
- "spec.versions[0].schema.openAPIV3Schema.properties.spec.properties.upgrade.properties.serverSideApply"
- "spec.versions[0].schema.openAPIV3Schema.properties.spec.properties.rollback.properties.serverSideApply"
- "spec.versions[0].schema.openAPIV3Schema.properties.spec.properties.waitStrategy.properties.name"
- "spec.versions[0].schema.openAPIV3Schema.properties.spec.properties.postRenderStrategy"
- "properties.logLevel"
- "properties.logFormat"
rbac:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ jobs:
- name: Verify the generated files are committed
run: task --yes ci:generate:api

- name: Verify the internal definitions are committed
run: task --yes ci:generate:internal-crds

lint:
runs-on: [self-hosted, large]
name: Lint
Expand Down
79 changes: 75 additions & 4 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ vars:
VALIDATION_FILES: "tools/validation/{main,messages,diff,doc_changes}.go"
golangciLintVersion: "v2.13.2"

# Only the modules this repository authors are listed. images/kube-api-rewriter is a
# separate upstream module vendored in for the build, and images/helm-controller and
# images/nelm-source-controller carry nothing but their werf files, so none of them is
# ours to lint, format or test here.
# Only the modules this repository authors are listed, including tools/internalcrds.
# images/kube-api-rewriter is a separate upstream module vendored in for the build, and
# images/helm-controller and images/source-controller carry nothing but their werf
# files, so none of them is ours to lint, format or test here. The one exception is
# the rewriter's operatornelm package, which is this module's own rule table: its
# tests run from test:rewrite-rules below.
includes:
api:
taskfile: ./api/Taskfile.dist.yaml
Expand All @@ -28,6 +30,9 @@ includes:
chart-values-controller:
taskfile: ./images/chart-values-controller/Taskfile.dist.yaml
dir: ./images/chart-values-controller
internalcrds:
taskfile: ./tools/internalcrds/Taskfile.dist.yaml
dir: ./tools/internalcrds

deps:
taskfile: https://raw.githubusercontent.com/werf/common-ci/refs/heads/main/Taskfile.deps.yml
Expand Down Expand Up @@ -59,6 +64,58 @@ tasks:
cmds:
- task: api:ci:generate

generate:internal-crds:
desc: "Regenerate the internal CustomResourceDefinitions from upstream flux."
cmds:
- |
set -eu
helmControllerTag=$(sed -n 's/^ *helm-controller: *//p' build/components/versions.yml)
sourceControllerTag=$(sed -n 's/^ *source-controller: *//p' build/components/versions.yml)
work=$(mktemp -d)
trap 'rm -rf "$work"' EXIT
git clone --quiet --depth 1 --branch "$helmControllerTag" \
https://github.com/fluxcd/helm-controller "$work/helm-controller"
git clone --quiet --depth 1 --branch "$sourceControllerTag" \
https://github.com/fluxcd/source-controller "$work/source-controller"
cd tools/internalcrds
go run . -out ../../crds/embedded/helm-controller.yaml \
"$work/helm-controller/config/crd/bases"
go run . -out ../../crds/embedded/source-controller.yaml \
"$work/source-controller/config/crd/bases"

check-flux-tags:
desc: "Verify the upstream flux tags pinned in werf.inc.yaml match build/components/versions.yml."
cmds:
- |
set -eu
helmControllerTag=$(sed -n 's/^ *helm-controller: *//p' build/components/versions.yml)
sourceControllerTag=$(sed -n 's/^ *source-controller: *//p' build/components/versions.yml)
helmWerfTag=$(sed -n 's/.*\$helmControllerTag := "\(.*\)".*/\1/p' images/helm-controller/werf.inc.yaml)
sourceWerfTag=$(sed -n 's/.*\$sourceControllerTag := "\(.*\)".*/\1/p' images/source-controller/werf.inc.yaml)
for pin in "$helmControllerTag" "$sourceControllerTag" "$helmWerfTag" "$sourceWerfTag"; do
if [ -z "$pin" ]; then
echo "a version pin came out empty: build/components/versions.yml has '$helmControllerTag' and '$sourceControllerTag', the werf files have '$helmWerfTag' and '$sourceWerfTag'" >&2
exit 1
fi
done
if [ "$helmControllerTag" != "$helmWerfTag" ]; then
echo "images/helm-controller/werf.inc.yaml pins helm-controller $helmWerfTag but build/components/versions.yml pins $helmControllerTag" >&2
exit 1
fi
if [ "$sourceControllerTag" != "$sourceWerfTag" ]; then
echo "images/source-controller/werf.inc.yaml pins source-controller $sourceWerfTag but build/components/versions.yml pins $sourceControllerTag" >&2
exit 1
fi
silent: true

ci:generate:internal-crds:
desc: "Regenerate the internal CustomResourceDefinitions and verify they are committed."
cmds:
- task: check-flux-tags
- task: generate:internal-crds
- |
git diff --exit-code crds/embedded || (echo "Please run task generate:internal-crds and commit changes" && exit 1)

# The shared deps task installs golangci-lint through the upstream install.sh,
# whose checksum lookup is an unanchored grep: releases now ship an SBOM entry
# next to the archive, both lines match, and the verification fails for every
Expand All @@ -82,6 +139,18 @@ tasks:
- task: operator-helm-controller:test:unit
- task: chart-values-controller:test:unit
- task: e2e:test:unit
- task: internalcrds:test:unit
- task: test:rewrite-rules

# The rule table and the generated definitions are two halves of one
# agreement, and only a live cluster reports a disagreement: a request the
# proxy renames to a group, kind or resource type no definition declares is
# answered "not found". The test compares the two, and reads the definitions
# from outside its own module, which the test cache does not track.
test:rewrite-rules:
desc: "Check the proxy rewrite rules against the generated definitions."
cmds:
- cd images/kube-api-rewriter && go test -count=1 ./pkg/operatornelm/...

test:e2e:setup:
desc: "Setup environment for e2e tests."
Expand Down Expand Up @@ -147,6 +216,7 @@ tasks:
- task: operator-helm-controller:format
- task: chart-values-controller:format
- task: e2e:format
- task: internalcrds:format

lint:
deps:
Expand All @@ -157,6 +227,7 @@ tasks:
- task: operator-helm-controller:lint
- task: chart-values-controller:lint
- task: e2e:lint
- task: internalcrds:lint
- task: lint:doc-ru

lint:doc-ru:
Expand Down
4 changes: 2 additions & 2 deletions build/components/versions.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
core:
3p-helm-controller: v0.1.3
nelm-source-controller: v0.1.4
helm-controller: v1.6.4
source-controller: v1.9.5
package:
Loading
Loading