Kinds: Flux
Implementation, history and tests of the entries on the reference page
Kinds: Flux. Every test
named here is in pkg/oam/builtin/components/flux_kinds_internal_test.go
unless a line says another file.
fluxcd-alert, fluxcd-provider, fluxcd-receiver, imagepolicy, imagerepository, imageupdateautomation, artifactgenerator, resourcesetinputprovider
- Implementation: Each is built on
policyFreeKind(see the storageclass entry) with the Flux namespace, the check of its durations and, where a field names a host the environment policy holds or holds a credential, a check under that policy (fluxKind), and emits that one object, named after the component unlessobjectNamenames it; the handler adds no label, no annotation and no default. (“the storageclass entry” is on the reference page Kinds: core workloads.) - History:
- go-kure/launcher#790 (the kind-named projections).
- go-kure/launcher#601 (a duration is held to the pattern its field declares).
- go-kure/launcher#619 (a
timeoutof an hour or more is written in minutes, as the timeout of a Flux source is). - go-kure/launcher#984 (a Receiver resource’s
apiVersionis checked at build time). - go-kure/launcher#1010 (the version the refusal names for a kind outside the
Receiver API’s
kindenum). - go-kure/launcher#883 (the Required lists are generated from the markers of the Go source, and the CRDs are vendored for the tests).
- go-kure/launcher#874 (a kind checks an expression rule only where the check is held to the API server’s own validator, which answers from a CRD).
- go-kure/launcher#975 (a
pagerdutyProvider’s routing key inchannel). - go-kure/launcher#1079 (a trait in a later group that makes a required read is refused).
- Tests:
TestFluxKinds_DefaultedZerosholds each kind’s list of such fields to the numbers, booleans and strings that are omitted when zero and that the API defaults to something else. (“such fields” are the reference’s fields that the type omits when empty and the API defaults, aseventSeverityandfilter.limit.)TestFluxKinds_MarkersClassifiedfails on a field the type writes unauthored that neither a marker nor that rule classifies. (“that rule” is the reference’s “schema generators’ rule” for a field with no marker whose json tag keeps it when empty.)- A dependency bump that adds, drops or moves one fails there. (“there” is
TestFluxKinds_MarkersClassified, and “one” is a field the type writes unauthored that a marker or that rule classifies.) TestKindComponents_GeneratedRequiredBothWays(the test the reference’s “the list of aresourcesetinputprovideris derived from its CRD instead, and held to that CRD by the API server” names; it is inkind_required_internal_test.go).- The other kinds here are held to the API server’s own validator on the
controllers’ CRDs, vendored from each controller’s repository at the tag of
the linked API module, unmodified but for
allow-termpragma comment lines (see “Vendored CRDs” under the required fields) (testdata/upstream/<repository>/,scripts/vendor-flux-crds.sh, each file checked against its git blob id byTestVendoredCRDs_MatchSource): of every type that holds a generated path, the same test creates the object with one such path authored, which the API server accepts, and without it, which the API server refuses as missing a required field; and every generated path is one the CRD declares. (“The other kinds here” are the kinds of the reference entry other thanresourcesetinputprovider; “the required fields” are the reference’s Required fields a kind writes unauthored and does not refuse; “the same test” isTestKindComponents_GeneratedRequiredBothWays, which is inkind_required_internal_test.go;TestVendoredCRDs_MatchSource, which checks each vendored file, is invendored_crds_internal_test.go.) TestFluxKinds_ExpressionRulesreads every such rule from the markers of the linked source and holds the list (fluxRulesLeft) to them, andTestFluxOperatorKinds_ExpressionRulesMatchCRDholds the ResourceSetInputProvider’s list to thex-kubernetes-validationsof the shipped CRD, in both directions, so a dependency bump that adds, drops or rewords one fails there. (“such rule”, “the list” and “one” are the API expression rules the reference lists under “The APIs’ expression rules are not checked”; “the ResourceSetInputProvider’s list” is its eighteen rules.)TestProviderAddressCredentialTypes_InUpstreamEnumholds the list to the API’s values oftype. (“the list” is the reference’s list of Provider types whoseaddressis the credential, or can be; the test is influxcd_provider_internal_test.go.)
fluxcd-kustomization
- History:
- go-kure/launcher#784 (the kind-named terminal for Flux’s
Kustomization). - go-kure/launcher#352 (the type is
fluxcd-kustomizationrather thankustomization). - go-kure/launcher#883 (the Required list of the fields the type writes unauthored is generated from the markers of the linked kustomize-controller module).
- go-kure/launcher#740 (
FluxNamespaceReads: the ConfigMaps and Secrets it reads from its own namespace). - go-kure/launcher#1079 (a trait in a later group that makes a required read is refused).
- go-kure/launcher#784 (the kind-named terminal for Flux’s
- Tests:
- a test ties the published schema to that struct, so a bump that adds or drops
a spec field fails the suite until the schema follows. (“that struct” is
KustomizationSpec, of the reference’s “Its properties are exactly the top-level JSON keys ofKustomizationSpec”; the sentence names no test.)
- a test ties the published schema to that struct, so a bump that adds or drops
a spec field fails the suite until the schema follows. (“that struct” is
helmrepository, ocirepository, gitrepository, bucket, helmchart
- History:
- go-kure/launcher#347 (the kind-named terminals for Flux’s four fetching source kinds, part of the Helm-family redesign go-kure/launcher#336).
- go-kure/launcher#351 (
helmchart, the kind that builds a chart artifact from one of them). - go-kure/launcher#1078 (a
urlmust not carry a credential). - go-kure/launcher#601 (an
intervalis checked as onhelmrelease). - go-kure/launcher#606 (the
timeoutpattern of the source CRDs has nohunit). - go-kure/launcher#619 (a
timeoutof an hour or more is emitted with its hours folded into minutes). - go-kure/launcher#790 (an authored
verifythat names noprovideris written withprovider: cosign, and an authoredprovider: ""is refused). - go-kure/launcher#883 (every other required field the type writes unauthored is refused, from a list generated from the markers of the linked source-controller module).
- go-kure/launcher#699 (no refusal prints the value it refused).
- go-kure/launcher#740 (
FluxNamespaceReads: the Secrets and the ConfigMap a reference names move with the source). - go-kure/launcher#1079 (a trait in a later group that makes a required read is refused).
- Tests:
- a test ties each published schema to its struct, so a bump that adds or drops a spec field fails the suite until the schema follows. (“its struct” is the source-controller spec type of the reference’s “Each component’s properties are exactly the top-level JSON keys of its source-controller spec type”; the sentence names no test.)
- A reflection test asserts, per kind, that no spec field is unreachable through that decode, against an explicit exclusion list that is empty. (“that decode” is the strict decode of the reference’s “Decoding”.)