Parsing and type identity
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.
Parsing
- Implementation:
- The
scalerentry is derived from the one table that also gives the scaler its HPA target kind (Deploymentfor the first four,StatefulSetforstatefulset), 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. [“Thescalerentry” is thescalerentry oftraitComponentRestrictions, the registry the reference names; “the first four” arewebservice,worker,deploymentand therole-deploymentmember the two roles lower into.]
- The
- History:
- go-kure/launcher#1179 (a
scalerrefuses authoredreplicas). - go-kure/launcher#783 (tiers are declared, never derived from a type).
- go-kure/launcher#1703 (
RegisterAuthoredComponent).
- go-kure/launcher#1179 (a
- Tests:
pkg/oam/authored_component_test.goholds the reference’s paragraph on a library caller’s own component type: such a type parses and transforms, one registered withRegisterComponentalone is refused, and ascaleron an authored one is refused at parse.pkg/cmd/kurel’sTestBuiltinComponentHandlers_AcceptedByParseris the guard: it parses a minimal document for every registered built-in type throughParseWithExtraTypes, the same entry pointkurel builduses. [“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’sTestKindLists_Completefails on a type of the list with no row here and on a row of no type of the list, andTestKindLists_InOrderon a row out of place. [“the list” isvalidComponentTypes, “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).