Repository navigation
feat(operator): add the Rust workspace, the KatesTest CRD and its CI - #608
Merged
Merged
Conversation
The operator needs a place to live before it can reconcile anything. This opens operator/ with the KatesTest type and its CEL rules. The binary, its Dockerfile and the image build come with the reconciler in the next PR, since nothing would run them yet. No chart yet either: publish-charts.yml pushes every tracked chart at the next tag and never re-pushes a version. crdgen derives spec, scenario and sla from the shipped request schema, names and types only, so a mistyped key is refused by the apiserver while values stay the API's job. That includes `required`: the API runs a scenario with no name, so the CRD must not refuse one. Keys the schema accepts and the API never binds are dropped, because on sla they would otherwise mean Ready=True on an empty SLA. ttlSecondsAfterFinished keeps minimum: 0. The API never sees that field, so the CRD is the only check on it. ci-operator.yml gates on the workspace and on versions.env, since its Rust job reads the cargo-deny and kubeconform pins. Only the apiserver can judge the CEL rules, so a Kind job dry-runs the CRD.
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.
Why
The Kubernetes operator needs a home and a CRD before it can reconcile anything, and the schema is the riskiest part: the API drops an unknown spec key silently, so a pass-through
specwith a typo would run on defaults and reportReady=Trueon the wrong run. This PR opensoperator/with theKatesTesttype and CI, and nothing else.What changed
operator/: a Rust workspace (edition 2024,kube5.0) withkates-crds, theKatesTesttype, conditions, printer columns and CEL rules: exactly one ofspec.spec/spec.scenario,slaonly withspec.spec, the wholespecfrozen oncestatus.runIdis set.crdgenderivesspec,scenarioandslafromschemas/test-request.v1.schema.json, names and types only.default, ranges andrequiredare dropped, because values stay the API's job. Keys the schema accepts and the API never binds are dropped too, because onslathey would meanReady=Trueon an empty SLA.ci-operator.yml: fmt, clippy, tests,cargo deny, a one-crypto-provider check, CRD freshness, kubeconform, and a Kind job that dry-runs the CRD, since only the apiserver can judge CEL.rust-toolchain.tomlpins Rust.CARGO_DENY_VERSIONjoinsversions.env,!operator/Cargo.lockjoins.gitignore, and Dependabot watches/operator.Deliberately not done
publish-charts.ymlpublishes every tracked chart at the next tag and never re-pushes a version.Deviations worth a look
CustomResourceDefinitionschema. CI validates a good and a mistyped sampleKatesTestagainst the CRD's own schema instead.ttlSecondsAfterFinishedkeepsminimum: 0: the API never sees that field, so the CRD is its only check.spec.typeis required even with a scenario, becauseCreateTestRequesthas@NotNullontype.Tests
Passing locally after the final trim:
cargo fmt --check, clippy-D warnings,cargo test --locked(19),cargo deny check, the provider check, CRD freshness,check-versions.sh,actionlint,yamllint, book style, version matrix and index.Before the trim, with an identical CRD:
kubectl apply --dry-run=serveron a Kind v1.34.11 node, where mistyped keys and post-runIdspec edits were refused on the installed CRD; kubeconform on both samples. That Kind run used one node and kubectl 1.37, notconfig/cluster.yamland the pinned client.ci-operator.ymlhas never run on GitHub, so this PR's run is the first proof of its wiring. The CRD is byte-identical with PR 1's schema, so the two merge in either order.