mirror of
https://github.com/hanzoai/o11y-foundry.git
synced 2026-10-30 18:26:45 +00:00
### Summary - Introduce a `kind` discriminator for Casting. Existing Casting without a kind field keep working, empty kind defaults to `Installation` - New `api/v1alpha1/installation/` subpackage with the Installation Casting, Spec types and holds its own JSON schema from its Go type: `installation/casting.schema.json` - New Machinery interface in `api/v1alpha1/machinery.go` exposes `Kind()` and `TrackableProperties()` so Dispatcher(Getv1alpha1 and Forge/Cast/Gauge) work across any kind without knowing its concrete type. - A root casting.schema.json lists every per-Kind schema to supports IDEs completion from one schema URL - cmd/foundryctl gen schemas reads a list of types from schemaTargets. Adding a kind means adding one entry. Related: https://github.com/SigNoz/platform-pod/issues/1970
18 lines
864 B
Go
18 lines
864 B
Go
package v1alpha1
|
|
|
|
// CastingMeta carries the apiVersion, kind, metadata, and status fields
|
|
// shared by every casting kind. Per-Kind Casting structs embed it inline.
|
|
type CastingMeta struct {
|
|
TypeVersion `json:",inline" yaml:",inline"`
|
|
Kind Kind `json:"kind" yaml:"kind" required:"true" description:"Kind of the casting resource."`
|
|
Metadata TypeMetadata `json:"metadata" yaml:"metadata" required:"true" description:"Metadata of the casting configuration"`
|
|
Status Status `json:"status,omitzero" yaml:"status,omitempty" description:"Status of the casting"`
|
|
_ struct{} `additionalProperties:"false"`
|
|
}
|
|
|
|
// Status carries the casting file's checksum.
|
|
type Status struct {
|
|
Checksum string `json:"checksum" yaml:"checksum" description:"Checksum of the casting file"`
|
|
_ struct{} `additionalProperties:"false"`
|
|
}
|