Files
o11y-foundry/internal/planner/planner.go
NageshbansalandGitHub abbf0af044 refactor: better handle casting kind dispatch (#122)
#### Summary

Introduces a per-Kind `Planner` contract so Foundry can drive multiple
casting Kinds through a single pipeline. `Foundry.Forge` / `Cast` /
`Gauge` become Kind-agnostic; per-Kind state (registry, moldings,
casting strategy, enricher) lives in the Kind's own Planner.

#### Changes

- New `internal/planner` package defining the `Planner` contract.
- `Foundry` holds a `Planners` dispatch map; each casting package
implements the contract (`installation.Planner`,
`collectionagent.Planner`).
- Installation registry moves from `internal/foundry/registry.go` to
`internal/casting/installation/registry.go`.
- CollectionAgent Kind scaffolded: Planner + collector molding wired
end-to-end. No deployment castings yet.
- `MoldingKindCollector` added to `api/v1alpha1/molding_kind.go`.

Related: https://github.com/SigNoz/platform-pod/issues/1971,
https://github.com/SigNoz/platform-pod/issues/1972
2026-05-26 15:32:31 +05:30

31 lines
945 B
Go

package planner
import (
"context"
"github.com/signoz/foundry/api/v1alpha1"
"github.com/signoz/foundry/internal/domain"
"github.com/signoz/foundry/internal/tooler"
)
// Planner is the per-Kind contract Foundry iterates against. Every Kind
// expresses itself in the same vocabulary:
//
// - identity: Machinery, Patches, Toolers
// - ordering: MoldingKinds (the moldings this Kind processes, in order)
// - stages: EnrichStatus, Mold, MergeStatusIntoSpec
// - lifecycle: Forge, Cast
type Planner interface {
Machinery() v1alpha1.Machinery
Patches() []v1alpha1.PatchEntry
Toolers() []tooler.Tooler
MoldingKinds() []v1alpha1.MoldingKind
EnrichStatus(ctx context.Context, kind v1alpha1.MoldingKind) error
Mold(ctx context.Context, kind v1alpha1.MoldingKind) error
MergeStatusIntoSpec() error
Forge(ctx context.Context, target string) ([]domain.Material, error)
Cast(ctx context.Context, poursPath string) error
}