Files
NageshbansalandGitHub e8b1b4f653 feat: introduce casting kind (#116)
### 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
2026-05-16 17:40:03 +05:30

45 lines
1.2 KiB
Go

package installation
import "github.com/signoz/foundry/api/v1alpha1"
type SigNoz struct {
// Specification for signoz.
Spec v1alpha1.MoldingSpec `json:"spec" yaml:"spec" jsonschema:"description=Specification for SigNoz"`
// Status of signoz.
Status SigNozStatus `json:"status" yaml:"status,omitempty" jsonschema:"description=Status of SigNoz"`
_ struct{} `additionalProperties:"false"`
}
type SigNozStatus struct {
v1alpha1.MoldingStatus `json:",inline" yaml:",inline"`
Addresses SigNozStatusAddresses `json:"addresses" yaml:"addresses,omitempty" jsonschema:"description=Addresses of SigNoz"`
_ struct{} `additionalProperties:"false"`
}
type SigNozStatusAddresses struct {
// API server addresses.
APIServer []string `json:"apiserver" yaml:"apiserver" jsonschema:"description=API server addresses"`
// Opamp server addresses.
Opamp []string `json:"opamp" yaml:"opamp" jsonschema:"description=Opamp server addresses"`
_ struct{} `additionalProperties:"false"`
}
func DefaultSigNoz() SigNoz {
return SigNoz{
Spec: v1alpha1.MoldingSpec{
Enabled: v1alpha1.BoolPtr(true),
Cluster: v1alpha1.TypeCluster{
Replicas: v1alpha1.IntPtr(1),
},
Version: "latest",
Image: "signoz/signoz:latest",
},
}
}