mirror of
https://github.com/hanzoai/o11y-foundry.git
synced 2026-11-02 14:03:05 +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
21 lines
749 B
Go
21 lines
749 B
Go
package infrastructure
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/signoz/foundry/api/v1alpha1/installation"
|
|
"github.com/signoz/foundry/internal/domain"
|
|
)
|
|
|
|
// Generator is the interface for infrastructure-as-code generators.
|
|
// Implementations produce IaC manifests (e.g., Terraform, Pulumi) from a casting configuration
|
|
// and can validate the generated output using the underlying tool.
|
|
type Generator interface {
|
|
// Generate produces IaC materials from the casting configuration.
|
|
Generate(ctx context.Context, config installation.Casting) ([]domain.Material, error)
|
|
|
|
// Validate runs the IaC tool's built-in validation (e.g., terraform validate)
|
|
// against the manifests written to poursPath.
|
|
Validate(ctx context.Context, poursPath string) error
|
|
}
|