<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>OAM reference: contributor notes :: Go Kure — Launcher</title><link>https://www.gokure.dev/launcher/dev/contributing/oam-reference/index.html</link><description>Each page here belongs to one part of the OAM and component reference (api-reference/oam and api-reference/oam-components). It holds what a contributor needs and a reader of the reference does not: the code that implements an entry, the issues behind it, and the tests that hold its claims.&#10;A page is named after its reference part and has one section per entry, with up to three lists:&#10;Implementation: the helper or file that builds the entry. History: the issues that introduced or changed it. Tests: the tests that hold a claim of the reference, with the claim each one holds. Text on these pages is moved from the reference without rewording. A claim stays in the reference; its test or issue reference moves here.</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://www.gokure.dev/launcher/dev/contributing/oam-reference/index.xml" rel="self" type="application/rss+xml"/><item><title>Common config</title><link>https://www.gokure.dev/launcher/dev/contributing/oam-reference/common-config/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.gokure.dev/launcher/dev/contributing/oam-reference/common-config/index.html</guid><description>Implementation, history and tests of the entries on the reference page Common config. Text in square brackets is added here to say what a moved sentence refers to.&#10;Common config History: go-kure/launcher#423 (the six properties and command/args read through presence-reporting helpers). go-kure/launcher#447 (a top-level entry with name absent or null refused by schema validation). go-kure/launcher#453 (the parser message for a non-string at those positions). go-kure/launcher#546 (a dotted or longer name refused at conversion by the Service-name rule). go-kure/launcher#690 (daemonset and statefulset stop emitting a Service, and port goes). go-kure/launcher#383 (cpu and memory declared as a string-or-number union). go-kure/launcher#342 (the pod-level resourceClaims property accepted). go-kure/launcher#1228 (a sleep longer than the pod’s terminationGracePeriodSeconds refused). go-kure/launcher#790 (the container windowsOptions key set, its breaking rules for a pod-level value, and the closed key set of the affinity shorthand). go-kure/launcher#384 (pvc.size must be a positive quantity). go-kure/launcher#761 (volumeClaimTemplates.storageClass keeps the absent-versus-empty distinction [since go-kure/launcher#1629, as the spec.storageClassName of a raw claim template]). go-kure/launcher#793 (oam.ShortenNameWithSuffix shortens a qualified volume name over 253 characters). go-kure/launcher#1177 (a volume entry can author its source as the upstream object under a key named like its type). go-kure/launcher#1172 (a volumeMounts item is a closed key set). go-kure/launcher#1193 (one helper reads the mount keys under the rules of upstream ValidateVolumeMounts). go-kure/launcher#1199 (subPath and subPathExpr refused with a .. element in all four places). go-kure/launcher#1198 (the main container reads the same mount keys). go-kure/launcher#1212, go-kure/launcher#1223 (the mount rules held on the typed upstream mounts of the other kinds, with the error naming the container and the mount’s position). go-kure/launcher#321 (an initContainers entry is a closed key set). go-kure/launcher#1225 (port names unique across the pod). go-kure/launcher#1226 (a pod whose containers share a name refused when the document is read). go-kure/launcher#1254 (a container name in either list must be a DNS-1123 label). go-kure/launcher#1278 (the same check again when the pod is generated). go-kure/launcher#448 (the postgresql component’s affinity block contract). go-kure/launcher#452 (a non-string nodeSelector value, a behavior change under v1alpha1). go-kure/launcher#444 later folded the dedicated optionalObject/optionalObjectList/optionalStringList wrappers those six originally used into the base parseObjectField/ parseStringField/etc. helpers themselves — callers now use the base helpers directly, and the null-as-absence behavior applies uniformly rather than only through the wrappers. [the six: env, command, args, initContainers, sidecars and affinity] job refused the name from its introduction; the other six gained the check in go-kure/launcher#407. [the name is a workload component name; job and the other six are the seven workload kinds webservice, worker, deployment, statefulset, daemonset, cronjob and job; deployment, statefulset, daemonset, job and cronjob have since become raw kinds with no main container named after the component (go-kure/launcher#1629), so the reference page lists the kinds that keep the reshaped form] Until go-kure/launcher#405 all three were read with a bare comma-ok assertion, so a handler called directly — without the schema validation an authored document gets first, which already refused these shapes — dropped the value and emitted a container with no requests or limits. [all three: resources, requests and limits] Until go-kure/launcher#423 they were mishandled twice over: a mistyped command: /bin/sh -c true fell through their comma-ok guard and the container built with no command at all, and command: [ls, 3] emitted ["ls"] and said nothing about the 3. Closing it changed their signature to return an error, which is why the fix touches all 9 call sites — the seven workload kinds’ own main containers, plus initContainers and sidecars in common.go [they: command and args; deployment, statefulset, daemonset, job and cronjob have no main container of their own since go-kure/launcher#1629] go-kure/launcher#660; before that the name and protocol were taken unchecked, and a non-list ports, an unknown key, a non-string name or a non-string protocol, which then read as TCP, was dropped [the sentence is about the entries of a sidecar’s ports] before go-kure/launcher#466 it was refused as must be a string, got &lt;nil&gt; [it: a nodeSelector value that is null, such as rack: null] Container fields History: go-kure/launcher#790 (the seven container fields read on every container of a hand-parsed workload kind, and an initContainers entry’s own restartPolicy and restartPolicyRules). go-kure/launcher#1180 (restartPolicy: Always makes an init container entry a native sidecar). go-kure/launcher#1225 (an init container’s ports read as a sidecars entry’s are). go-kure/launcher#1183 (restartPolicyRules refused below Kubernetes 1.35, naming the gate and the version). go-kure/launcher#1230 (the schema names the gate per value (valueGates), so Always is accepted at every version). Tests: One parser (parseContainerFields, container_fields.go) and one schema fragment (schemaContainerFields) serve the three positions, pinned to each other by TestContainerFieldsSchemaMatchesParser. [the three positions: the main container, each initContainers entry and each sidecars entry] Referencing an existing claim (pvc.claimName) History: go-kure/launcher#702 (a pvc volume with claimName mounts an existing claim). go-kure/launcher#787 (the claimObjectName of a volume that synthesizes a claim, role workload-volume-claim). go-kure/launcher#746 (an unauthored storageClass takes the storageClassName of the ClusterProfile pvc capability). go-kure/launcher#761 (a statefulset volumeClaimTemplates entry takes the same default). Raw block volumes (volumeMode: Block) History: go-kure/launcher#385 (a container consumes a Block claim through volumeDevices at a devicePath). go-kure/launcher#790 (the published schema publishes mountPath and devicePath as two optional keys plus a required exclusive group). go-kure/launcher#1629 (a statefulset claim template is a raw PersistentVolumeClaim: the volumeMode: Block claim and the volumeDevices entry that consumes it are authored as the API shapes them, and the claim-template half of the rules above is gone). Pod-level properties History: go-kure/launcher#342 (the seven kind components share one pod-level property surface, parsePodSpec [the reshaped ones only: deployment, statefulset, daemonset, job and cronjob took the upstream pod spec under template.spec (jobTemplate.spec.template.spec on a cronjob) in go-kure/launcher#1629]). go-kure/launcher#1183 (a property whose feature gate is off at the profile’s kubernetesVersion refused). go-kure/launcher#1231 (a profile’s spec.featureGates replaces the release default for a gate it names). go-kure/launcher#1230 (the gate named per value in the schema (valueGates)). go-kure/launcher#1321 (the template of cnpg-pooler left open like the raw-PodSpec kinds, its gated paths named in gatedPaths). go-kure/launcher#1245 (a gated path in an open node refused, naming the authored path). go-kure/launcher#1330 (a gated value refused, naming the authored path and the value). go-kure/launcher#702 (an unset pod kind names no account and sets automountServiceAccountToken: false unless that is authored). go-kure/launcher#790 (the schema publishes the resourceClaims pair resourceClaimName and resourceClaimTemplateName as an exclusive group). go-kure/launcher#312 (the shared enforceExtraContainer helper covers every initContainers and sidecars entry). go-kure/launcher#1171 (the security-context trait merges into what is authored). go-kure/launcher#790 made the container windowsOptions authorable [the container windowsOptions: securityContext.windowsOptions] Deployment-level properties (webservice, worker) History: go-kure/launcher#1629 (the kind-named deployment became a raw kind: its properties are the DeploymentSpec fields, strictly decoded, and the reshaped form moved to the role-deployment member that webservice and worker lower into. A breaking pre-GA change of deployment, with no launcher default: the sentences below that say “all three” or name deployment as one of the sharing kinds are from before it. [the reference page now says two]). go-kure/launcher#1629 (daemonset became a raw kind in the same way: the DaemonSetSpec fields, strictly decoded, with no launcher default and an empty fill report. A breaking pre-GA change; the reshaped form of the kind is gone, and its reference page is the daemonset entry of “Kinds: core workloads”). go-kure/launcher#1629 (job and cronjob became raw kinds in the same way: the JobSpec and CronJobSpec fields, strictly decoded, with no launcher default and an empty fill report. A breaking pre-GA change; the reshaped form of both kinds is gone, and their reference pages are the job and cronjob entries of “Kinds: core workloads”). go-kure/launcher#1629 (statefulset became a raw kind in the same way: the StatefulSetSpec fields, strictly decoded, with no launcher default, and claim templates as raw PersistentVolumeClaim objects. A breaking pre-GA change; the reshaped form of the kind is gone, and its reference page is the statefulset entry of “Kinds: core workloads”. What the kind still does itself: the app label on the pod template, the pvc capability’s storage class on a claim template that authors none, and the policy’s bounds). go-kure/launcher#343 (the kind-named deployment component). go-kure/launcher#341 (DeploymentSpec parsed by parseDeploymentSpec into real appsv1 types, from one fragment all three handlers compose). go-kure/launcher#1216 (the pod template’s podMetadata is the same on all three [deployment, webservice and worker, then; since go-kure/launcher#1629 on the two roles]). Main container ports History: go-kure/launcher#280 (deployment published ports, the main container’s corev1.ContainerPort list; since go-kure/launcher#1629 its ports are template.spec.containers[0].ports). go-kure/launcher#1132 (deployment, statefulset and daemonset implement oam.EndpointProvider from the main container’s ports [since go-kure/launcher#1629, those of template.spec.containers[0] on all three]). go-kure/launcher#225 (job, cronjob and worker report no endpoint). go-kure/launcher#334 (daemonset, statefulset, job and cronjob publish one ports property, with the same entry rules [daemonset, statefulset, job and cronjob no longer: their ports are template.spec.containers[0].ports (jobTemplate.spec.template.spec.containers[0].ports on a cronjob), go-kure/launcher#1629]). go-kure/launcher#343 (deployment dropped port and the Service it drove). go-kure/launcher#690 (daemonset and statefulset drop port and the Service it drove (breaking), and replace it with ports). go-kure/launcher#660 (a sidecar port of the same name as a main container port refused). Raw scheduling properties History: go-kure/launcher#412 (deployment published affinity, tolerations and topologySpreadConstraints as their plain corev1 shapes, parsed by scheduling.go; since go-kure/launcher#1629 they are template.spec.* and no longer read by that parser). go-kure/launcher#790 (the other kind-named workloads (statefulset, daemonset, job, cronjob) publish the same shapes through the same parsers and schemas, and statefulset dropped the four-key affinity shorthand (breaking) [daemonset, statefulset, job and cronjob stopped publishing them at the top level in go-kure/launcher#1629: they are template.spec.*, and jobTemplate.spec.template.spec.* on a cronjob]). go-kure/launcher#1473 (webservice and worker publish tolerations and topologySpreadConstraints as the same shapes, from the same schemas and parsers). What tolerations changed for daemonset [The section of this name on the reference page is gone: daemonset became a raw kind in go-kure/launcher#1629, and its tolerations are template.spec.tolerations, decoded strictly with the rest of the pod spec. The history below stays as it was.]</description></item><item><title>Policy defaults, endpoints and outputs</title><link>https://www.gokure.dev/launcher/dev/contributing/oam-reference/policy-and-endpoints/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.gokure.dev/launcher/dev/contributing/oam-reference/policy-and-endpoints/index.html</guid><description>Implementation, history and tests of the sections on the reference page Policy defaults, endpoints and outputs. Text in square brackets is added here to say what a moved sentence refers to.&#10;Policy defaults &amp; enforcement ordering Implementation: enforce.go’s applyDefaultQuantity [“fills any request/limit the author left unset”, in the reference’s tier 2.] oam.PolicyDefaultReporter: the workload kinds, cnpg-cluster, persistentvolumeclaim and the pvc trait embed an oam.PolicyDefaultLog; the scaler trait implements the interface itself, so that its config stays comparable [“is reported to the provenance report as a policy entry”, in the reference’s tier 2.] oam.BuiltinDefaultReporter, embedded oam.BuiltinDefaultLog in cnpg-cluster [“is reported as a builtin entry”, in the reference’s tier 2.] builtin_defaults.go: BuiltinDefaults() of the workload configs that keep the reshaped form, answered from the paths each parser recorded (parseFills, portFills, accessModesFilled) minus the paths the policy reported, so it is pure; the decision of strategy.type is nonRWXFillsStrategy in deployment_spec.go, which applyNonRWXConstraint takes too [“So is what the parser of webservice and worker fills”, in the reference’s tier 2; the sentence named statefulset, job and cronjob too until go-kure/launcher#1629. The raw deployment, daemonset, statefulset, job and cronjob report no fill.] common.go ["buildResourceRequirements", in the reference’s tier 3.] builtin_defaults_generate.go: the generate-time fills, which BuiltinDefaults of the reshaped controller kinds (builtin_defaults.go) adds through generateFillPaths. They record nothing. They answer from the config with builtinResourceFills and tokenAutomountIsBuiltin, the functions buildResourceRequirements and buildPodSpec decide by, so the report and the generated object cannot disagree [“is reported to the provenance report as a builtin entry”, in the reference’s tier 3.] capPolicyRequestDefaults, resource_policy_defaults.go [“held to the authored limit for that resource”, in the reference’s tier 3.] enforceMaxResources (enforce.go) closes this by calling the same buildResourceRequirements the generator calls, enforcing against its result, and discarding it — buildResourceRequirements deep-copies its maps, so this is read-only and generated output is unchanged. [“this” is the gap described in the History entry below it.] cnpgResourceList [“copies every entry of c.Resources straight onto the Cluster spec”, in the reference’s sentence on postgresql.] common.go’s buildResourceRequirements call sites at the init-container and sidecar builders [“receive the same intrinsic defaults”, in the reference’s paragraph on init containers and sidecars.] enforce.go [“the shared enforceExtraContainer helper”, in the same paragraph.] common.go [“a dedicated JobSpecConfig/parseJobSpec/applyJobSpec”, in the reference’s paragraph on the twelve JobSpec-level properties; all three are gone since go-kure/launcher#1629, and job and cronjob deep-copy their authored spec instead.] applyJobSpec (see the note above) copies every value it writes rather than assigning the config’s own pointers (copyPtr for the scalars, DeepCopy for successPolicy and podFailurePolicy, which each own a slice of rules). A handler config outlives one Generate call and Generate may run more than once, so an aliased pointer would leave a mutable path from the generated object back into the config — a writer through the object would change what the next Generate emits. History: go-kure/launcher#1181 [“an authored opt-out”, in the reference’s tier 1.] go-kure/launcher#1217; the apiserver refuses a request above its limit [“renders a 64Mi request, not 128Mi”, in the reference’s tier 3.] Prior to go-kure/launcher#251 the enforcement check ran before the intrinsic tier was computed, so an application that omitted spec.resources entirely could ship a Deployment whose 100m CPU / 128Mi memory intrinsic defaults exceeded the enforced maximum. [“the enforcement check” is the check of oam.Policy.MaxCPU()/MaxMemory() described in the reference’s paragraph on the effective value.] go-kure/launcher#312 ["ApplyPolicy enforces them too", in the reference’s paragraph on init containers and sidecars.] go-kure/launcher#344 ["job onto its own spec", in the reference’s paragraph on the twelve JobSpec-level properties; since go-kure/launcher#1629 that paragraph is gone, because job and cronjob decode the upstream spec whole.] Tests: TestBuiltinDefaults_ResourceFillsAreWhatGenerationAdds and TestBuiltinDefaults_TokenAutomount derive what generation added from the authored properties, the policy’s report and the generated object, and hold the built-in report to it; TestBuiltinDefaults_ReadingChangesNothing holds that reading the report changes neither it nor the objects [“A value the author wrote or a policy default filled is never a builtin entry”, in the reference’s tier 3.] Both halves are pinned: TestSchemaJobSpec_HasNoSuspendKey on the schema, TestCronjobHandler_SuspendWritesCronJobSpecOnly and TestJobHandler_SuspendWritesJobSpec on the generated objects. [“Both halves” are the two halves described in the reference’s paragraph “One JobSpec field is deliberately not shared: suspend”.] Policy refusal classes Implementation: enforce.go, enforcePodTemplatePolicy, enforceRenderedObjectPolicy [“one check raises it”, in the reference’s first bullet.] History: go-kure/launcher#849 [“instead of matching text”, in the reference’s first paragraph.] Pod view of a monitoring workload object (MonitoringPodSpec) History: go-kure/launcher#974 [“finds none to scan”, in the reference’s first paragraph.] Tests: Each monitoring workload kind adds its case from its own monitoringWorkload mapping; TestMonitoringPodSpec_CoversEveryRegisteredWorkloadKind (pkg/oam/builtin/registry) fails on a registered kind of the operator’s API whose spec lists containers and that has no case. [“its own monitoringWorkload mapping” is also “the same mapping” in the reference’s bullet “What it holds”.] Declared endpoints of a chart Implementation: chartEndpoints [“One shared schema and parser”, in the reference’s first paragraph.] History: go-kure/launcher#1132 [“implement oam.EndpointProvider from an endpoints property”, in the reference’s first paragraph.] Tests: the schema-parity test names endpoints as its one exception ["helmrelease decodes the rest as its HelmReleaseSpec", in the reference’s bullet “Not a chart value”.] Declared outputs History: go-kure/launcher#1259 [“implement oam.OutputProvider”, in the reference’s first paragraph.]</description></item><item><title>Kinds: access and admission</title><link>https://www.gokure.dev/launcher/dev/contributing/oam-reference/kinds-access-and-admission/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.gokure.dev/launcher/dev/contributing/oam-reference/kinds-access-and-admission/index.html</guid><description>Implementation, history and tests of the entries on the reference page Kinds: access and admission. Text in square brackets is added here to say what a moved sentence refers to.&#10;apiservice, validatingwebhookconfiguration, mutatingwebhookconfiguration History: go-kure/launcher#943 (the kind-named projections of apiservice and the two webhook configurations). validatingadmissionpolicy, validatingadmissionpolicybinding, mutatingadmissionpolicy, mutatingadmissionpolicybinding History: go-kure/launcher#943 (the kind-named projections of the four admission-policy kinds). role, rolebinding, clusterrole, clusterrolebinding History: go-kure/launcher#790 (the kind-named projections of the four RBAC kinds). go-kure/launcher#922 (oam.ObjectKindPolicy restricts these kinds). Tests: TestBuiltinMarkerKinds_RequiredMatchMarkers derives each kind’s list from the markers and fails on a dependency bump that changes it. [the list: the fields this entry calls required from the markers] the same test fails if one appears [the same test: TestBuiltinMarkerKinds_RequiredMatchMarkers; one: a field the API marks required that the type leaves out when unauthored] TestKindComponents_OmittedRequiredAndWrittenDefaults holds the four in its table as well, from the same markers: to that, and to no default marked on a field the type writes unauthored. [the four: role, rolebinding, clusterrole and clusterrolebinding; that: the statement on the reference page that the API marks no field of the four required that the type leaves out when unauthored] These checks are of presence [the reference sentence now reads “The checks on required fields are of presence”; these checks: the required-field validation of the four kinds, refuseUnauthoredRequired, called by policyFreeKind.config, which the two tests above hold to the markers]</description></item><item><title>Kinds: networking</title><link>https://www.gokure.dev/launcher/dev/contributing/oam-reference/kinds-networking/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.gokure.dev/launcher/dev/contributing/oam-reference/kinds-networking/index.html</guid><description>Implementation, history and tests of the entries on the reference page Kinds: networking. Every test named here is in pkg/oam/builtin/components/, in the file the note beside it names.&#10;ingress History: go-kure/launcher#790 (the kind-named projection). httproute History: go-kure/launcher#790 (the kind-named projection). go-kure/launcher#883 (the Required list of the HTTPRoute is generated from the CRD). go-kure/launcher#1117 (a rule’s sessionPersistence changed shape at Gateway API v1.7.0, breaking). grpcroute History: go-kure/launcher#790 (the kind-named projection). go-kure/launcher#883 (the list of the fields the GRPCRoute CRD requires is generated). networkpolicy History: go-kure/launcher#790 (the kind-named projection). cilium-networkpolicy Implementation: The list of a rule is held in the internal pkg/oam/internal/requiredfields (CiliumRule), since the cilium-networkpolicy trait reads it too, cut to the three fields of a rule it publishes. (“The list of a rule” is the reference’s “Required” list of the fields the CRD requires inside a rule, with the two more it names; “it” after “reads” is that list, and “it publishes” is the cilium-networkpolicy trait.) History: go-kure/launcher#790 (the kind-named projection). go-kure/launcher#883 (the list of a rule’s required fields is kept by hand, not generated). Tests: TestCiliumNetworkPolicy_RequiredMatchCRD holds the whole list to the CiliumNetworkPolicy CRD of the linked module, its own file and not the cluster-wide policy’s, and to the rule type, under spec and under specs, so a dependency bump that adds, drops or moves one fails there. (“the whole list” is the reference’s “Required” list, the 59 fields and the two more it names, and “one” is a field of that list; the test is in cilium_networkpolicy_internal_test.go.) The positions are found from the Cilium types, and a test fails when a Cilium bump adds a type that unmarshals itself and is not checked. (“The positions” are the positions the reference’s previous sentence lists, those that hold a selector and the two other types under a rule that unmarshal themselves; the sentence names no test.) servicecidr History: go-kure/launcher#790 (the kind-named projection). poddisruptionbudget History: go-kure/launcher#790 (the kind-named projection). endpointslice History: go-kure/launcher#790 (the kind-named projection). Tests: TestKindComponents_OmittedRequiredAndWrittenDefaults holds the kind in its table as well, from the same markers: to that, and to no default marked on a field the type writes unauthored. (“as well” is as TestBuiltinMarkerKinds_RequiredMatchMarkers holds the kind, which the reference names; “the same markers” are the +required and +optional markers of the linked k8s.io/api module named there; “that” is the reference’s “The API marks no field of the kind required that the type leaves out when unauthored”; the test is in kind_api_sets_internal_test.go.) cilium-bgpadvertisement, cilium-bgpclusterconfig, cilium-bgpnodeconfigoverride, cilium-bgppeerconfig Implementation: Each is built on policyFreeKind and emits that one object, named after the component unless objectName names it; the handler adds no label, no annotation and no default. (“Each” is each of the four kinds, cilium-bgpadvertisement, cilium-bgpclusterconfig, cilium-bgpnodeconfigoverride and cilium-bgppeerconfig, and “that one object” is the Cilium object the kind is the projection of.) History: go-kure/launcher#790 (the kind-named projections). go-kure/launcher#922 (the object kind policy, oam.ObjectKindPolicy). go-kure/launcher#883 (the required lists are generated from the linked module’s v2 CRDs). Tests: The same test holds the two to the CRD, and TestKindComponents_OmittedRequiredAndWrittenDefaults shows the refusals. (“The same test” is TestCiliumBGPKinds_RequiredMatchCRD, which the reference’s “These lists are generated” sentence names and which is in cilium_bgp_kinds_internal_test.go; “the two” are the two required fields the reference names, the name of an interface and the addresses of a service, and “the refusals” are the refusals of those two; TestKindComponents_OmittedRequiredAndWrittenDefaults is in kind_api_sets_internal_test.go.) The same test holds each checked rule to the API server’s own expression validator, run over the linked CRD after the defaults the API server fills: it refuses the properties that break the rule, by that rule alone, and accepts the ones next to them, and the kind answers the same on both. (“The same test” is TestCiliumBGPKinds_ExpressionRules, which the reference’s previous sentence names and which is in cilium_bgp_kinds_internal_test.go; “it” is the API server’s own expression validator, and “both” are the properties that break the rule and the ones next to them.) cilium-cidrgroup, cilium-loadbalancerippool, cilium-egressgatewaypolicy, cilium-localredirectpolicy, cilium-nodeconfig Implementation: Each is built on policyFreeKind and emits that one object, named after the component unless objectName names it; the handler adds no label, no annotation and no default of its own. (“Each” is each of the five kinds, cilium-cidrgroup, cilium-loadbalancerippool, cilium-egressgatewaypolicy, cilium-localredirectpolicy and cilium-nodeconfig, and “that one object” is the Cilium object the kind is the projection of.) History: go-kure/launcher#790 (the kind-named projections). go-kure/launcher#922 (the object kind policy, oam.ObjectKindPolicy). go-kure/launcher#883 (the required lists are generated from the linked module’s v2 CRDs). Tests: TestCiliumPlainKinds_NoDefaultIsLost holds the defaults of the linked CRDs to that: one that is not the field’s empty value, on a field that is no pointer, fails there. (“that” is the reference’s “each of the three has that empty value as its default in the CRD”, “one” is a default of the linked CRDs, and the test is in cilium_plain_kinds_internal_test.go.) TestCiliumPlainKinds_RedirectFrontendTakesOneMatcher holds the check to the CRD, and fails where another schema of the five gains such a choice. (“the check” is the reference’s refusal of a redirectFrontend that authors neither or both of addressMatcher and serviceMatcher, “the five” are the five kinds of this entry, and the test is in cilium_plain_kinds_internal_test.go.) cilium-clusterwidenetworkpolicy History: go-kure/launcher#790 (the kind-named projection). Tests: TestCoreKindSchemas_CoverSpec holds the two keys to the linked CiliumClusterwideNetworkPolicy type. (“the two keys” are spec and specs, the two fields the reference names as the component’s properties; the test is in core_kinds_test.go.) TestCiliumClusterwideNetworkPolicy_ObjectRule holds the refusal to the API server’s own expression validator, which accepts an authored specs: [] and would refuse the object written without it; (“the refusal” is the refusal of no rule at all that the reference’s bullet states, and “it” is specs: []; the test is in cilium_clusterwidenetworkpolicy_internal_test.go.) TestCiliumClusterwideNetworkPolicy_RequiredMatchCRD holds the whole list to the CRD of the linked module and to the rule type, under spec and under specs, so a dependency bump that adds, drops or moves one fails there. (“the whole list” is the reference’s “Required” list, the 59 fields and the two more it names, and “one” is a field of that list; the test is in cilium_clusterwidenetworkpolicy_internal_test.go.) TestCiliumClusterwideNetworkPolicy_SchemaChoices lists every choice and expression rule of the linked CRD as checked or left, and fails on one that is neither; (“one” is a choice or an expression rule of the linked CRD that is neither checked nor left; the test is in cilium_clusterwidenetworkpolicy_internal_test.go.) gatewayclass, gateway, listenerset, referencegrant, backendtlspolicy Implementation: Each is built on policyFreeKind (see the storageclass entry) and emits that one object, named after the component unless objectName names it; the handler adds no label, no annotation and no default. (“Each” is each of the five kinds, gatewayclass, gateway, listenerset, referencegrant and backendtlspolicy, “that one object” is the Gateway API object the kind is the projection of, and “the storageclass entry” is on the reference page Kinds: core workloads.) History: go-kure/launcher#790 (the kind-named projections). go-kure/launcher#922 (the object kind policy, oam.ObjectKindPolicy). go-kure/launcher#883 (the required lists are generated from the CRDs the linked module ships). Tests: TestGatewayKinds_DefaultedZeros holds each kind’s list of such fields to the numbers, booleans and strings that are omitted when zero and that a CRD of either channel defaults to something else. (“such fields” are the fields of these types that are omitted when zero or empty, as the reference’s previous sentences name them; the test is in gateway_kinds_internal_test.go.) TestKindComponents_OmittedRequiredAndWrittenDefaults derives that set from the CRDs, at every depth of the five specs, and holds each member to one of two answers: the kind’s refusal, which it runs, or a stated reason the decoded value cannot show the omission. (“that set” is the seven required fields the type omits that the reference lists under “A required field the type omits is refused by the kind itself”, and “the five specs” are the specs of the five kinds; the test is in kind_api_sets_internal_test.go.) None has the second answer. (“None” is none of the members of that set, and “the second answer” is the stated reason the decoded value cannot show the omission.) TestGatewayKinds_RefusedOmissions holds each refused field to being required in both channels, or, for a field only the experimental channel holds (the filter’s protocol), in that channel. (“each refused field” is each of those seven fields; the test is in gateway_kinds_internal_test.go.) tcproute, udproute, tlsroute Implementation: Each is built on policyFreeKind (above), as the kinds of the API’s infrastructure objects are, and emits that one object in the build namespace, named after the component unless objectName names it; the handler adds no label, no annotation and no default. (“Each” is tcproute, udproute and tlsroute; “(above)” is the storageclass entry that the entry for gatewayclass, gateway, listenerset, referencegrant and backendtlspolicy above names, and which is on the reference page Kinds: core workloads; “the kinds of the API’s infrastructure objects” are those five kinds; “that one object” is the Gateway API object the kind is the projection of.) History: go-kure/launcher#790 (the kind-named projections). Tests: TestGatewayRouteKinds_OmissionsAreTheAPIServers and TestGatewayRouteKinds_ExpressionRules go one step further: they run the CRD of each channel through the API server’s own creation path (defaulting, the schema, the expression rules), and hold each refusal of a kind to a refusal of that path, and the object the kind emits for an accepted route to being accepted there. (“one step further” is further than the reference’s “the refused omissions are held to them”, “they” are the two tests this sentence names, and “that path” and “there” are the API server’s creation path; both tests are in gateway_route_kinds_internal_test.go.) The second names every expression rule a CRD declares: the one above, which it shows with routes that break it and routes that keep it, or a rule left to the API server with its reason. (“The second” is TestGatewayRouteKinds_ExpressionRules, “a CRD” is a CRD of either channel, “the one above” is the reference’s rule that a Service backend must name its port, and “it” is that test.) A dependency bump that adds or rewrites a rule fails there. (“there” is TestGatewayRouteKinds_ExpressionRules, the test the previous sentence calls “The second”.)</description></item><item><title>Kinds: Flux</title><link>https://www.gokure.dev/launcher/dev/contributing/oam-reference/kinds-flux/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.gokure.dev/launcher/dev/contributing/oam-reference/kinds-flux/index.html</guid><description>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.&#10;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 unless objectName names 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 timeout of an hour or more is written in minutes, as the timeout of a Flux source is). go-kure/launcher#984 (a Receiver resource’s apiVersion is checked at build time). go-kure/launcher#1010 (the version the refusal names for a kind outside the Receiver API’s kind enum). 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 pagerduty Provider’s routing key in channel). go-kure/launcher#1079 (a trait in a later group that makes a required read is refused). Tests: TestFluxKinds_DefaultedZeros holds 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, as eventSeverity and filter.limit.) TestFluxKinds_MarkersClassified fails 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 a resourcesetinputprovider is derived from its CRD instead, and held to that CRD by the API server” names; it is in kind_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-term pragma comment lines (see “Vendored CRDs” under the required fields) (testdata/upstream/&lt;repository&gt;/, scripts/vendor-flux-crds.sh, each file checked against its git blob id by TestVendoredCRDs_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 than resourcesetinputprovider; “the required fields” are the reference’s Required fields a kind writes unauthored and does not refuse; “the same test” is TestKindComponents_GeneratedRequiredBothWays, which is in kind_required_internal_test.go; TestVendoredCRDs_MatchSource, which checks each vendored file, is in vendored_crds_internal_test.go.) TestFluxKinds_ExpressionRules reads every such rule from the markers of the linked source and holds the list (fluxRulesLeft) to them, and TestFluxOperatorKinds_ExpressionRulesMatchCRD holds the ResourceSetInputProvider’s list to the x-kubernetes-validations of 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_InUpstreamEnum holds the list to the API’s values of type. (“the list” is the reference’s list of Provider types whose address is the credential, or can be; the test is in fluxcd_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-kustomization rather than kustomization). 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). 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 of KustomizationSpec”; the sentence names no test.) 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 url must not carry a credential). go-kure/launcher#601 (an interval is checked as on helmrelease). go-kure/launcher#606 (the timeout pattern of the source CRDs has no h unit). go-kure/launcher#619 (a timeout of an hour or more is emitted with its hours folded into minutes). go-kure/launcher#790 (an authored verify that names no provider is written with provider: cosign, and an authored provider: "" 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”.)</description></item><item><title>Kinds: monitoring</title><link>https://www.gokure.dev/launcher/dev/contributing/oam-reference/kinds-monitoring/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.gokure.dev/launcher/dev/contributing/oam-reference/kinds-monitoring/index.html</guid><description>Implementation, history and tests of the entries on the reference page Kinds: monitoring. Every test named here is in pkg/oam/builtin/components/, in the file the note beside it names.&#10;alertmanager History: go-kure/launcher#790 (the kind-named projections) [The reference cited it after “alertmanager” in its introduction.] go-kure/launcher#922 (the object kind policy, oam.ObjectKindPolicy) [The reference cited it after “build through the object kind policy” in its Validation section.] go-kure/launcher#1300 (whether an app.yaml may set alertmanagerConfigFileSystemMode: AllowAll) [The reference cited it after “app.yaml may set it is open” in its Properties section.] go-kure/launcher#883 (the generated required lists, refusing an omitted CRD-required field the Go type writes empty) [The reference cited it after “The kind’s required list is generated” in its Properties section; and after “operator’s CRD vendored for the tests” in its Validation section.] go-kure/launcher#1022 (the refusal that names each field when several are below their versions) [The reference cited it after “claimed for any, as on prometheus” in its Validation section.] go-kure/launcher#1211 (refusing an absolute or .. subPath in volumeMounts) [The reference cited it after “breaks a rule of a mount” in its Validation section.] go-kure/launcher#1227 (the typed volumeMount rules) [The reference cited it after “breaks a rule of a mount” in its Validation section.] go-kure/launcher#1050 (the mount-path spelling rule of the monitoring kinds) [The reference cited it after “CRI-O makes only one of them” in its Validation section.] go-kure/launcher#959 (the Service-name check and RelaxedServiceNameValidation) [The reference cited it after “unless spec.featureGates sets that gate on” in its Validation section.] go-kure/launcher#1230 (version-gated values: tolerations, the Service name rule and trafficDistribution) [The reference cited it after “unless spec.featureGates sets that gate on” in its Validation section.] go-kure/launcher#963 (portName against the containers patch) [The reference cited it in its Validation section.] Tests: TestMonitoringWorkloadKinds_DefaultedZeros derives the list. It reads the type, the default markers of the operator’s source, the field comments of the Kubernetes types, and the API server’s defaulting code for their strings. It then shows each field refused on a document. [“The list” is the list of fields the type cannot carry, which the reference page gives, “It” is the test, and the test is in monitoring_workload_internal_test.go.] TestMonitoringWorkloadKinds_HostNetworkHostPort shows the hostPort refusal. [“The hostPort refusal” is the refusal of a hostPort written as 0 under hostNetwork: true, which the reference page gives, and the test is in monitoring_workload_internal_test.go.] TestAlertmanagerVersionGates_MatchVendoredSource parses every version comparison of the operator’s package pkg/alertmanager (every Go file of it, its tests aside; at v0.95.1 the comparisons are in statefulset.go, amcfg.go and operator.go) and holds each to this list, or to the reason it gates no field of this kind (the configuration of a receiver, a route or a configSecret Secret); the files, with the operator’s pkg/operator/defaults.go and pkg/operator/validations.go, are vendored unmodified under testdata/upstream/prometheus-operator, with the project’s LICENSE and NOTICE and a SOURCE file naming each file’s git blob id, and mise run vendor-prometheus-operator-gates &lt;tag&gt; re-fetches them for the tag go.mod links. [“This list” is the list of fields the operator reads only from some Alertmanager version on, which the reference page gives, and the test is in alertmanager_version_gates_internal_test.go.] TestAlertmanagerFeatureFlags_MatchVendoredSource holds the names, and NewFlags statement by statement, to featurecontrol.go of each minor’s latest release, vendored unmodified under testdata/upstream/alertmanager with the project’s LICENSE, each release’s NOTICE and a SOURCE file naming each file’s git blob id; mise run vendor-alertmanager-features 0.27 0.34 re-fetches them. [“The names” are the feature flag names the reference page lists, and the test is in alertmanager_features_internal_test.go.] TestMonitoringWorkloadKinds_CredentialsHeldOrListed derives the fields of the operator’s types whose name suggests a credential and holds each to a stated reason it holds none. [“One” is a credential, and the test is in monitoring_workload_internal_test.go.] thanosruler History: go-kure/launcher#790 (the kind-named projections) [The reference cited it after “thanosruler” in its introduction.] go-kure/launcher#883 (the generated required lists, refusing an omitted CRD-required field the Go type writes empty) [The reference cited it in its Properties section.] go-kure/launcher#959 (the Service-name check and RelaxedServiceNameValidation) [The reference cited it after “unless spec.featureGates sets RelaxedServiceNameValidation on " in its Validation section.] go-kure/launcher#1230 (version-gated values: tolerations, the Service name rule and trafficDistribution) [The reference cited it after “unless spec.featureGates sets RelaxedServiceNameValidation on " in its Validation section.] go-kure/launcher#1211 (refusing an absolute or .. subPath in volumeMounts) [The reference cited it after “breaks a rule of a mount” in its Validation section.] go-kure/launcher#1227 (the typed volumeMount rules) [The reference cited it after “breaks a rule of a mount” in its Validation section.] go-kure/launcher#1050 (the mount-path spelling rule of the monitoring kinds) [The reference cited it after “CRI-O makes only one of them” in its Validation section.] go-kure/launcher#976 (refusing a field the operator drops below the ThanosRuler version) [The reference cited it after “where version is below that version” in its Validation section.] go-kure/launcher#1022 (the refusal that names each field when several are below their versions) [The reference cited it after “claimed for any, as on prometheus” in its Validation section.] go-kure/launcher#1023 (refusing a remote write azureAd with no authentication method) [The reference cited it after “sdk and workloadIdentity), as on prometheus” in its Validation section.] go-kure/launcher#1020 (refusing the remote write fields the operator drops at every Thanos version) [The reference cited it after “azureAd.scope, or sigv4.externalId with a roleArn” in its Validation section; and after “passes to Thanos at no version” in its Validation section.] Tests: TestCoreKindSchemas_CoverSpec records it as a mapping (externalLabels for labels), so a second renamed field fails there until it is listed. [“It” is the rename of the spec’s labels to the externalLabels property, which the reference page gives, “there” is that test, and the test is in core_kinds_test.go.] TestThanosRulerVersionGates_MatchVendoredSource parses every version comparison of the operator’s package pkg/thanos (every Go file of it, its tests aside), vendored as for alertmanager, and holds each to this list. [“This list” is the list of fields the operator reads only from some Thanos version on, which the reference page gives, “as for alertmanager” refers to the vendoring of the test of the alertmanager entry above, and the test is in thanosruler_version_gates_internal_test.go.] TestThanosRulerRemoteWriteTexts_MatchVendoredSource holds the list to every field createOrUpdateRulerConfigSecret ignores with minimum version none. [“The list” is the list of remote write fields the operator drops at every Thanos version, which the reference page gives, and the test is in thanosruler_version_gates_internal_test.go.] TestMonitoringExcludedGroup_MatchesMarkers holds the written value to the default and the enum of the linked module’s source. [“The written value” is monitoring.coreos.com, written for the group of an excluded object, and the test is in monitoring_excluded_groups_internal_test.go.] TestMonitoringWorkloadKinds_PodFieldsHeldOrListed holds every field of the spec that shapes the pods to a refusal shown on a document or a stated reason, as for alertmanager. [“As for alertmanager” refers to the description of the test of the alertmanager entry, which stays on the reference page, and the test is in monitoring_workload_internal_test.go.] TestMonitoringWorkloadKinds_CredentialsHeldOrListed derives the fields whose name suggests a credential and holds each to the policy or a stated reason. [The test is in monitoring_workload_internal_test.go.] prometheus History: go-kure/launcher#790 (the kind-named projections) [The reference cited it after “prometheus” in its introduction.] go-kure/launcher#959 (the Service-name check and RelaxedServiceNameValidation) [The reference cited it after “unless spec.featureGates sets that gate on” in its Properties section.] go-kure/launcher#1230 (version-gated values: tolerations, the Service name rule and trafficDistribution) [The reference cited it after “unless spec.featureGates sets that gate on” in its Properties section.] go-kure/launcher#963 (portName against the containers patch) [The reference cited it in its Properties section.] go-kure/launcher#883 (the generated required lists, refusing an omitted CRD-required field the Go type writes empty) [The reference cited it in its Properties section.] go-kure/launcher#1211 (refusing an absolute or .. subPath in volumeMounts) [The reference cited it after “breaks a rule of a mount” in its Validation section.] go-kure/launcher#1227 (the typed volumeMount rules) [The reference cited it after “breaks a rule of a mount” in its Validation section.] go-kure/launcher#1050 (the mount-path spelling rule of the monitoring kinds) [The reference cited it after “CRI-O makes only one of them” in its Validation section.] go-kure/launcher#1055 (a log file on the read-only root filesystem) [The reference cited it after “mounts its log-file volume, is refused” in its Validation section; and after “filesystem, whose content is not judged” in its Validation section.] go-kure/launcher#1051 (a log file under a readOnly mount whose content may link to a writable volume) [The reference cited it after “file for appending (util/logging/file.go:43 at v3.7.0)” in its Validation section.] go-kure/launcher#1023 (refusing a remote write azureAd with no authentication method) [The reference cited it after “of managedIdentity, oauth, sdk and workloadIdentity” in its Validation section.] go-kure/launcher#1047 (a version-gate refusal that suggests a version which drops another authored field) [The reference cited it after “only leaving the fields refused unset” in its Validation section.] go-kure/launcher#1022 (the refusal that names each field when several are below their versions) [The reference cited it after “the versions it is read at” in its Validation section.] go-kure/launcher#1018 (an Alertmanager endpoint relabeling targetLabel outside the label-name scheme of the Prometheus version) [The reference cited it after “it refuses the object at reconcile” in its Validation section.] go-kure/launcher#1038 (a labelmap replacement outside the label-name scheme below Prometheus 3.0.0) [The reference cited it after “the object at reconcile below it” in its Validation section.] go-kure/launcher#1019 (topology sharding below the attach_metadata versions) [The reference cited it in its Validation section.] Tests: TestMonitoringExcludedGroup_MatchesMarkers holds the written value to the module’s default and enum. [“The module” is the linked module, and the test is in monitoring_excluded_groups_internal_test.go.] TestThanosDroppedMountFields holds the list to every field of the type. [“The list” is the list of fields of a thanos.volumeMounts entry that the operator drops, which the reference page gives, and the test is in prometheus_internal_test.go.] TestPrometheusRelabelTargetLabels_MatchVendoredSource holds the threshold, the actions and the lists to the operator’s source. [“The threshold” is Prometheus 3.0.0, “the actions” and “the lists” are the relabeling actions and the four lists the reference page names, and the test is in prometheus_relabel_target_label_internal_test.go.] TestPrometheusRelabelLabelmapReplacement_MatchVendoredSource holds the pattern and the action to the operator’s source. [“The pattern” and “the action” are the labelmap replacement pattern and the labelmap action the reference page names, and the test is in prometheus_relabel_target_label_internal_test.go.] TestPrometheusVersionGates_MatchVendoredSource parses every version comparison of the operator’s packages pkg/prometheus, pkg/prometheus/server and pkg/prometheus/validation (every Go file, its tests aside) and holds each to these lists, or to the reason it gates no field of this kind (a field of a ServiceMonitor, PodMonitor, Probe or ScrapeConfig object, the configuration of a PrometheusAgent, a choice of how the operator spells a flag), and the two defaults to the operator’s pkg/operator/defaults.go; the files are vendored as for alertmanager. [“These lists” are the lists of fields the operator reads only from some Prometheus or Thanos version on, which the reference page gives, “as for alertmanager” refers to the vendoring of the test of the alertmanager entry above, and the test is in prometheus_version_gates_internal_test.go.] TestPrometheusTopologyNodeZone_MatchVendoredSource holds both versions to the vendored promcfg.go. [“Both versions” are Prometheus 2.35.0 for a PodMonitor and 2.37.0 for a ServiceMonitor, which the reference page names, and the test is in prometheus_topology_internal_test.go.] TestMonitoringWorkloadKinds_PodFieldsHeldOrListed holds every top-level field of the spec that shapes the pods to a refusal shown on a document or a stated reason; shards and the sidecar’s fields are not top-level pod fields of the derivation, and shards, thanos.image and thanos.resources are held by TestPrometheus_ReplicasTimesShards and TestPrometheus_PolicyRefusals instead. [“The derivation” is the derivation of the fields by the test of the alertmanager entry, which the reference page describes, TestMonitoringWorkloadKinds_PodFieldsHeldOrListed is in monitoring_workload_internal_test.go, and TestPrometheus_ReplicasTimesShards and TestPrometheus_PolicyRefusals are in prometheus_test.go.] TestMonitoringWorkloadKinds_CredentialsHeldOrListed derives the fields whose name suggests a credential and holds each to the policy or a stated reason. [The test is in monitoring_workload_internal_test.go.] servicemonitor, podmonitor, prometheus-probe, prometheusrule History: go-kure/launcher#790 (the kind-named projections) [The reference cited it after “servicemonitor, podmonitor, prometheus-probe, prometheusrule” in its introduction.] go-kure/launcher#922 (the object kind policy, oam.ObjectKindPolicy) [The reference cited it after “build through the object kind policy” in its Validation section.] go-kure/launcher#883 (the generated required lists, refusing an omitted CRD-required field the Go type writes empty) [The reference cited it after “These lists are generated” in its Properties section.] Tests: TestMonitoringKinds_DefaultedZeros holds each kind’s list of such fields to the numbers, booleans and strings that are omitted when zero and defaulted to something else, from the default markers of the linked module’s source. [“Such fields” are the fields the type omits when zero and the API defaults to something else, which the reference page names, and the test is in monitoring_kinds_internal_test.go.] TestKindComponents_OmittedRequiredAndWrittenDefaults derives these fields for every kind in its table, from the CRD the linked module ships or, where it ships none, from the markers of its source. It holds each to a refusal, shown on a document, or to a stated reason. The same test derives the fields the API defaults and the type writes unauthored, where the default would never apply, and holds each to one of three answers: refused, filled by the kind with the API’s default, or harmless with the reason. [“These fields” are the required fields the type leaves out when empty, which the reference page names, “its table” is the table of kind components in that test, and the test is in kind_api_sets_internal_test.go.] The table holds the kind components that decode their properties into an upstream type, but for two groups. The httproute kind is not in it: the experimental-channel CRD requires the protocol of an externalAuth filter, of a rule and of a backend reference, the type leaves an empty one out, and the kind does not refuse it. The Flux kinds (helmrelease, fluxcd-kustomization, helmrepository, ocirepository, gitrepository, bucket, helmchart) are not in it either: no row is written for them. [“The table” is the table of kind components in the test of the previous entry.] TestKindComponents_GeneratedRequiredBothWays holds each field both ways on the kind, and runs a path of every type that holds one through the operator’s CRD, vendored from its repository at the linked release (the module ships none). [“Each field” is a field the generated lists in the reference name, and the test is in kind_required_internal_test.go.]</description></item><item><title>Kinds: MetalLB</title><link>https://www.gokure.dev/launcher/dev/contributing/oam-reference/kinds-metallb/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.gokure.dev/launcher/dev/contributing/oam-reference/kinds-metallb/index.html</guid><description>Implementation, history and tests of the entries on the reference page Kinds: MetalLB. Every test named here is in pkg/oam/builtin/components/metallb_kinds_internal_test.go unless a line says another file.&#10;metallb-bfdprofile Implementation: built on policyFreeKind (see the storageclass entry on the reference page Kinds: core workloads), and emits that one object. History: go-kure/launcher#790 (the kind-named projection); go-kure/launcher#922 (the object kind policy, oam.ObjectKindPolicy). Tests: TestMetalLBKinds_NoDefaultIsLost fails on a default a dependency bump adds to a field that could not carry an authored empty value. TestMetalLBKinds_RequiredMatchCRD holds that to the linked module’s v1beta1 CRD (“that” is the reference’s “Required: nothing”). The CRD declares none; TestMetalLBKinds_ExpressionRules fails on one that is added (“none” is the CRD’s expression rules). metallb-bgpadvertisement Implementation: built on policyFreeKind as metallb-bfdprofile is, and emits that one object. History: go-kure/launcher#790 (the kind-named projection); go-kure/launcher#883 (the Required list is generated from the linked module’s v1beta1 CRD); go-kure/launcher#922 (the object kind policy). Tests: TestMetalLBKinds_NoDefaultIsLost holds the defaults of the linked CRD to that (“that” is the reference’s account of the two aggregation lengths: pointers, whose API defaults are 32 and 128, one route per address). TestMetalLBKinds_RequiredMatchCRD holds it to that CRD as well (“it” is the Required list, generated from the linked module’s v1beta1 CRD). TestMetalLBKinds_ExpressionRules holds the kind’s answer to the API server’s for the linked CRD, on properties that break the rule and on properties that keep it, and fails on a rule that is added or reworded. metallb-bgppeer Implementation: built on policyHeldKind, the helper of policyFreeKind with one check under the environment policy, and emits that one object. The version it is built at, and why, are in the reference. History: go-kure/launcher#790 (the kind-named projection); go-kure/launcher#883 (the Required list is generated from the linked module’s v1beta2 CRD); go-kure/launcher#922 (the object kind policy). Tests: TestMetalLBKinds_EmitTheServedVersion holds each kind to the version its CRD serves and stores. TestMetalLBKinds_NoDefaultIsLost holds the kind’s list of such fields to the linked CRD (“such fields” are the reference’s fields with a default the type cannot carry, as peerPort). TestMetalLBKinds_RequiredMatchCRD holds it to that CRD as well (“it” is the Required list, generated from the linked module’s v1beta2 CRD). TestMetalLBKinds_ExpressionRules holds the kind’s answer to the API server’s for the linked CRD, on properties that break each rule and on properties that keep it, and fails on a rule that is added or reworded. TestMetalLBBGPPeerKind_SessionPassword holds this (“this” is the reference’s account of password under each policy; the test is in metallb_bgppeer_test.go). metallb-community Implementation: built on policyFreeKind as metallb-bfdprofile is, and emits that one object. History: go-kure/launcher#790 (the kind-named projection); go-kure/launcher#922 (the object kind policy). Tests: TestMetalLBKinds_NoDefaultIsLost fails on a default a dependency bump adds to a field that could not carry an authored empty value. TestMetalLBKinds_RequiredMatchCRD holds that to the linked module’s v1beta1 CRD (“that” is the reference’s “Required: nothing”). The CRD declares none; TestMetalLBKinds_ExpressionRules fails on one that is added (“none” is the CRD’s expression rules). metallb-ipaddresspool Implementation: built on policyFreeKind, and emits that one object. The type name carries the metallb- prefix as the kinds of Cilium’s API carry theirs: both APIs have a pool of addresses and an advertisement for BGP. History: go-kure/launcher#790 (the kind-named projection); go-kure/launcher#883 (the Required list is generated from the fields the linked module’s v1beta1 CRD requires and the type writes unauthored); go-kure/launcher#922 (the object kind policy). Tests: TestMetalLBKinds_NoDefaultIsLost holds the defaults of the linked CRD to that: one that is not the field’s empty value, on a field that is no pointer, fails there (“that” is the reference’s account of autoAssign and avoidBuggyIPs). A dependency bump that adds, drops or moves one fails until it is regenerated; TestMetalLBKinds_RequiredMatchCRD holds it to that CRD as well (“one” is a required field, and “it” is the Required list, generated from the fields the linked module’s v1beta1 CRD requires and the type writes unauthored). The CRD declares none; TestMetalLBKinds_ExpressionRules fails on one that is added (“none” is the CRD’s expression rules). metallb-l2advertisement Implementation: built on policyFreeKind as metallb-ipaddresspool is, and emits that one object. History: go-kure/launcher#790 (the kind-named projection); go-kure/launcher#883 (the Required list is generated from the linked module’s v1beta1 CRD); go-kure/launcher#922 (the object kind policy). Tests: TestMetalLBKinds_RequiredMatchCRD holds it to that CRD as well (“it” is the Required list, generated from the linked module’s v1beta1 CRD). The CRD declares none; TestMetalLBKinds_ExpressionRules fails on one that is added (“none” is the CRD’s expression rules).</description></item><item><title>Kinds: PostgreSQL and CloudNativePG</title><link>https://www.gokure.dev/launcher/dev/contributing/oam-reference/kinds-postgres/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.gokure.dev/launcher/dev/contributing/oam-reference/kinds-postgres/index.html</guid><description>Implementation, history and tests of the entries on the reference page Kinds: PostgreSQL and CloudNativePG. Every test named here is in pkg/oam/builtin/components/, in the file the note beside it names.&#10;cnpg-imagecatalog, cnpg-clusterimagecatalog, cnpg-backup, cnpg-scheduledbackup, cnpg-databaserole, cnpg-publication, cnpg-subscription History: go-kure/launcher#790 (the kind-named projections) [The reference cited it after “cnpg-clusterimagecatalog, cnpg-backup, cnpg-scheduledbackup, cnpg-databaserole, cnpg-publication, cnpg-subscription” in its introduction.] go-kure/launcher#1001 (complete CNPG backup and recovery to S3 through OAM lowering) [The reference cited it after “a cnpg-scheduledbackup for each backup.schedules entry” in its Outputs section.] go-kure/launcher#922 (the object kind policy, oam.ObjectKindPolicy) [The reference cited it after “through the object kind policy (oam.ObjectKindPolicy” in its Validation section.] go-kure/launcher#883 (refusing an omitted CRD-required field the Go type writes empty) [The reference cited it after “require and the types write unauthored” in its Validation section.] Tests: With connectionLimit these are every such field of the seven specs; TestCnpgKindsDefaultedZeroFields_MatchCRD derives each kind’s list from the linked CRDs and fails on another. [“These” are the seven string fields the CRDs default, which the reference page gives, “each kind’s list” is the list of such fields of that kind, “another” is a field of the same kind that the list does not hold, and the test is in cnpg_kinds_defaulted_zero_internal_test.go.] TestCnpgPublication_TargetAsWritten shows the first for each of the four, and the second for the three that can stand alone (an empty columns alone is a table that lists none). [“The first” is the case in which the API server refuses the document as authored and accepts the object the build writes, “the second” is the case in which the API server accepts the document as authored and the build refuses it, “the four” are allTables: false and an empty objects, tablesInSchema or columns, which the reference page gives, and the test is in cnpg_further_kinds_internal_test.go.] TestCnpgFurtherKinds_ExpressionRules lists all 26 with what is done with each, and fails on a rule that is added, dropped or reworded. [“All 26” are the 26 expression rules of the seven CRDs, which the reference page counts, and the test is in cnpg_further_kinds_internal_test.go.] It holds each of the 15 to the API server’s own expression validator, run over the linked CRD after the defaults the API server fills: with every other rule set aside, the validator refuses the properties that break the rule, and with every rule it accepts the ones next to them and the object the build writes for them; the build answers the same on both. [“It” is TestCnpgFurtherKinds_ExpressionRules, which the previous entry names, “the 15” are the 15 rules that read one document, which the reference page names, and the test is in cnpg_further_kinds_internal_test.go.] TestImageTagRule_CnpgImageCatalogs holds the three, on both kinds. [“The three” are the three fields of a catalog that name an image, which the reference page gives, “both kinds” are cnpg-imagecatalog and cnpg-clusterimagecatalog, and the test is in image_tag_rule_test.go.] TestCnpgImageCatalogs_ImagesAreHeldToTheAllowedRegistries holds the three, on both kinds. [“The three” are the three fields of a catalog that name an image, which the reference page gives, “both kinds” are cnpg-imagecatalog and cnpg-clusterimagecatalog, and the test is in cnpg_further_kinds_test.go.] postgresql History: go-kure/launcher#448 (a mistyped affinity property and its sub-fields silently discarded) [The reference cited it after “not a fallback to the default” in its Properties section.] go-kure/launcher#466 (string maps that silently drop non-string values) [The reference cited it after “as nodeSelector when several are wrong” in its Properties section.] go-kure/launcher#281 (the operator-CR component pattern, with postgresql as a lowering onto a CNPG Cluster component) [The reference cited it after “with -&lt;n&gt; appended. Behavior-changing under launcher.gokure.dev/v1alpha1” in its Outputs section; and after “A component lowering rule (PostgresqlRule, postgresql_lowering.go” in its Outputs section.] go-kure/launcher#1001 (complete CNPG backup and recovery to S3 through OAM lowering) [The reference cited it after “Backup” in its Outputs section; and after “Recovery” in its Outputs section; and after “is named. The recovery ObjectStore’s name” in its Validation section; and after “refused, naming both. The ScheduledBackups’ names” in its Validation section.] go-kure/launcher#1032 (refusing a backup schedule the operator would never act on) [The reference cited it after “the operator’s look-ahead from every instant” in its Outputs section.] go-kure/launcher#615 (refusing component names CloudNativePG rejects as a Cluster name) [The reference cited it after “it is now refused at build” in its Validation section.] go-kure/launcher#589 (endpoint selectors that carry the raw component name and break over 63 characters) [The reference cited it after “it is now refused at build” in its Validation section.] go-kure/launcher#539 (an empty version yielding an image reference with an empty tag) [The reference cited it after “that only the image pull rejected” in its Validation section.] go-kure/launcher#623 (storage size and instance count not fully validated) [The reference cited it after “it is now refused at build” in its Validation section.] go-kure/launcher#790 (the kind-named projections) [The reference cited it after “(ValidateImageRef), with or without a policy” in its Validation section; and after “enabled pooler without pooler.image is refused” in its Validation section; and after “Two object store paths are required” in its Validation section; and in its Validation section; and in its Properties section.] go-kure/launcher#1269 (honouring or refusing bootstrap.initdb on a postgresql component) [The reference cited it after “bootstrap is declared key by key” in its Properties section.] go-kure/launcher#1027 (declaring operator and plugin prerequisites machine-readably) [The reference cited it after “for a tool to read (ContractMetadata.Prerequisites” in its Outputs section.] go-kure/launcher#1044 (the archive-into-source check not seeing a sibling’s inline recovery store) [The reference cited it after “shortened as every generated name is” in its Outputs section.] go-kure/launcher#1041 (transitive generated ordering not visible to a sibling lowering’s extra member) [The reference cited it after “its Pooler, Databases and ScheduledBackups too” in its Outputs section.] go-kure/launcher#512 (optional properties read with bare type assertions) [The reference cited it after “goes through the same presence-reporting helpers” in its Validation section.] go-kure/launcher#659 (a managed role’s connectionLimit: 0 dropped) [The reference cited it after “is a managed role’s connectionLimit: 0” in its Validation section.] go-kure/launcher#787 (a name override for every generated name: an author property and a consumer hook) [The reference cited it after “The Pooler’s and the Databases’ names” in its Validation section; and after “The Cluster’s and the ObjectStore’s names” in its Validation section.] go-kure/launcher#1261 (the interpreter for configuration-defined component models) [The reference cited it after “the name of the Secret &lt;cluster&gt;-app” in its Validation section.] go-kure/launcher#1230 (version-gated values: tolerations, the Service name rule and trafficDistribution) [The reference cited it after “naming the entry by its index” in its Validation section.] Tests: TestPostgresqlRule_UnauthoredRequiredStrings reads all eleven in the lowered component. [“All eleven” are the two strings whose parent the lowering fills and the other nine, which the reference page gives, and the test is in postgresql_required_strings_internal_test.go.] TestPostgresqlRule_BlockNotBuilt holds each case. [“Each case” is each of the cases the reference page gives above it: an authored enabled: false, a block with nothing in it and backup: {}, and the test is in postgresql_dropped_values_internal_test.go.] cnpg-cluster History: go-kure/launcher#623 (storage size and instance count not fully validated) [The reference cited it after “the API server’s positive storage-request check” in its Validation section.] go-kure/launcher#790 (the kind-named projections) [The reference cited it after “is refused, with the registry class” in its Validation section; and after “instance pods as an image volume” in its Validation section; and after “generation, with or without a policy” in its Validation section.] go-kure/launcher#883 (refusing an omitted CRD-required field the Go type writes empty) [The reference cited it after “The kind’s required list is generated” in its Validation section.] Tests: TestCnpgClusterSchema_CoversClusterSpec pins the schema to ClusterSpec by reflection: each json field is published with its type or listed with a reason in cnpgClusterExcludedFields (empty today), and a schema key with no field or a stale exclusion also fails, so a CNPG bump that adds, removes or retypes a field names it. [“The schema” is the cnpg-cluster property schema, which the reference page describes, “a CNPG bump” is a new version of the CloudNativePG module the kind links, and the test is in cnpg_cluster_schema_test.go.] cnpg-pooler, cnpg-database, cnpg-objectstore History: go-kure/launcher#790 (the kind-named projections) [The reference cited it after “top-level property of each as required” in its Validation section; and after “is refused, with the registry class” in its Validation section.] go-kure/launcher#1321 (the gate check not reaching fields under the cnpg-pooler template open schema) [The reference cited it after “when it sets the gate off” in its Validation section.] go-kure/launcher#883 (refusing an omitted CRD-required field the Go type writes empty) [The reference cited it in its Validation section.] Tests: TestKindComponents_OmittedRequiredAndWrittenDefaults derives the fields from the CRD and shows the refusals. [“The fields” are the fields of a Pooler template that the CRD requires and the pod spec’s type leaves out when they are empty, which the reference page gives, “the refusals” are the refusals of those fields, and the test is in kind_api_sets_internal_test.go.] TestKindComponents_NullRequired derives these fields and pgbouncer from the CRD and shows each answer by running the CRD’s schema validator on the object. [“These fields” are the fields the CRD requires under template.spec that the pod spec’s type writes as null when they are unauthored, which the reference page gives, and the test is in kind_null_required_internal_test.go.] The same test derives it, as the one field of a Pooler the type writes unauthored as a zero value the CRD’s own rule refuses. [“The same test” is TestKindComponents_NullRequired, which the previous entry names, “it” is the key of an authored pgbouncer.imageCatalogRef, which the reference page gives, and the test is in kind_null_required_internal_test.go.]</description></item><item><title>Kinds: secrets, certificates and backup</title><link>https://www.gokure.dev/launcher/dev/contributing/oam-reference/kinds-secrets-certs-backup/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.gokure.dev/launcher/dev/contributing/oam-reference/kinds-secrets-certs-backup/index.html</guid><description>Implementation, history and tests of the entries on the reference page Kinds: secrets, certificates and backup. Every test named here is in pkg/oam/builtin/components/, in the file the note beside it names.&#10;issuer, clusterissuer, certificate Implementation: Each is built on policyHeldKind (policyFreeKind with a policy check, see the storageclass entry) and emits that one object, named after the component unless objectName names it; the handler adds no label, no annotation and no default. (“Each” is issuer, clusterissuer and certificate.) History: go-kure/launcher#790 (the kind-named projections); go-kure/launcher#922 (the object kind policy, oam.ObjectKindPolicy). Tests: TestCertManagerKinds_NoDefaultedZeros holds the types to having no number, boolean or string that is omitted when zero and that the CRD defaults to something else. (“the types” are the reference’s spec types, IssuerSpec and CertificateSpec, and the test is in certmanager_kinds_internal_test.go.) TestKindComponents_OmittedRequiredAndWrittenDefaults derives the two from the CRD and shows the refusals. (“the two” are the cron and the windowDuration of a renewal window, and “the refusals” are the refusals of either when it is left out, and the test is in kind_api_sets_internal_test.go.) TestKindComponents_NullRequired shows each refusal by running the CRD’s schema validator on the object the type would encode. (“each refusal” is the refusal of an unauthored nodeSelectorTerms and of an unauthored name of a parent reference, in an ACME HTTP01 solver, and the test is in kind_null_required_internal_test.go.) A dependency bump that adds, drops or moves one fails TestKindComponents_RequiredIsGenerated until the list is regenerated. (“one” is a field the reference’s generated lists name, and “the list” is that list, and the test is in kind_required_internal_test.go.) TestKindComponents_GeneratedRequiredBothWays builds each field authored and refuses its omission, and runs one per type through the CRD’s own validation, which refuses it too. (“each field” is a field the reference’s generated lists name, and the test is in kind_required_internal_test.go.) TestLabelSelectorKinds_CoverEverySelector shows, at each of the 16 label selectors, what the API server answers for an expression without its key or its operator. (The test is in label_selector_internal_test.go.) secretstore, clustersecretstore, externalsecret, clusterexternalsecret Implementation: All four are built on policyHeldKind: the stores for the credentials a provider takes as a value, the two external-secret kinds for the one field that has the operator write another kind than a Secret (target.manifest, under Policy below). (“All four” are secretstore, clustersecretstore, externalsecret and clusterexternalsecret, and “Policy” is the Policy paragraph in the reference’s Validation section.) History: go-kure/launcher#790 (the kind-named projections; the published schema marks provider of a secretstore and of a clustersecretstore, and externalSecretSpec of a clusterexternalsecret, as required); go-kure/launcher#922 (the object kind policy, oam.ObjectKindPolicy); go-kure/launcher#1108 (the operator’s CRDs vendored for the tests). Tests: TestExternalSecretsKinds_DefaultedZeros holds that list to the default markers of the linked module’s source in both directions: no other number or boolean of the four specs is of that shape. (“that list” is the reference’s list of the three store fields whose authored zero or false the API would replace, and “that shape” is a zero the type omits and the API defaults to another value, and the test is in externalsecrets_kinds_internal_test.go.) TestKindComponents_RequiredIsGenerated fails where the generated file and that derivation differ, in either direction and for either list, and names the path; a dependency bump that adds, drops or moves one fails there. (“the generated file” is zz_generated_kind_required.go, “that derivation” is the reference’s derivation of the lists from the linked module’s source, “either list” is the generated required list and the list of four store fields the type always writes, and “one” is a path, and the test is in kind_required_internal_test.go.) Regenerate with UPDATE_KIND_REQUIRED=1 go test ./pkg/oam/builtin/components/ -run TestKindComponents_RequiredIsGenerated. (“Regenerate” is regenerating the generated file the previous bullet names.) TestExternalSecretsKinds_RequiredMatchSource shows that no field of the four specs is required and omitted by the type when unauthored at this pin, and fails on the first one a bump brings. (“the first one” is the first such field, and the test is in externalsecrets_kinds_internal_test.go.) The API server holds the lists too: TestKindComponents_GeneratedRequiredBothWays runs one path of every type holding a generated path through its validator on the operator’s CRDs, vendored for the tests from the release the linked commit is tagged (go-kure/launcher#1108; see “Vendored CRDs” under the required fields), and every generated path is one those CRDs declare. (“the lists” are the reference’s required lists, and the test is in kind_required_internal_test.go.) Every rule the source declares on a type these specs reach is classified in TestExternalSecretsKinds_Rules, which fails on one that is added or reworded. (“the source” is the linked module’s source, “these specs” are the four specs, and “one” is a rule, and the test is in externalsecrets_kinds_internal_test.go.) TestExternalSecretsKinds_WrittenUnauthored pins those five. (“those five” are the five empty blocks the reference names, an external secret’s secretStoreRef and target, a clusterexternalsecret’s externalSecretMetadata, an AWS provider’s auth and a Vault provider’s tls, and the test is in externalsecrets_kinds_test.go.) TestExternalSecretsKinds_InlineValues finds every string value beside a secretRef in the linked module (14 at this pin) and fails on one that is in neither list. (“neither list” is the reference’s list of refused fields and its list of seven other fields that are not refused, and the test is in externalsecrets_kinds_internal_test.go.) TestSecretStoreKinds_FakeData pins the order. (“the order” is the order of the two refusals the reference gives for the fake provider’s data, and the test is in externalsecrets_kinds_test.go.) TestPolicyReadsKind_IsWhatTheRenderedObjectCheckReads fails when the refused set and the check differ. (“the refused set” is the reference’s list of kinds that target.manifest refuses, and “the check” is the rendered-object check the reference names, and the test is in policy_reads_kind_internal_test.go.) replicationsource, replicationdestination Implementation: Each is built on policyHeldKind (policyFreeKind with a policy check, see above) and emits that one object in the build namespace, named after the component unless objectName names it, and declares it as namespaced; the handler adds no label, no annotation and no default. (“Each” is replicationsource and replicationdestination.) History: go-kure/launcher#790 (the kind-named projections); go-kure/launcher#922 (the object kind policy, oam.ObjectKindPolicy); go-kure/launcher#883 (the kinds’ required lists are generated from the linked module’s CRDs). Tests: TestVolsyncKinds_NoDefaults holds the linked CRDs to that, and a dependency bump that adds a default fails there with the field named. (“that” is the reference’s “VolSync’s CRDs default no field under spec”, and the test is in volsync_kinds_internal_test.go.) TestKindComponents_NullRequired shows the refusal with the validator of the linked CRDs. (“the refusal” is the refusal of an unauthored nodeSelectorTerms in a mover’s required node affinity, and the test is in kind_null_required_internal_test.go.) The lists (192 paths for a source, 142 for a destination) are derived from the CRDs the linked module ships, by TestKindComponents_RequiredIsGenerated; a dependency bump that adds, drops or moves one fails there until the list is regenerated. (“The lists” are the reference’s required lists, “one” is a path and “there” is TestKindComponents_RequiredIsGenerated, and the test is in kind_required_internal_test.go.) TestKindComponents_GeneratedRequiredBothWays shows the API server’s answer to the omission of a field of each type that holds one (15 rows for a source, 14 for a destination). (The test is in kind_required_internal_test.go.) TestVolsyncKinds_WrittenEmptyAccepted holds that every other field of VolSync’s own types the type writes empty is one the CRDs take empty. (The test is in volsync_kinds_internal_test.go.) TestVolsyncKinds_AbsentFromCRD derives the fields the types reach that the linked CRDs have no property for and holds the refusals to them, both ways: a bump of either module that closes the gap, or widens it, fails there with the field named. (“the refusals” are the refusals of the two fields the reference names, secret.defaultUser and secret.items[].user, and the test is in volsync_kinds_internal_test.go.) It also runs the API server’s own create sequence on the linked CRDs (crdCreate): the API server names each of the two as an unknown field, for which a request made with strict field validation is refused, and prunes it from the object it goes on with. (“It” is TestVolsyncKinds_AbsentFromCRD, and “the two” are the same two fields.) TestVolsyncKinds_NoExpressionRules holds the linked CRDs to that, and a dependency bump that adds one fails there with the rule named. (“that” is the reference’s “The CRDs declare no expression rule” and “one” is such a rule, and the test is in volsync_kinds_internal_test.go.) TestVolsyncKinds_WrittenEmptyAccepted holds every such field to its schema. (“every such field” is a field the type writes empty, as the customCA block of an rclone or restic mover, and the test is in volsync_kinds_internal_test.go.)</description></item><item><title>Upstream fields a hand-parsed kind does not read</title><link>https://www.gokure.dev/launcher/dev/contributing/oam-reference/upstream-fields-not-read/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.gokure.dev/launcher/dev/contributing/oam-reference/upstream-fields-not-read/index.html</guid><description>Implementation, history and tests of the sections on the reference page Upstream fields a hand-parsed kind does not read. Text in square brackets is added here to say what a moved sentence refers to.&#10;Upstream fields a hand-parsed kind does not read Implementation: ParseSecretProperties [named after “the secret kind’s parser” in the reference’s sentence on webservice, worker and the traits.] History: go-kure/launcher#790 [named after “The rule that closes that gap”, the words before the reference’s quotation.] Below the top level History: go-kure/launcher#790 [named after NestedUnsupportedFieldHint in the reference’s sentence on a document.] One level down History: go-kure/launcher#790 [the reference’s first sentence of this section names it as its subject, so that sentence stays on the reference page whole.] An explicit null on a refused key History: go-kure/launcher#790 [the reference’s sentence “This is each kind’s behavior from before …, left as it was” names it, and stays on the reference page whole.] What holds this Tests: TestHandParsedKinds_CoverEveryUpstreamField walks the upstream type of each of the six kinds (the five hand-parsed ones, service, persistentvolumeclaim, configmap, secret and serviceaccount, and the role-deployment member; the raw kinds are held to their upstream spec by TestCoreKindSchemas_CoverSpec), from the object down every level whose fields are the component’s properties, and fails on a field that is neither read, nor refused, nor placed in one of the classes above — so a field a later k8s.io/api adds cannot be dropped in silence. It stops at the properties: what a property holds inside is held to the upstream type only for a container’s resources and the pod’s podResources. [“the classes above” are the reference’s sections “Refused, with the reason”, “Read in another shape”, “One level down” and “Outside the properties”.] TestRefusedKeys_BothPathsGiveTheReason holds every entry of every refusal map to the two texts above; TestRefusedKeys_OneLevelDown holds the two refusals inside a declared property. [“the two texts above” are the two texts under the reference’s “The two paths”.] TestHandParsedKinds_MatchExpressionsAtEverySelector runs a match expression through each of the 10 label selector sites these kinds read, to the generated object, and five defective ones to their refusal. TestHandParsedKinds_TemplateMetadataAndContainerName and TestHandParsedKinds_ServicePortFieldsReachTheObject pin the template’s metadata, the main container’s name and the six fields of a Service port.</description></item><item><title>Kinds: Helm</title><link>https://www.gokure.dev/launcher/dev/contributing/oam-reference/kinds-helm/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.gokure.dev/launcher/dev/contributing/oam-reference/kinds-helm/index.html</guid><description>Implementation, history and tests of the entries on the reference page Kinds: Helm. Every test named here is in pkg/oam/builtin/components/ unless a line says another file.&#10;helm Implementation: helm.go. History: go-kure/launcher#349 (the role-named helm component). go-kure/launcher#336 (a HelmRepository, GitRepository or Bucket source becomes chart.spec.sourceRef). go-kure/launcher#702 (valuesMode: configMap). go-kure/launcher#793 (the one shortening rule, oam.ShortenNameWithSuffix, for the values ConfigMap name). go-kure/launcher#741 (the configmap trait builds its ConfigMap through the configmap kind’s own code). go-kure/launcher#757 (known gap: an authored configmap trait on the same component that takes the same name is not refused). go-kure/launcher#787 (valuesConfigMapName, valuesSecretName, helmReleaseName, source.name beside an inline source, hookGroupNamePrefix and layoutKustomizationName, and the Breaking note on source.name with source.url). go-kure/launcher#1080 (a HelmRelease name, the default included, is held to 63 characters with a HelmRepository, GitRepository or Bucket source). go-kure/launcher#786 (secretValues). go-kure/launcher#794, item 9 (a key named global below the top level of secretValues is refused). go-kure/launcher#794, item 11 (scopeOverrides). go-kure/launcher#1064 (source.digest pins an inline oci:// chart to a manifest digest). go-kure/launcher#783 (the generated source is applied with the application bundle, ahead of every group). go-kure/launcher#785 (an authored releaseName, with the helmtemplate defaulting an unset one to the component name). helmchart History: go-kure/launcher#351 (the kind-named terminal for Flux’s HelmChart). go-kure/launcher#665 (rows 3 and 16 of the migration table: no shared OCIRepository between oci and Helm-over-OCI components, and the layerSelector of a generated OCIRepository). go-kure/launcher#625 (row 5 of the migration table: targetNamespace under a Flux namespace defaults to the application namespace). go-kure/launcher#781 (row 8 of the migration table: launcher sets no automatic health check on generated sources). go-kure/launcher#776 and go-kure/launcher#785 (row 11 of the migration table: template delivery refuses targetNamespace, and an unset releaseName renders under the component name). go-kure/launcher#788 (row 19 of the migration table: the component label and a post-renderer on the HelmRelease). go-kure/launcher#785 (row 20 of the migration table: every HelmRelease carries spec.releaseName). Tests: TestHelmParity (pkg/cmd/kurel) pins it on three fixture pairs: the last helmchart output of each input, frozen before the removal, is diffed against the helm build, and the diffs are in pkg/cmd/kurel/testdata/helm-parity/. (“it” is the reference’s “The output then changes only as this table says”; the test is in pkg/cmd/kurel/helm_parity_test.go.) helmrelease Implementation: It lives in the internal pkg/oam/internal/fluxduration. (“It” is the duration check described in the reference’s Defaults and checks paragraph.) History: go-kure/launcher#327 (the kind-named terminal for Flux’s HelmRelease, part of the Helm-family redesign go-kure/launcher#336). go-kure/launcher#702 (the launcher-owned valuesMode: configMap is refused like any other unknown key). go-kure/launcher#590 and go-kure/launcher#601 (a set interval must be a duration Flux accepts). go-kure/launcher#606 (the other duration fields are checked the same way, in the same form). go-kure/launcher#790 (chart.spec.sourceRef.kind is required under an authored chart of kind HelmChart, and the published schema lists chart and chartRef as optional and says so in the handler’s exclusive group). go-kure/launcher#748 (kind of a valuesFrom entry is Secret or ConfigMap). go-kure/launcher#762 (a set targetPath is at most 250 characters and matches the CRD’s pattern). go-kure/launcher#883 (every other required field the type writes unauthored is refused). go-kure/launcher#1072 (the chart template of kind OCIRepository). go-kure/launcher#1074 (the generated HelmChart). go-kure/launcher#1080 (the name of the generated chart source). go-kure/launcher#785 (the release name, and the breaking output change). go-kure/launcher#988 (spec.storageNamespace, and the breaking output change). go-kure/launcher#794, item 1 (the Kustomization oci emits has no targetNamespace default). go-kure/launcher#740 (the ConfigMaps and Secrets the HelmRelease reads from its own namespace move with it). go-kure/launcher#1079, go-kure/launcher#1086 and go-kure/launcher#1088 (a trait or a component of a later group that makes a required read, where the release lands, or the source of the chartRef or chart template, is refused). Tests: Its properties are exactly the top-level JSON keys of HelmReleaseSpec in the helm-controller API version go.mod links; a test ties the published schema to that struct, so a helm-controller bump that adds or drops a spec field fails the suite until the schema follows. (The reference keeps this sentence. “Its” is the helmrelease kind’s, “that struct” is HelmReleaseSpec, and the test is TestHelmReleaseHandler_SchemaMatchesSpec in helmrelease_test.go.) TestKindComponents_OmittedRequiredAndWrittenDefaults holds both to the markers in the source of the linked Flux modules, which ship no CRD: the required field to a refusal shown on a document, and the written value to the default the marker states, so an upstream change of that default fails the test. (The reference keeps this sentence. “both” are the two sets the test derives for the helmrelease kind: the required chart.spec.sourceRef.kind, and the written default of chart.spec.verify.provider. The test is in kind_api_sets_internal_test.go.) helmtemplate History: go-kure/launcher#348 (the kind-named terminal for a client-side Helm render, part of the Helm-family redesign go-kure/launcher#336). go-kure/launcher#787 (hookGroupNamePrefix and layoutKustomizationName, and the Naming hook’s answers for the hook-group and layout roles). go-kure/launcher#941 (the default hook-group prefix names only the layouts and kure names each Kustomization; the layout’s Kustomization name is left to kure). go-kure/launcher#786 (secretValues). go-kure/launcher#794, item 4 (a namespaced rendered object with no metadata.namespace is given the application namespace). go-kure/launcher#794, item 11 (scopeOverrides). go-kure/launcher#794, item 7 (undeclared fields of a registered kind). go-kure/launcher#794, item 6 (the host of the chart archive a Helm repository’s index points at is not checked, a decided limit). go-kure/launcher#790 (Lease, EndpointSlice, PriorityClass, RuntimeClass, APIService, the admissionregistration.k8s.io/v1 kinds and the image-reflector kinds are read as their Go types, and a list of a kind the scheme does not register is refused when a helm.sh/hook annotation is involved). go-kure/kure#1014 (a list is read in one place, kure’s parser). go-kure/launcher#791 (the render is decoded with kure’s manifest parser, and ApplyPolicy holds the chart to the environment policy). go-kure/launcher#792 (the hook-group child name begins with the application name). go-kure/kure#1030 and go-kure/kure#1036 (kure shortens the Kustomization name past 63 characters by its own rule). go-kure/kure#1032 (kure’s Flux integration refuses a hook-group child’s DependsOn and KustomizationName under FluxSeparate and FluxIntegratedPerBundle, and a layout’s name under any placement but per-layout). go-kure/launcher#563 (an AppFileSingle layout writes no kustomization.yaml, so nothing would list its child layouts). Tests: A test pins both, each way round, on the process’s standard log and its default slog logger. (“both” are the two cases of the sentence before it: a top-level global, where the dropped value is the dependency’s global entry from values, and a dependency’s ordinary key, where it is the dependency’s default; the test is TestHelmSecretValues_AllowedShapesPrintNoValue in pkg/cmd/kurel/helm_secret_values_test.go.) A test holds the two components to the same answer for the same objects and overrides. (“the two components” are helmtemplate and manifests; the test is TestScopeOverrides_ManifestsAndTemplateDeliveryResolveAlike in helmtemplate_scope_overrides_internal_test.go.) No type under a workload or a claim does this beyond scalar leaves (Quantity, IntOrString, Time) and the raw field set of managedFields; a test walks those types and fails when one starts to. (The reference keeps this sentence. “this” is decoding its own keys, as the known limit above states it, “those types” are the types under a workload or a claim, and “one” is a type that unmarshals itself beyond the scalar leaves and the field set of managedFields; the test is TestUndeclaredFields_NoSelfUnmarshallingStructUnderAWorkload in undeclared_fields_internal_test.go.) The schema declares the same keys, with source closed to url and kind, and a test ties it to the struct. (The reference keeps this sentence. “it” is the schema and “the struct” is helmTemplateProperties; the test is TestHelmTemplateHandler_SchemaMatchesProperties in helmtemplate_internal_test.go.) oci History: go-kure/launcher#784 (oci is lowered by OCIRule to an ocirepository and a fluxcd-kustomization). go-kure/launcher#999 (the source’s registry access: source.secretRef, source.provider, source.insecure, source.certSecretRef and source.proxySecretRef). go-kure/launcher#1009 (source.serviceAccountName). go-kure/launcher#1012 (the Secret a trait makes moves to the Flux namespace with the source the component keeps to itself). go-kure/launcher#1016 (the same for a source generated on its own, which every consumer is ordered after). go-kure/launcher#1039 (the transform refuses a Secret-making trait on a consumer in a later group under TransformContext.GroupsWaitForFluxObjects). go-kure/launcher#1079 (any Flux object that requires a ConfigMap or Secret a trait makes in a later group). go-kure/launcher#1086 (a component of a later group that makes a ConfigMap or Secret where it lands with the source). go-kure/launcher#787 (the Naming hook’s helm-source role, source.name, kustomizationName and source.objectName). go-kure/launcher#622 (targetNamespace has no default). go-kure/launcher#432 (wait and healthChecks). go-kure/launcher#580 (under a non-empty registry allowlist source.url must name its registry explicitly). go-kure/launcher#590 (interval is checked exactly as for helmrelease).</description></item><item><title>Kinds: core workloads</title><link>https://www.gokure.dev/launcher/dev/contributing/oam-reference/kinds-core-workloads/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.gokure.dev/launcher/dev/contributing/oam-reference/kinds-core-workloads/index.html</guid><description>Implementation, history and tests of the entries on the reference page Kinds: core workloads. Text in square brackets is added here to say what a moved sentence refers to.&#10;webservice, worker History: go-kure/launcher#341 (the DeploymentSpec-level surface that webservice and worker share with deployment [until go-kure/launcher#1629 made deployment a raw kind]). go-kure/launcher#1473 (webservice and worker publish tolerations and topologySpreadConstraints). go-kure/launcher#280 (worker and webservice are component lowering rules, not handlers). go-kure/launcher#702 (both rules emit the component’s ServiceAccount as a serviceaccount member and turn each claim a pvc volume describes into a synthesized pvc trait). go-kure/launcher#546 (a webservice component name must be a valid Service name). go-kure/launcher#959 (a leading digit in a webservice component name under RelaxedServiceNameValidation). go-kure/launcher#1230 (the same rule below Kubernetes 1.36 and the spec.featureGates setting). go-kure/launcher#787 (deploymentObjectName, serviceObjectName and serviceAccountObjectName). go-kure/launcher#545 (an ingress portName on a webservice must be http). deployment History: go-kure/launcher#1629 (the kind takes the upstream DeploymentSpec, strictly decoded, on the replicaset recipe: a breaking pre-GA change with no launcher default, no automountServiceAccountToken: false fill and an empty fill report. The reshaped form is the role-deployment member of webservice and worker). go-kure/launcher#412 (the raw corev1 scheduling surface: affinity, tolerations and topologySpreadConstraints; since go-kure/launcher#1629 they are template.spec.*). service History: go-kure/launcher#411 (the kind-named Service, an independent component). go-kure/launcher#383 (targetPort is published as the Types: [integer, string] union). go-kure/launcher#790 (type: ExternalName, the further ServiceSpec fields, and the refusal of externalIPs, clusterIPs and a literal clusterIP address). go-kure/launcher#1230 (PreferSameZone and PreferSameNode below Kubernetes 1.34, and a leading digit in the Service name below Kubernetes 1.36). go-kure/launcher#690 (a headless Service, clusterIP: None). go-kure/launcher#959 (a leading digit in the Service name under RelaxedServiceNameValidation). go-kure/launcher#794 (service has no ApplyPolicy, deliberately). go-kure/launcher#922 (the object kind policy, oam.ObjectKindPolicy). serviceaccount, persistentvolumeclaim, configmap History: go-kure/launcher#702 (serviceaccount, persistentvolumeclaim and configmap as kind-named projections of one object each). go-kure/launcher#741 (the pvc and configmap traits as twins of the kinds). go-kure/launcher#742 (an unauthored storageClassName comes from the ClusterProfile pvc capability). go-kure/launcher#790 (the four claim-spec fields selector, dataSourceRef, volumeName and volumeAttributesClassName). go-kure/launcher#794 (serviceaccount and configmap have no ApplyPolicy, deliberately). go-kure/launcher#922 (the object kind policy, oam.ObjectKindPolicy). secret History: go-kure/launcher#790 (secret as the kind-named projection of a v1 Secret). namespace, limitrange, resourcequota History: go-kure/launcher#790 (namespace, limitrange and resourcequota as kind-named projections of one core object each). go-kure/launcher#788 (the transform sets the component label on every object a component owns). Tests: TestCoreKindSchemas_CoverSpec holds each schema to the linked type by reflection. [“each schema” is the schema of namespace, limitrange and resourcequota, and the test is in core_kinds_test.go] persistentvolume History: go-kure/launcher#790 (persistentvolume as the kind-named projection of a v1 PersistentVolume). go-kure/launcher#794 (csi and flexVolume sources are not covered by the hostPath gate, a decided limit). pod History: go-kure/launcher#790 (pod as the kind-named projection of a v1 Pod; image volumes held to the allowed registries and to the tag rule, a breaking change for a document, a chart or a source naming an untagged or :latest image in a field held to the registry rule). go-kure/launcher#1177 (the nested form of a volumes entry (type: image, image: {reference: ...}) on the components with a volume schema of their own). go-kure/launcher#788 (the transform sets the component label on every object a component owns). Tests: The list is held to the API server’s own defaulting code by TestKubernetesDefaulters_MatchVendoredSource. It reads an excerpt of that code, copied unmodified from kubernetes/kubernetes at the release of the linked k8s.io/api under its Apache-2.0 licence, in testdata/upstream/kubernetes/ (see the next paragraph). The test walks the generated SetObjectDefaults_ function of the Pod, PodTemplate, ReplicationController and ReplicaSet objects and every defaulting function they call. It fails on a field the code defaults and the list does not hold, on a default the list states otherwise, and on a row the code does not set. The walk is closed: it accepts only the kinds of statement, expression and type, the unary operators and the calls the excerpt at the vendored tag uses, each listed in the test (a method by its receiver’s identity, a builtin only while no name of the excerpt shadows it), and fails on anything else, naming it and its position, rather than guess. It also fails on listed shapes it cannot follow: among others, a write through a copy of a field (read by name or through a dereference), a list element reached by anything but a range over that list, a break out of a loop, a method called on the object, a variable shadowing one of an enclosing block, or a write it cannot place in the object. The trade-off is that a re-vendoring whose code uses a new shape or call fails the test until that shape is understood and listed, even when it changes no default. Most defaults are set by a SetDefaults_ function. The exceptions are a port’s protocol and the iscsi, rbd and scaleIO strings, which k8s.io/api declares with a +default marker and the generated functions apply, and hostPort, which defaultHostNetworkPorts sets. A second test holds the numbers to the field comments of the linked types. [“The list” is the list of values the API server would replace with its default, in the item above; the first test is in kubernetes_defaulters_internal_test.go, “the next paragraph” is the next bullet, and the second test is TestPodSpecDefaultedZeros_MatchFieldDocs, in pod_defaulted_zero_internal_test.go] The excerpt in testdata/upstream/kubernetes/ holds eight files of kubernetes/kubernetes under its Apache-2.0 licence, each with its header, and kubernetes/kubernetes’s LICENSE, the licence’s full text, at the same tag. Its SOURCE file names the tag and the git blob id of each file and of LICENSE; the tests check each against its file, the tag against the linked k8s.io/api, and fail when LICENSE is missing. mise run vendor-k8s-defaulters vX.Y.Z re-fetches it when that module moves; it takes the Kubernetes tag, not the module version: k8s.io/api v0.X.Y pairs with Kubernetes v1.X.Y. CI never runs it, and the tests need no network. [“The excerpt” is the one the first test in the previous bullet reads, and “the tests” are the tests of kubernetes_defaulters_internal_test.go that read it, among them TestKubernetesDefaulters_ExcerptMatchesLinkedRelease, which holds the tag to the linked k8s.io/api] TestKindComponents_OmittedRequiredAndWrittenDefaults lists the four with that reason. [“the four” are the four fields the paragraph names: the action and the exit codes' operator of a container restart rule, and the signerName and keyType of a pod certificate source; “that reason” is the reason the paragraph gives, and the test is in kind_api_sets_internal_test.go] A test walks the linked k8s.io/api type and fails on a field whose name holds image, or whose type is the image volume source, that is neither held nor listed with a reason; an image field under another name and another type is not found by it. [the test is TestImageFields_HeldOrListed, in image_fields_internal_test.go] The test that walks the types fails on a field held to the registry rule and not to this one. [“The test that walks the types” is TestImageFields_HeldOrListed, named in the item for image volumes] replicaset History: go-kure/launcher#790 (replicaset as the kind-named projection of an apps/v1 ReplicaSet). go-kure/launcher#788 (the transform sets the component label on the object and its template). Tests: A test holds the probe list to every non-pointer omitempty number or boolean under ReplicaSetSpec whose field comment states a non-zero default, the template’s metadata included, and TestKubernetesDefaulters_MatchVendoredSource holds the whole list to the API server’s defaulting code for a ReplicaSet. [“the probe list” is the list of values the API server would replace with its default, and the first test is TestPodTemplateKindsDefaultedZeros_MatchFieldDocs, in pod_template_defaulted_zero_internal_test.go; the second is the test the pod entry names] replicationcontroller History: go-kure/launcher#790 (replicationcontroller as the kind-named projection of a v1 ReplicationController). podtemplate History: go-kure/launcher#790 (podtemplate as the kind-named projection of a v1 PodTemplate). go-kure/launcher#794 (security-context with psaLevel alone is accepted on a podtemplate, as a declaration of the level). go-kure/launcher#788 (the transform sets the component label on the object and its template). storageclass, volumeattributesclass, priorityclass, runtimeclass, ingressclass, csidriver Implementation: One shared helper builds all six (policyFreeKind, in kind_policy_free.go), for a kind to which no dimension of the environment policy applies; servicecidr, poddisruptionbudget, endpointslice, the four kinds of the RBAC API, the four of the Prometheus operator’s API, the four of Cilium’s BGP control plane and the five kinds of the Gateway API’s infrastructure objects are built on it too. The three kinds of cert-manager’s API, the two of VolSync’s, alertmanager, thanosruler and prometheus are built on policyHeldKind (kind_policy_held.go): this helper, unchanged, with an ApplyPolicy that asks one function of the kind whether the policy refuses the decoded value. It refuses or passes; it fills no default. A kind is a value of it naming the upstream type, an optional check of required fields, an optional list of required fields the type writes whether or not they were authored, and the base-library constructor; the helper is the rest: the strict decode of the property map into the upstream type under the package’s null contract, which refuses a null list element by its path (decodeKindSpec), the refusal of a key written in two spellings (refuseUncarriedSpecValues), the refusal of a listed required field that was not authored (refuseUnauthoredRequired, which reads the authored properties, since the decoded value does not show the omission, and follows a list to each of its items), a config whose ApplyPolicy does nothing, and a Generate that returns the constructor’s object, under the object name the config carries, with a deep copy of what was decoded, so two builds of one config share nothing. The config type is unexported: a component is only built from properties that went through the decode. [the sentence on defaultedZeros, which follows on the reference page, is the rule this paragraph goes on from; the next bullet under Tests holds the rest of this paragraph, which names the tests that hold the helper’s kinds to the API defaults] History: go-kure/launcher#790 (the six kinds as kind-named projections of one cluster-scoped object each). go-kure/launcher#788 (the transform sets the component label on every object a component owns). Tests: A kind that lists none suits a type only when none of its omit-when-zero numbers or booleans has a non-zero API default; TestPolicyFreeKinds_NoDefaultedZeros reads the field comments of every Kubernetes type built on it and fails on one whose comment states such a default in a form it recognises (Defaults to 1, Default is true). A default the comment words otherwise, or does not state, is not found, and a string’s default is not read from a comment. The types of the Prometheus operator’s API publish no field comment; TestMonitoringKinds_DefaultedZeros reads the default markers of their source instead, strings included. Cilium’s publish none either, and its module ships the CRDs: TestCiliumBGPKinds_DefaultsSitOnPointers holds every default of the four BGP CRDs to a field that is a pointer in the Go type. [“A kind that lists none” is a kind that lists no defaultedZeros, in the sentence before it on the reference page; TestPolicyFreeKinds_NoDefaultedZeros is in kind_policy_free_internal_test.go] TestKindComponents_DefaultedEmptyLists walks every kind in its table of API sources, finds each list omitted when empty that its source gives a default (a CRD schema or a default marker) or whose field comment mentions a default, and holds each to an answer: refused, or not refused with the reason. A newly defaulted list fails it until it is answered. The three refused defaults are held to the API server’s defaulting code by TestKubernetesDefaulters_ListDefaultsMatchVendoredSource, from the excerpt the pod kind’s list is held to: the functions that reach those defaults are held to their exact statements, and each default to being the only write to its field or to anything beneath it. Two limits: the lists of the Kubernetes types are found from their field comments, so a list the API server defaults without its comment saying so is not found; and the table of kinds it walks is not itself proven to hold every kind component. [the test is in kind_defaulted_lists_internal_test.go; “it” is that test, and “the excerpt the pod kind’s list is held to” is the excerpt the pod entry describes] horizontalpodautoscaler History: go-kure/launcher#790 (horizontalpodautoscaler as the kind-named projection of an autoscaling/v2 HorizontalPodAutoscaler). Tests: The type has no number or boolean that is omitted when zero, which TestHorizontalPodAutoscalerSpec_NoOmittedZeros holds it to. [the test is in horizontalpodautoscaler_internal_test.go] statefulset History: go-kure/launcher#1629 (the kind takes the upstream StatefulSetSpec, strictly decoded, on the deployment recipe: a breaking pre-GA change with no launcher default, no automountServiceAccountToken: false fill and no policy or builtin fill report. Claim templates are raw PersistentVolumeClaim objects; the pvc capability’s storage class on a claim template that authors none, and the storage maximum on each claim template, stay. The reshaped form is gone from the kind; the entries below describe the kind as it was before, and the claim template spelling and the updateStrategy strictness they mention are no longer launcher’s: the API server’s own rules apply). go-kure/launcher#690 (statefulset emits no Service, and serviceName no longer defaults to the component name). go-kure/launcher#790 (affinity, tolerations and topologySpreadConstraints as the raw corev1 shapes). go-kure/launcher#546 (an authored serviceName that is not a DNS-1123 label refused at conversion). go-kure/launcher#959, go-kure/launcher#1230 (the name of the governing Service is checked). daemonset History: go-kure/launcher#1629 (the kind takes the upstream DaemonSetSpec, strictly decoded, on the replicaset recipe: a breaking pre-GA change with no launcher default, no automountServiceAccountToken: false fill and an empty fill report. The reshaped form is gone from the kind; the entries below describe the kind as it was before, and the updateStrategy strictness they mention is no longer launcher’s: the API server’s own rules apply). go-kure/launcher#340 (updateStrategy, minReadySeconds and revisionHistoryLimit as the DaemonSetSpec-level properties). go-kure/launcher#412 (tolerationSeconds and the toleration cross-field rules came with the shared parser). go-kure/launcher#690 (daemonset emits no Service, and port &gt; 0 no longer adds one). go-kure/launcher#545, go-kure/launcher#546 (the ClusterIP Service that port &gt; 0 added held the component name to the Service-name rule and an ingress portName to http). go-kure/launcher#790 (the raw affinity and topologySpreadConstraints and sidecars on daemonset, and the refusal of an authored template by the parser). go-kure/launcher#383 (maxUnavailable and maxSurge published as the Types: [integer, string] union). go-kure/launcher#408 (authored-document validation did not check property shape, so a selector: on a daemonset was ignored). 6aed090 (feat(format): enforce policy and support securityContext on init/sidecar containers) is the in-repo precedent for shipping this class of tightening under an unchanged version string. [“this class of tightening” is the rejection of an undeclared selector that the paragraph before it described on the reference page, which no longer carries it: since go-kure/launcher#1629 selector is a required property of the kind] cronjob History: go-kure/launcher#1629 (the kind takes the upstream CronJobSpec, strictly decoded, on the deployment recipe: a breaking pre-GA change with no launcher default, no automountServiceAccountToken: false fill and an empty fill report. The hand-written JobSpec validation, the reshaped pod surface and the unlabelled object and job template are the differences from the entries below). go-kure/launcher#790 (the raw affinity, tolerations and topologySpreadConstraints on cronjob [since go-kure/launcher#1629 they are jobTemplate.spec.template.spec.*]). go-kure/launcher#787 (the CronJob name held to 52 characters). job Implementation: The workflow annotates the Job once it is generated, and the handler writes no annotation of its own: since go-kure/launcher#1629 the Job is kure’s identity-only constructor plus a deep copy of the authored spec, so the Flux force annotation that the force-replace trait asks for is never cleared. History: go-kure/launcher#1629 (the kind takes the upstream JobSpec, strictly decoded, on the deployment recipe: a breaking pre-GA change with no launcher default, no automountServiceAccountToken: false fill and an empty fill report. The entries below that name parseJobSpec, its validators or a reshaped property describe the form the kind had before). go-kure/launcher#344 (the job component, in job.go). go-kure/launcher#790 (the raw affinity, tolerations and topologySpreadConstraints on job; cronjob refuses selector, manualSelector and template as job does; scheduling refused on job and cronjob; an empty onPodConditions: [] beside onExitCodes counted in the published exclusive group; the reason for the refusal of selector and manualSelector also given in a document). go-kure/launcher#702 (job emits a Job and nothing else). go-kure/launcher#787 (the Job name held to 63 characters, and to the rule for the hostname of the last index). go-kure/launcher#345 (podFailurePolicy published by job and cronjob through the shared parser). go-kure/launcher#410 (onPodConditions[].status defaults to True). go-kure/launcher#408 (kurel build calls ValidateAuthoredProperties, so an authored key and its shape are checked on the document itself). go-kure/launcher#394 (every optional-field helper in common.go routes its presence check through authoredValue). go-kure/launcher#406 (a Job’s pod template is immutable, and updating in place stays a failure by default). go-kure/launcher#782 (the force-replace trait sets the ForceReplace delivery intent on the component’s application). So does completionMode, which the shared parseJobSpec read with a bare lookup until go-kure/launcher#570, on cronjob as well. [“So” means that the property reads an explicit null as an omission, in the sentence before it on the reference page] passthrough Implementation: Its config exposes ComponentName() string (the oam.ComponentNamed interface) so consumers can attribute the emitted resource to its owning OAM component. [“Its” is the passthrough component’s] The validated object is deep-copied when the config is built, not aliased, so a caller that keeps mutating the map it passed in cannot change what was validated. The copy detaches nested maps and slices whatever their concrete type — the authored path only ever yields map[string]any and []any, but a Go-assembled body can hold a map[string]string or a []string, and those used to alias straight through. A null survives as a null rather than becoming an empty {}/[]. Two things it deliberately does not do: it does not chase pointers (a *Location inside a time.Time, resource.Quantity’s *inf.Dec), and it does not reject the shapes it cannot fully detach. [“it” is the copy, and “the object” is the object property] The copy is not what makes the rejection binding, and this section used to claim it was. Object is an exported field, so a caller holding the config can assign a fresh map over it, and a struct literal or a JSON decode never runs ToApplicationConfig at all — three routes reaching Generate with a body the arms never saw. Generate therefore re-runs, on the map it is about to emit, every check that must hold of an emitted body: a non-empty apiVersion and kind, and both list arms. Checking the bytes being emitted, rather than trusting a check that ran on some earlier map, is what closes those routes. [“The copy” is the deep copy in the paragraph before it, and “the rejection” is the refusal of a list, which the reference page describes, and of an empty object, which the paragraph after this one describes] Those checks live in one function precisely so the two call sites cannot disagree about what a valid body is. While they were split — the constructor checking identity, Generate checking only list shape — a PassthroughConfig holding an empty map passed both: non-nil, so it cleared the no-object guard, and carrying no items, so it cleared both arms, leaving Generate to emit a document consisting of nothing but the metadata it had just stamped on. [“Those checks” are the checks that Generate runs again, in the paragraph before it] History: go-kure/launcher#1162 (the emitted object holds JSON values only, so it can be deep-copied). go-kure/launcher#1167, go-kure/launcher#1170 (a number is emitted with its own digits, as an int64, a float64 or a json.Number). go-kure/launcher#1166 (a value with no JSON form is refused, naming the field). go-kure/launcher#1176 (a number beyond float64 range in the object is read as text and not refused). go-kure/launcher#794 (the scope of the object, the environment policy check, the refusal of a core Secret under a policy that forbids explicit secrets, and the refusal of a workload or claim with an undeclared field). go-kure/launcher#790 (an image volume held to the registry allowlist and to the tag rule). go-kure/kure#1009 (the parse error kure gives an object whose decoder panicked, a CiliumNetworkPolicy whose icmps field leaves its type out). go-kure/kure#1007 (a MetalLB BGPPeer at metallb.io/v1beta2 is a registered kind). go-kure/kure#1014 (an object of a registered kind that states Kind or apiversion beside the exact key is refused). crd, manifests History: go-kure/launcher#794 (the environment policy check on every object a manifests or crd source yields, the refusal of a core Secret under a policy that forbids explicit secrets, and the refusal of a workload or claim with an undeclared field). go-kure/launcher#790 (an image volume from a registry outside the allowed list refused, and the table under helmtemplate that lists what built before and is refused now). go-kure/kure#1012 (malformed JSON that the decoder cannot read past is a build error, where the build did not return on it). go-kure/kure#1007 (a MetalLB BGPPeer at metallb.io/v1beta2 is a registered kind). go-kure/kure#1014 (a list of a kind the scheme does not register, that states items, is replaced by its items).</description></item><item><title>Conventions</title><link>https://www.gokure.dev/launcher/dev/contributing/oam-reference/conventions/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.gokure.dev/launcher/dev/contributing/oam-reference/conventions/index.html</guid><description>Implementation, history and tests of the sections on the reference page Conventions. Text in square brackets is added here to say what a moved sentence refers to.&#10;Conventions History: go-kure/launcher#396 [“the maps themselves”, at the end of the reference’s sentence on the postgresql Cluster’s spec.inheritedMetadata.] The app label History: go-kure/launcher#572 [named after “a 10-hex-character sha256 digest” in the reference’s second paragraph.] go-kure/launcher#788 [named after “where the key is absent” in the reference’s paragraph on the component label.] go-kure/launcher#790 [named after “refused when it is generated” in the same paragraph.] The object name (objectName) Implementation: ComponentObject, in object_name.go or, for a kind added since, in the kind’s own file [“every type whose handler declares its object”, in the paragraph “The property is not in any handler’s PropertySchema”.] History: go-kure/launcher#787 [named after “in place of the component name” in the reference’s first paragraph.] The object’s labels and annotations (labels, annotations) History: go-kure/launcher#790 [named after “each a map of strings” in the reference’s first paragraph.] Tests: TestObjectMetadata_EveryKindComponentTakesIt holds every registered kind to the two properties, so a kind added later cannot ship without them. [“the two properties” are labels and annotations.] The pod template’s labels and annotations (podMetadata) History: go-kure/launcher#1178 [named after “own metadata” in the reference’s first paragraph.] go-kure/launcher#1216 [named after “webservice and worker take it too” in the same paragraph.] A label selector’s match expressions History: go-kure/launcher#790 [named after “each named by its path” in the reference’s first paragraph.] Tests: TestValidateLabelSelector_MatchesAPIMachinery holds launcher’s check to the linked function on those three. [“the linked function” is ValidateLabelSelectorRequirement of k8s.io/apimachinery, named in the reference’s paragraph before; “those three” are the three defects the reference lists.] TestExternalSecretsKinds_RequiredMatchSource derives the two from that source by that rule, beside the fields the operator’s own types mark required, and holds each kind’s list to them. [“the two” are key and operator; “that source” and “that rule” are the linked metav1.LabelSelectorRequirement and the schema generators’ rule, both in the reference’s paragraph “The Prometheus operator’s module, …”.] Required fields a kind writes unauthored and does not refuse Implementation: scripts/vendor-prometheus-operator-gates.sh [after testdata/upstream/prometheus-operator/ in the reference’s first vendored-CRD bullet.] scripts/forbidden-terms-lib.sh, self-tested by make test-forbidden-terms [after “the script reads the guard’s own matcher” in the second bullet.] History: go-kure/launcher#1108 [named after mise run vendor-external-secrets-crds vX.Y.Z in the third bullet.] Before go-kure/launcher#883 generated their lists, the same was shown of imageCatalogRef on cnpg-cluster and pgbouncer.imageCatalogRef on cnpg-pooler: a kind written "" refused by the CRD’s own rule on the reference, a name written "" and a major written 0 accepted. All three are refused now. [“the same” is what the reference’s paragraph “What the API server makes of them” shows of the Pooler and the Prometheus operator kinds.] go-kure/launcher#1108 [named after “on their vendored CRDs” in the reference’s paragraph “At this pin the file holds 25 members …”.] Tests: TestRequiredWrittenKinds_CoverEveryCRDKind holds the measured kinds to the kind inventory: every kind row whose API group client-go’s scheme does not register, so a CRD serves it, is measured or named as not measured with its reason, so a new kind component of such an API fails there until it is one or the other. [“there” is that test; it follows the reference’s sentence on apiservice.] Required fields the published schema carries Implementation: publishNestedRequired, unconditionalPaths, handRefusedRequired and nestedRequiredTypes in pkg/oam/builtin/components/kind_required_schema.go; each of the 31 kinds’ PropertySchema() returns its schema through publishNestedRequired (28 wrap their declaredSchema(); cnpg-backup and the two image catalog kinds wrap their shared schema helper); so do the five mariadb kinds, of which only mariadb-sqljob has an unconditional path today (passwordSecretKeyRef.key), the other four being wrapped so a regenerated list publishes theirs [the 31 are the generated kinds with an unconditional path the schema did not carry and the eight kinds of handRefusedRequired; the mariadb kinds were added after that measurement.] History: go-kure/launcher#1831 [the issue that named the gap; its first table was one refusal per type from a test run, and the set it names is the one measured against the generated lists.] Tests: TestKindSchemas_PublishNestedRequired holds every unconditional generated path and every hand-refused path to a declared, Required node of the published schema. TestHandRefusedRequired_RefusedByBuild holds each handRefusedRequired entry to the kind’s refusal of the document without it, so a path the build stops refusing fails there. TestNestedRequiredTypes_MatchTheAPI holds each type nestedRequiredTypes declares to the type the kind’s API gives the field. TestCnpgPooler_OmittedClusterNameFailsSchema shows the refusal at schema validation. TestCnpgPooler_NestedKeyIsReadByExactSpelling pins that the schema reads a nested key by its exact spelling, as it does at the top level. It checks the refusal text of each case, so a case cannot pass for an unrelated reason. Every spec field is this package’s to write Implementation: common.go ["ValidateImageRef", in the reference’s paragraph “Two injected defaults are gone from the emitted manifests”.] The obj.Annotations = nil assignments scattered through the handlers, which existed to strip the app: annotation the constructors used to stamp, are now no-ops — kept so the field stays at a known value regardless of what a future constructor does. [“the constructors” are the Create&lt;Kind&gt; constructors of the reference’s first paragraph.] History: its plugin name and parameters were corrected afterwards by go-kure/launcher#643 [“the barman-cloud WAL-archiver plugin entry”, in the reference’s paragraph “postgresql writes every CNPG value itself”.]</description></item><item><title>The null contract and two spellings of one field</title><link>https://www.gokure.dev/launcher/dev/contributing/oam-reference/null-and-spellings/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.gokure.dev/launcher/dev/contributing/oam-reference/null-and-spellings/index.html</guid><description>Implementation, history and tests of the sections on the reference page The null contract and two spellings of one field. Text in square brackets is added here to say what a moved sentence refers to.&#10;The null contract Implementation: authoredValue — the presence primitive parseStringField, parseObjectField, parseInt32Field, parseInt64Field, parseObjectList and parseStringList all go through — does exactly that, so calling any of them directly already complies. They classify a typed nil as null too — map[string]any(nil) or []any(nil) inside an any, which is what a lowering rule assembled in Go produces for an unset optional and is not == nil. [“that” is the reference’s “read a null under an optional property as omission”; “They” are the six helpers named in this sentence.] A new optional field is read with the helper for its type instead: parseStringField (or requiredStringField when the field is required), parseBoolField, parseInt32Field, parseInt64Field, parseObjectField, parseObjectList or parseStringList. Each already reads an explicit null as absence through authoredValue, so a wrapper would only repeat that check. [“instead” is instead of an optional* wrapper; “a wrapper” is one of those, listed under History.] History: It is written down because “null” has several readers — the emission validator’s requiredness check and its optional-key strip, its array-element guard, enforcePlatformReserved, this package’s parsers, and the Kubernetes API itself — and each was aligned separately, so each round of review found the reader the last round had not touched. [“It” is the reference’s rule on the null contract.] This used to require a separate optional* wrapper family (optionalString, optionalObject, optionalInt32, optionalInt64, optionalObjectList, optionalStringList) layered in front of the plain parsers. go-kure/launcher#394 moved the handling into the shared helpers themselves, which made every wrapper an exact no-op forward; they were removed and every caller now uses the parse* helper directly. go-kure/launcher#423, go-kure/launcher#394 and go-kure/launcher#570 converted the parsers they covered; the last of them are listed with the null row of the deployment table above. [“the parsers they covered” are the parsers that answer presence with a bare v, ok := props[key], the first limit of the reference; “the deployment table above” is the DeploymentSpec table under “Deployment-level properties” of the reference page Common config, whose null row now names the role-deployment member.] Both limits met on one key, and it was the second row of that table. namespaceSelector is parsed twice in this repository: here, for pod affinity, through parseSchedulingSelector (parseObjectField), where any null is omission — which upstream reads as “this pod’s namespace”; and in the networkpolicy trait, through parseNPPeer. A typed nil used to satisfy the networkpolicy trait’s own type assertion and yield an empty selector — all namespaces, the widest possible answer — while an untyped nil already read as omission there, so one input landed on opposite ends of the range depending on which Go nil shape produced it. Both parsers now route their presence check through oam.IsNullValue’s reflect-based classification, which treats a typed nil the same as an untyped one, so the two halves converge: a null namespaceSelector, however it was constructed, is omission on both paths. [“Both limits” are the two limits the reference lists; “that table” is its labelSelector and namespaceSelector table; “here” is the handler parsers.] The same typed-nil shape reached list elements. parseObjectList read a null key as absence, but a typed-nil element ([]any{map[string]any(nil)}) passed its per-element assertion as an empty object, where an untyped null element is refused (tolerations[0]: must be an object, got &lt;nil&gt;). Most callers then failed on a missing required field anyway. tolerations did not: an empty entry became an Exists toleration with no key, which tolerates every taint. The element is now normalised to a null first, so every caller refuses both shapes identically (go-kure/launcher#465). The list readers that do not go through parseObjectList (envFrom, httpHeaders, volumes, volumeMounts, sidecar ports, the Job successPolicy/podFailurePolicy rules and onPodConditions [read by hand until go-kure/launcher#1629 made job and cronjob decode the upstream spec], volumeClaimTemplates, valuesFrom, scopeOverrides) pass each element through nullElem first, for the same untyped refusal and message. [volumeClaimTemplates of statefulset is a raw list of PersistentVolumeClaims since go-kure/launcher#1629 and is decoded strictly with the rest of the spec.] [“The same typed-nil shape” is the one of the entry above.] Tests: TestNoOptionalFieldWrappers (no_optional_wrappers_internal_test.go) keeps them removed: it fails on any function or method whose name starts with optional. It parses every production .go file directly in this package’s directory — every file, not only common.go, and never a _test.go file or a subdirectory — and fails if it parsed none, so a wrong working directory cannot pass it vacuously. [“them” are the optional* wrappers of the History entry above.] Fixed as go-kure/launcher#430; networkpolicy_internal_test.go’s TestParseNPPeer_NamespaceSelectorPresenceCases pins the typed-nil case directly. [“Fixed” is the namespaceSelector split of the History entry that starts “Both limits”.] Two spellings of one field Implementation: foldedKey [the helper behind the reference’s sentence on the helmrelease verify check that still refuses a pair in which one spelling is null, which the decode lets through]. History: Before, those documents built. [“those documents” are the ones a kind that decodes by itself builds, listed in the reference’s gitrepository and helmrelease sentence.]</description></item><item><title>Names and overrides</title><link>https://www.gokure.dev/launcher/dev/contributing/oam-reference/names-and-overrides/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.gokure.dev/launcher/dev/contributing/oam-reference/names-and-overrides/index.html</guid><description>Implementation, history and tests of the sections on the reference page Names and overrides. Text in square brackets is added here to say what a moved sentence refers to.&#10;Names and overrides History: go-kure/launcher#793 (launcher shortens a name only when it generated that name itself, and always by one rule, ShortenName(name, limit)). go-kure/launcher#787 (a name that cannot be the name of its object fails the transform with the property in the error, so the cluster never has to refuse it). Name roles and the Naming hook History: go-kure/launcher#787 (a consumer changes a name launcher generates through TransformContext.Naming, a func(NameRequest) (string, bool)). go-kure/kure#1032 (kure’s Flux integration refuses a name set on a layout under any placement but FluxIntegratedPerLayout). go-kure/launcher#787 (the over-long name of a hook-group child fails the transform). go-kure/launcher#1044 (GeneratedName is the name an object takes where no name is authored and no hook is set, so the postgresql rule matches another component’s inline recovery store by it). go-kure/launcher#1001 (postgresql’s archive check, a rule that reads another component of Document and needs the name that component’s object takes). go-kure/launcher#787 (a hook that names two synthesized policies apart and not their sub-applications leaves two applications of one name in the bundle, which is refused). go-kure/launcher#787 (two sub-applications of one name in one bundle are refused: a behaviour change). The ingress trait’s Ingress and the httproute trait’s HTTPRoute used to be claimed the same way; they are resolved under their roles now (ingress, httproute). [“the same way” is with (*Trait).ClaimObjectName, the claim of the sentence before it on the reference page.] Outputs: the names a component’s objects get Tests: A test pins this (TestValidateAuthoredProperties_NeverWritesThroughAPointerOrStruct). [“this” is the rule of the sentence before it on the reference page: validation’s own code only reads through a pointer or a struct and never writes through either, for a value under an open object.] labels and annotations: the metadata of a kind component’s object History: go-kure/launcher#790 (a kind component takes two more properties the engine reads, labels and annotations, each a map of strings). go-kure/launcher#1178 (the pod template’s labels and annotations are a handler’s own property, podMetadata, on deployment, statefulset, daemonset, job and cronjob [deployment, statefulset, daemonset, job and cronjob have since become raw kinds with template.metadata and jobTemplate.spec.template.metadata, go-kure/launcher#1629]). go-kure/launcher#1216 (webservice and worker take podMetadata and hand it to their deployment member [the role-deployment member]).</description></item><item><title>Transform, extension and lowering</title><link>https://www.gokure.dev/launcher/dev/contributing/oam-reference/transform-and-lowering/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.gokure.dev/launcher/dev/contributing/oam-reference/transform-and-lowering/index.html</guid><description>Implementation, history and tests of the sections on the reference page Transform, extension and lowering.&#10;Transform &amp; extension History: go-kure/launcher#734 (a TraitHandler.Apply must not replace, remove or rename a component’s application, its own or any other component’s of the bundle, including one whose traits already ran: the transform fails, naming the trait and the component, because NetworkPolicy synthesis finds a component’s application by its name and then its pointer, and a replaced, removed or renamed one would silently get no policy). go-kure/launcher#752 (nor may a TraitHandler.Apply rename a sibling group member’s application: the member would generate its objects under a name the group does not carry, so the transform fails, naming the trait, the group and the member’s type). go-kure/launcher#751 (each value ComponentCapabilityDefaults fills is validated against the component’s own PropertySchema, which must declare every listed key: the trait side’s schema may differ). go-kure/launcher#772 (a ComponentCapabilityDefaults handler that declares no schema relies on EvaluateProfile, which validates the binding only through the trait handler or trait lowering rule of the key’s type. Its fill is refused unless that handler or rule validates the rendering: it implements ValidateAndApplyDefaults, or the type is not built in and has a CapabilityDefinition, whose schema EvaluateProfile applies). go-kure/launcher#742 (persistentvolumeclaim implements ComponentCapabilityDefaults for pvc, storageClassName; every bound key a ComponentCapabilityDefaults handler takes defaults from is in ConsumedCapabilities). go-kure/launcher#761 (statefulset implements ComponentCapabilityFiller: it fills pvc’s storageClassName into each volumeClaimTemplates entry that leaves it unauthored (the entry’s storageClass until go-kure/launcher#1629, its spec.storageClassName since); a ComponentCapabilityFiller reads a binding only through lctx.Capability, which records the key in ConsumedCapabilities). go-kure/launcher#686 (every key a component, trait, document or policy lowering rule reads through LoweringContext.Capability is in ConsumedCapabilities). go-kure/launcher#792 (helmtemplate implements ApplicationNameSetter, whose hook-group child layouts are named &lt;application&gt;-&lt;component&gt;-NN-&lt;phase-slug&gt;). go-kure/launcher#787 (helmtemplate implements HookGroupNamePrefixSetter through HelmTemplateConfig.HookGroupNamePrefix, and LayoutKustomizationNameSetter through HelmTemplateConfig.LayoutKustomizationName, which AugmentLayout sets on the layout unless it carries one). go-kure/launcher#763 (when a SubApplicationDecorator’s Apply runs on a sub-application, it must not add, remove, replace, rename or reorder the bundle’s applications there (the transform fails), nor rename a sibling group member’s application, which the bundle does not hold: the transform fails, naming the trait, the sub-application it was decorating, the group and the member’s type). go-kure/launcher#782 (prune-protection and force-replace implement SubApplicationDecorator, whose Apply sets the application’s delivery intent and wraps nothing). go-kure/launcher#702 (no pod kind generates a ServiceAccount, so ServiceAccountName returns "" when none is authored; a webservice/worker hands its deployment member [now the role-deployment member] the name of the account it generates). go-kure/launcher#781 (no built-in handler writes PolicyResult.Extensions). go-kure/launcher#1317 (a named int32 or int64 is the same value as the int an integer schema gives it and as the int32 or int64 a number schema keeps, in either width and at any depth in a list or object: a rule that hands a named int32 on as an int64, or the reverse, reports copied under either schema). go-kure/launcher#1308 (a plain int, int32 or int64 is left as it is, so a rule that changes the number, or its kind (an integer to a float), still reports rendered, and so does a change of width between plain integers, which keep their width). go-kure/launcher#1323 (Provenance assumes a 64-bit int: on a 32-bit build a named int64 outside the range of int is not folded and reports rendered; launcher builds for amd64 and arm64 only). Lowering History: go-kure/launcher#626 (a component or policy is checked on its own copy of its properties in LowerRaws, so checking it cannot strip a reserved null from a trait or another element that shares its map before Transform sees it). go-kure/launcher#357 (LowerRaws schema-checked emitted traits itself; it does not any more, so a caller that relied on that adds the ValidateAuthoredProperties call). go-kure/launcher#1338 (both checks return the refusal as a *oam.GeneratedObjectCollisionError, with the text unchanged; for that error errors.Is(err, oam.ErrGeneratedObjectCollision) is true, also behind a prefix a caller adds, and errors.As finds the error and tells which objects collide and who produces each, without parsing the text). go-kure/launcher#646 (a component and another component’s trait, two components, or two traits can each generate the same object, and both pass Transform). go-kure/launcher#757 (one component’s own traits, or a trait and an application the component generates itself, rendering one object; two traits of one component whose sub-applications share a name read as 2 sub-applications "dup" of component "web", a trait named after its own component and that component as 2 applications "web" of component "web"). go-kure/launcher#787 (the transform itself refuses both of those shapes within one bundle (two applications of one name), so the check meets them only in a cluster built some other way; a name the Naming hook gave that meets, on another member, one it did not give is refused by name). go-kure/launcher#1072 and go-kure/launcher#1074 (both checks also hold an object a controller generates for a generated object as generated: for a HelmRelease with a chart template (spec.chart), helm-controller generates a source of the template’s kind named &lt;namespace&gt;-&lt;name&gt; after the HelmRelease, and the HelmChart claim is a refusal that a document that built before the claim existed may now meet: a helmchart component named &lt;namespace&gt;-&lt;name&gt; after a helmrelease beside it, in the same namespace). go-kure/launcher#1080 (GeneratedChartSource(obj) returns that source, and the helmrelease component reads its claim from it, and refuses a HelmRelease whose source helm-controller could not apply). go-kure/launcher#720 (a PersistentVolume or PersistentVolumeClaim that is force-applied, or covered by the ForceReplace delivery intent, is warned about, not refused: when an update changes an immutable field of a force-applied object, Flux deletes and recreates it instead of failing the apply, which can lose a claim’s data). go-kure/launcher#782 (an application is forced when it carries the ForceReplace delivery intent, which the force-replace trait sets). go-kure/launcher#781 (an application is forced when its bundle sets Force; launcher never does, so only a bundle whose Force the caller set before generating). go-kure/launcher#702 (a webservice/worker volumes entry that generates a claim, which one with claimName does not, is a synthesized pvc trait, so the claim is named as a sub-application of its component). go-kure/launcher#702 (webservice lowers to a deployment, a service and a serviceaccount member, which give Deployment, Service, ServiceAccount, then the claims of the deployment member’s synthesized pvc traits [the deployment member is of type role-deployment since go-kure/launcher#1629]). go-kure/launcher#794 (a config’s PodTemplateLabels() map[string]string: a member without it counts as running no pods; of the built-in pod kinds only deployment had it, the one pod kind a lowering rule emits into a group [since go-kure/launcher#1629 that is the role-deployment member; the raw deployment has none]). go-kure/launcher#755 (sub-applications are compared after each one’s ApplyPolicy has run, so a policy that renames a sub-application onto another member’s is refused, and the name it moved away from is free). go-kure/launcher#612 (a value a rule copied into a reserved key from a trait, a policy, metadata or another component, or changed after recording it, is refused like any authored one, including a number that only prints the same, such as an authored 1.0000000000000001e+18 over a rendered 1000000000000000100, or one that only compares equal, such as an authored -0.0 over a rendered 0.0, which a handler tells apart with math.Signbit). go-kure/launcher#609 and go-kure/launcher#626 (for the output of a rule whose input was not checked, which stays authored, the components and traits it emits at trait position and those nested in the components it emits are checked for reserved keys as they are emitted, before emission validation strips an explicit null, so a reserved key written as null is refused as when authored directly). go-kure/launcher#849 (a step attached with Component.AfterPolicy that holds the config to the policy refuses as ApplyPolicy does: an error that holds a PolicyRefusal fails the transform as the component’s ViolationError with the refusal’s class, any other error as a TransformError). go-kure/launcher#281 and go-kure/launcher#729 (the postgresql rule attaches a step to the cnpg-cluster it emits, CnpgClusterConfig.ApplyPostgresqlDefaults, to set the values postgresql derives after the policy). go-kure/launcher#783 (a rule that emits components of which one must be applied before another declares it on the later one with Component.OrderAfter(names...)). go-kure/launcher#784 (the helm rule orders the release after the source it generates or adopts, and the oci rule does the same for each Kustomization of a source several oci components share; the SourceDeduplicatable interface and the pass that let the first config of a shared source key emit it were removed). go-kure/launcher#1041 (a component a rule emits that must not wait for the component it lowers, but must still wait for what that one waits for, declares it with Component.WaitsAs(name)).</description></item><item><title>Parsing and type identity</title><link>https://www.gokure.dev/launcher/dev/contributing/oam-reference/parsing-and-types/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.gokure.dev/launcher/dev/contributing/oam-reference/parsing-and-types/index.html</guid><description>Implementation, history and tests of the sections on the reference page Parsing and type identity. Text in square brackets is added here to say what a moved sentence refers to.&#10;Parsing Implementation: The scaler entry is derived from the one table that also gives the scaler its HPA target kind (Deployment for the first four, StatefulSet for statefulset), so a type cannot be admitted without a target kind. The engine stamps the settled component type on the trait it applies (Trait.ComponentType(), empty outside a transform), which is where the scaler reads it. [“The scaler entry” is the scaler entry of traitComponentRestrictions, the registry the reference names; “the first four” are webservice, worker, deployment and the role-deployment member the two roles lower into.] History: go-kure/launcher#1179 (a scaler refuses authored replicas). go-kure/launcher#783 (tiers are declared, never derived from a type). go-kure/launcher#1703 (RegisterAuthoredComponent). Tests: pkg/oam/authored_component_test.go holds the reference’s paragraph on a library caller’s own component type: such a type parses and transforms, one registered with RegisterComponent alone is refused, and a scaler on an authored one is refused at parse. pkg/cmd/kurel’s TestBuiltinComponentHandlers_AcceptedByParser is the guard: it parses a minimal document for every registered built-in type through ParseWithExtraTypes, the same entry point kurel build uses. [“the guard” is the guard of the reference’s rule that a component type is validated against this package’s own allowlist and not against the caller’s handler registry; the reference’s “One other per-type registry” sentence follows it there.] Component type allowlist Tests: pkg/cmd/kurel’s TestKindLists_Complete fails on a type of the list with no row here and on a row of no type of the list, and TestKindLists_InOrder on a row out of place. [“the list” is validComponentTypes, “here” is the table of the reference’s “Component type allowlist”; this sentence continued the reference’s “A change that adds a type adds its row at its position”, where the sentence now ends.] Type identity History: go-kure/launcher#1258 (each handler, lowering rule and model declares its name and version when it registers; the registry is keyed by that pair).</description></item><item><title>Property schemas and contract metadata</title><link>https://www.gokure.dev/launcher/dev/contributing/oam-reference/schemas-and-contract/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.gokure.dev/launcher/dev/contributing/oam-reference/schemas-and-contract/index.html</guid><description>Implementation, history and tests of the sections on the reference page Property schemas and contract metadata. Text in square brackets is added here to say what a moved sentence refers to.&#10;Property schemas History: go-kure/launcher#421 (a kurel parameter’s Type is string, integer, boolean, array or object). go-kure/launcher#383 (Types is the union idiom: a leaf that accepts more than one scalar type). go-kure/launcher#790 (Exclusive is the one-of idiom). go-kure/launcher#635 (a reservation on an inner field of a declared array of objects is enforced wherever it is declared, not only at the top level; a reserved key authored as config: {locked: null} is not gone before Transform can refuse it). go-kure/launcher#1231 (spec.featureGates overrides a gate’s state in both directions). go-kure/launcher#1183 (a Gate no row names, or a row no schema uses, fails the schema tests). go-kure/launcher#1245 (gatedPaths is read by the gate check alone, so property validation and what a document is accepted as do not change). go-kure/launcher#1320 (a struct that does not encode as JSON is refused, with its path, where a gate below it is off at the target). go-kure/launcher#1450 (a pointer type that is its own element type, type P *P, is read through its JSON form like any other). go-kure/launcher#1230 (ValueGates, which maps an Enum value to the gate that value alone needs; like Gate, its key is rejected at the two flat call sites, so it is absent from their allow-sets). go-kure/launcher#1330 (ValueGatedPaths, a path that gates values; like Gate, its key is rejected at the two flat call sites). go-kure/launcher#1580 (BoundedBy, the refusal classes an authored value at a property can cause; its key is rejected at the two flat call sites and on a model input. Which facts a model may declare for its inputs is an open point of that issue). go-kure/launcher#408 (ValidateAuthoredProperties is the authored-path counterpart of the emitted-path check, and closes it). go-kure/launcher#1001 (postgresql points a key its backup replaced, objectStore and objectStoreObjectName, to where it went; and names the reason backup.objectStore refuses serverName, azureCredentials and googleCredentials). The hint was asked of a terminal component handler alone before go-kure/launcher#790; the three other positions are new. [The hint is UnsupportedFieldHint.] Before go-kure/launcher#790 a nested refusal carried no hint. go-kure/launcher#1466 (every refusal the property validators make is a *PropertyError). go-kure/launcher#1469 (the platform-reservation check is one of those refusals). go-kure/launcher#325 (the shape check is the only place an authored scalar’s type is enforced for every property). go-kure/launcher#1282 (the app argument is never edited, for a plain type name and for a declared type identity alike). go-kure/launcher#1463 (top-level Required is enforced as written, and a null counts as absent). go-kure/launcher#765 (nested Required, inside an object the author did write, is enforced). go-kure/launcher#750 (for a trait a binding matches, the check reads the trait’s properties as the rendering merges into them, recursively, so a required key the rendering supplies is not refused). Tests: A completeness test (pkg/cmd/kurel) enforces that every built-in schema node declares exactly one of Type and Types. A completeness test (pkg/cmd/kurel) enforces that no built-in schema node is left without a description. TestPropertySchemaFields_FlatSiteDecisions (pkg/oam) and TestLoad_InputSchemaFieldDecisions (pkg/oam/model) read the fields of PropertySchema by reflection and fail for one with no recorded decision: whether a kurel parameter, a capability rendering property and a model input accept its key. The TestBoundedBy tests (pkg/oam/builtin/registry) hold every boundedBy a registered schema publishes to a row that shows the refusal, and every row to a declaration. A declaration with no row, and a row with no declaration, both fail. What an explicit null means on the emitted path History: go-kure/launcher#394 (aligning the parser-level layer with this contract, a separate, lower-level concern, is not closed by this). go-kure/launcher#431 (capability rendering, checkCapabilityValueType, now agrees with the contract’s own behaviour). go-kure/launcher#430 (the networkpolicy peer parser read a typed nil namespaceSelector differently from an untyped one; both parsers now route their presence check through oam.IsNullValue’s reflect-based classification). Tests: What is asserted is the rule above: TestBuiltinHandlerSchemaEnumMembersHoldNoNull (pkg/cmd/kurel) walks every schema that ships for a member holding a null, because the runtime arm only fires once a document validates against the property carrying the Enum. [The rule is that no Enum member holds a null.] Contract metadata History: go-kure/launcher#789 (HandlerContractSet gained the Policies field, a breaking library change; every built-in handler and lowering rule implements ContractDescriber). go-kure/launcher#1027 (Prerequisites lists what must be in place in the target cluster, or beside it, for the output to work once applied). go-kure/launcher#1134 (Readiness lists, for each kind of resource an entity of this contract provides, how a reader judges that the resource is ready). go-kure/launcher#1144 (postgresql declares readiness, one entry for each kind it lowers into). go-kure/launcher#1611 (PlatformNeeds lists the capabilities the platform must serve for the output to work, as names; PolicyResult.PlatformNeeds reports those of the components the lowered application emits; a handler may answer per component through the optional ComponentPlatformNeeds; the CloudNativePG family kinds and postgresql declare theirs). Lowering targets and Seal History: go-kure/launcher#789 (a consumer that registers a built-in lowering rule without the types it lowers into now fails at Seal, a breaking library change). Lowering keys History: go-kure/launcher#1580 (webservice and worker publish where each key of their schema lands in their members, from the function the rule forwards with: roleKeys in pkg/oam/builtin/components/role_keys.go). go-kure/launcher#1601 (the expose trait rule publishes its map: pkg/oam/builtin/traits/expose_keys.go). Tests: pkg/oam/builtin/registry/lowering_keys_expose_test.go holds the expose map: a built-in trait lowering rule with neither a map nor a row fails; a key with no place under a controllerType reaches no trait of a document that builds; and it checks the member the report names for an expose trait on a webservice, a worker and a worker with an authored serviceAccountName. pkg/oam/builtin/registry/lowering_keys_test.go authors every key of both schemas and reads the result twice. From what the rule emits: the key changes a value at each declared place and at no other, and an unchanged place holds the authored value. From the provenance report, which names sources and holds no value: the entries the key moves sit at the declared places, and every entry of a sibling group names its member. A fill the key causes at the place of another key (a ReadWriteOnce or ReadWriteOncePod claim that is not also ReadWriteMany gives the deployment Recreate at strategy.type) is a row of the key’s sample; one with no row fails, and so does a row whose fill no longer happens. An entry the key removes is read the same way: it sat at a declared place, or on the member the sample says the key removes (an authored serviceAccountName and the generated account). It fails for a key added to a schema with no map entry or no sample, and for a built-in component lowering rule that has neither a map nor a row in its list of rules without one. The destinations of the keys a rule evaluates itself are a table beside the rule; these tests are what holds that table to the rule. pkg/oam/lowering_keys_test.go holds ComponentLoweringKeys(), ComponentPlainOwners() and TraitLoweringKeys() to the declared maps and owners and to returning a copy. pkg/oam/builtin/registry/plain_owner_test.go holds the plain owner (go-kure/launcher#1701): every type with a key map publishes one, and for documents of each type that the rule lowers (helm under both deliveries, oci with and without its own source, postgresql with and without a backup, a webservice and a worker with and without a generated account) the owner live for the document carries the component’s name in the lowered members, and some document has it alone under that name (a webservice has none: its service always shares the name). It is read from the members the rule builds, never from a table, so a rule that gives the name to another member fails it.</description></item><item><title>Policy defaults and capability system</title><link>https://www.gokure.dev/launcher/dev/contributing/oam-reference/policy-and-capability/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.gokure.dev/launcher/dev/contributing/oam-reference/policy-and-capability/index.html</guid><description>Implementation, history and tests of the sections on the reference page Policy defaults and capability system. Text in square brackets is added here to say what a moved sentence refers to.&#10;Policy defaults &amp; enforcement History: go-kure/launcher#752 (a trait’s sub-application runs its ApplyPolicy after the trait’s Apply, held to the TraitHandler rule). go-kure/launcher#786 (ExplicitSecretPolicy and AllowExplicitSecrets() bool). go-kure/launcher#790 (the secret kind component, one of the places the explicit-secret check reaches). go-kure/launcher#794 (a core Secret that the passthrough or manifests component carries, another of them). go-kure/launcher#922 (ObjectKindPolicy). go-kure/launcher#1644 (ImageReferencePolicy and SourceReferencePolicy: the level rides on the component, which the Transformer sets, so no handler method can bypass it; a config’s ImageReferences is read a second time at the policy’s level). Refusal classes History: go-kure/launcher#849 (the Class of a ViolationError, so that a consumer does not match error text). go-kure/launcher#1580 (RefusalResourceDefaultLimit: the refusal of an authored request above the policy’s default limit, added by go-kure/launcher#1582, had no class). Capability system Implementation: EvaluateProfile and this method resolve the validators through the same unexported function, so they cannot disagree. [“this method” is Transformer.CapabilityValidated; “the validators” are the trait handler, trait lowering rule or CapabilityDefinition schema that the reference names before it.] Rendering merge: authored values and nulls History: go-kure/launcher#742 (an authored null is absence in the merge of a rendering). go-kure/launcher#750 (where both the authored value and the rendering hold an object, the merge recurses). go-kure/launcher#765 (ValidateAuthoredPropertiesWithCapabilities checks nested Required on the merged properties). go-kure/launcher#751 (each value a ComponentCapabilityDefaults fill supplies is validated against the component’s own PropertySchema). go-kure/launcher#772 (a fill is refused when no trait handler, lowering rule or CapabilityDefinition validates the rendering and the component has no schema). go-kure/launcher#756 (both merges copy the rendering value and keep its Go type).</description></item><item><title>Pipeline</title><link>https://www.gokure.dev/launcher/dev/contributing/oam-reference/pipeline/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.gokure.dev/launcher/dev/contributing/oam-reference/pipeline/index.html</guid><description>Implementation, history and tests of the section on the reference page Pipeline. Text in square brackets is added here to say what a moved sentence refers to.&#10;Pipeline Implementation: Since go-kure/launcher#361 the absence of other labels is a property of the object as constructed rather than a scrub: kure’s release-1 builder contract (go-kure/kure ≥ v0.2.0-beta.11) makes CreateNetworkPolicy return TypeMeta and identity only, so netpol_synthesis.go’s np.Labels = nil / np.Annotations = nil lines no longer strip a constructor-stamped app: label and annotation — they are kept as a guard, not as a fix-up. Everything else on the policy (spec.podSelector, spec.policyTypes, the rules) is written by the synthesizer as a direct field assignment; nothing upstream of it supplies a default. [“the object as constructed” is the synthesized NetworkPolicy of the reference’s paragraph on a policy built with no labels and no annotations; “Everything else” is the spec of the policy, which the constructor leaves out.] Same resolution as the synthesis, not a copy. The Service owners come from the lookups the NetworkPolicy synthesis builds, and a port is matched by asking the owner’s ServiceRoutingTarget once per port. [This item came last in the reference’s list on Transformer.RoutedBackends, after the item on ports; “the synthesis” is the NetworkPolicy synthesis of the Phase-4 post-build stage.] History: go-kure/launcher#783 (the transform orders components only where the document declares an order; before it, the root node of an ordered application was named &lt;bundle&gt;). go-kure/kure#979 (the root node’s directory renders no bundle, the application bundle has a directory of its own inside it, and kure’s bootstrap points Flux at layout.TopDirectory). go-kure/kure#972 (Bundle.DirName gives that directory another name). go-kure/kure#1030 and go-kure/kure#1036 (kure shortens a default Kustomization name over 63 characters by its own rule, with the first 8 hexadecimal characters of the SHA-256 of the default). go-kure/kure#1032 (kure’s Flux integration refuses a name set on a layout, and a field set on a hook-group child, under any placement but FluxIntegratedPerLayout). go-kure/launcher#941 (under FluxIntegratedPerLayout the Kustomization of a default hook-group child regains the leading &lt;unit name&gt;-, and a Kustomization name launcher shortened becomes the one kure shortens). go-kure/launcher#787 (the leading &lt;unit name&gt;- on the Kustomization of a default hook-group child, which go-kure/launcher#941 restored). go-kure/launcher#781 (launcher sets no Flux delivery field on any bundle it returns). go-kure/kure#1016 (under FluxIntegratedPerLayout a bundle’s Wait, Timeout, RetryInterval, Labels and Annotations reach the Kustomizations of the layouts of the components it holds). go-kure/kure#1021 (the same for Interval, Prune, Force, Suspend, PostBuild and Patches). go-kure/kure#1022 (a bundle with child bundles that sets Wait no longer carries a spec.healthChecks entry per child). go-kure/kure#1020 (kure’s layout writers refuse a layout that holds an object written without a kind, or without an apiVersion). go-kure/kure#1017 (kure reads the resources a layout holds as kustomize builds them, a List standing for its items, by one rule in its pre-write checks and in its Flux integration). go-kure/launcher#1338 (an object whose config.kubernetes.io/local-config annotation is present with any value but "false" generates nothing and collides with nothing). go-kure/launcher#782 (the prune-protection and force-replace traits set stack.Application.Delivery, and launcher writes no Flux annotation for either). go-kure/launcher#712 (a component’s application is followed by the sub-applications its traits created, in creation order). go-kure/launcher#718 (a trait handler that moves an application or removes a sub-application keeps the order it left). go-kure/launcher#734 (a trait handler that replaces, removes or renames a component’s application fails the transform). go-kure/launcher#740 (under TransformContext.FluxNamespace a trait sub-application of a component follows its Flux objects only when the Flux object reads it by name from its own namespace). go-kure/launcher#1012 (an oci component’s source reads the Secret of a trait on its Kustomization). go-kure/launcher#1016 (the oci rule’s shared source reads the Secret one consumer’s trait makes). go-kure/launcher#988 (storageNamespace is defaulted to the same namespace as targetNamespace). go-kure/launcher#1039, go-kure/launcher#1079 and go-kure/launcher#1086 (TransformContext.GroupsWaitForFluxObjects; unset, launcher assumes the default delivery and refuses nothing). go-kure/launcher#1088 (the transform refuses a source that a Flux object of a group cannot become Ready without, when a component of a later group makes it). go-kure/launcher#788 (launcher puts the component label on every object a component owns and on its pod templates itself; it is the one label a synthesized NetworkPolicy gets). go-kure/launcher#572 (the app label and the app selectors the built-in components and traits generate use ComponentLabelValue). go-kure/launcher#790 (a service of type ExternalName selects no pods, so a route to it synthesizes no policy). go-kure/launcher#1157 (a routing trait’s ports for the Service of the component it runs on belong to the component that owns that Service name). go-kure/launcher#396 (no synthesized policy shares a selector with its inputs or with another policy). go-kure/launcher#1133 (Transformer.RoutedBackends).</description></item><item><title>Component label and ownership</title><link>https://www.gokure.dev/launcher/dev/contributing/oam-reference/labels-and-ownership/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.gokure.dev/launcher/dev/contributing/oam-reference/labels-and-ownership/index.html</guid><description>Implementation, history and tests of the sections on the reference page Component label and ownership. Text in square brackets is added here to say what a moved sentence refers to.&#10;Component label and ownership History: go-kure/launcher#788 (every application of a transformed document belongs to one authored component, or to the document as a whole). go-kure/launcher#783 (a generated source the application bundle holds, which every consumer shares, belongs to none: the document as a whole). go-kure/launcher#790 (the label is authoritative: before it writes the label, the wrapper holds every object the application generates to it). go-kure/launcher#1085 (the component label and reserved-key checks read a typed object in its JSON form with numbers kept exact, so a HelmRelease whose values hold a number no float64 holds is not refused for it). go-kure/launcher#944 (the StatefulSet volume claim templates, spec.volumeClaimTemplates[].metadata, are not read for the component label). go-kure/launcher#957 (the claim template of the storage of a Prometheus, PrometheusAgent, Alertmanager or ThanosRuler, spec.storage.volumeClaimTemplate.metadata, is not read for the component label). go-kure/launcher#788 (breaking library changes: every owned object and pod template gains the component label, a HelmRelease gains the post-renderer, and a component’s synthesized NetworkPolicies gain the label; a Job a cluster holds from before cannot take the label on its pod template; GeneratedApplication.Component changes; and stack.Application.Config is the ownership wrapper after Transform). go-kure/launcher#790 (the authoritative label, breaking library changes: a document that built before is refused at generation when an object it generates holds the component label’s key with a value that is not its component’s; under ComponentLabelKey: "app" what the built-in kinds and traits write still builds; and the reserved metadata keys are read in five more places, and in the metadata an operator copies onto objects it creates that are no pods, and in spec.commonMetadata of a Flux Kustomization, HelmRelease or ResourceSet). go-kure/launcher#790 (a CronJob’s job template, breaking library changes: every CronJob an owned application generates gains the component label on its job template, and a job template that holds a foreign value or a reserved metadata key is refused; new exported API ReservedKeyInJobTemplate). go-kure/launcher#790 (a selector that rules the label out, breaking library changes: an owned workload whose own selector rules the component label out of a pod template that carries no value for the key is refused, and so is one whose selector the check cannot read; new exported API ComponentLabelSelectorRulesOut). go-kure/launcher#790 (a renamed entry under the key app, breaking library changes: with ComponentLabelKey: "app" the synthesized inbound and egress NetworkPolicies of an entry a lowering rule emitted under a name whose label value differs from its component’s select app In [&lt;component&gt;, &lt;entry&gt;]). go-kure/launcher#790 (the authoritative label, new exported API: the sentinel ErrComponentLabelValue, the error type ComponentLabelError, the type ComponentLabelRefusal with four of its values, five values of ReservedKeyHolder, and the field ReservedMetadataKeyError.Path). go-kure/launcher#790 (metadata that reaches no pods, new exported API: nine values of ReservedKeyHolder). go-kure/launcher#944 (a StatefulSet’s volume claim templates, breaking library changes: a volume claim template that holds a reserved metadata key as a label or an annotation is refused at generation; new exported API ReservedKeyInVolumeClaimTemplate). go-kure/launcher#957 (a Prometheus operator kind’s storage claim template, breaking library changes: a storage claim template that holds a reserved metadata key is refused at generation, where neither spec.storage.emptyDir nor spec.storage.ephemeral is set; no new API). Tests: A test fails when the code asserts or switches on a new type directly on an application’s config (app.Config.(T), switch app.Config.(type)) and the wrapper’s list does not account for it. It reads syntax only: a config first copied to a variable or passed to a function, and asserted there, is outside what it sees. [“the wrapper” is launcher’s ownership wrapper, and “list” is configContracts in pkg/oam/component_ownership_test.go, which names each contract the wrapper forwards and, for each one it does not, why not.] labelReachReservedOnly in pkg/cmd/kurel/label_reach_test.go names each such field with what it reaches, and labelReachNotRead each field neither check reads. TestLabelReach_EveryFieldIsHeldOrListed derives these fields from the API types of the registered kind components, so a field a dependency adds fails the test until it is held or listed. [“such field” is a field of metadata that an operator copies onto other objects it creates, held to the reserved keys alone; “these fields” are the fields through which labels and annotations reach what the cluster creates from an object: those the two checks hold, and those the two names above list.] Reserved metadata keys History: go-kure/launcher#790 (TransformContext.ReservedMetadataKeys: one rule holds every application the transform returns to the list of reserved keys, whatever wrote the key). go-kure/launcher#944 (the metadata of each volume claim template of an apps StatefulSet is read for the reserved keys). go-kure/launcher#957 (the metadata of the storage claim template of a Prometheus, PrometheusAgent, Alertmanager or ThanosRuler is read for the reserved keys, where neither spec.storage.emptyDir nor spec.storage.ephemeral is set). go-kure/launcher#790 (library changes: the new exported field TransformContext.ReservedMetadataKeys, the sentinel ErrReservedMetadataKey, the error type ReservedMetadataKeyError with its ReservedKeyHolder values, and the method PlatformAnnotations() on the ingress trait’s config; breaking for documents: an expose trait whose authored annotation contradicts a value the trait writes is refused). Tests: labelReachNotRead in pkg/cmd/kurel/label_reach_test.go is the full list of fields of the kinds’ API types that hand metadata on and are not read. [“not read” is not read by either check.]</description></item></channel></rss>