Documentation
¶
Overview ¶
Package renderer simulates the Datadog Operator's reconciliation loop offline. Given a DatadogAgent (and optional DatadogAgentProfiles), Render returns the complete set of Kubernetes resources the operator would create — without needing a running cluster. Useful for golden-file regression tests and the operator-render CLI.
Index ¶
- func BuildScheme() *runtime.Scheme
- func LoadDAPs(paths []string) ([]*datadoghqv1alpha1.DatadogAgentProfile, error)
- func LoadDDA(path string) (*datadoghqv2alpha1.DatadogAgent, error)
- func Render(opts Options) ([]client.Object, *runtime.Scheme, error)
- func Serialize(objects []client.Object, scheme *runtime.Scheme, format string) ([]byte, error)
- func SortResources(objects []client.Object, scheme *runtime.Scheme) []client.Object
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildScheme ¶
BuildScheme returns a runtime.Scheme registered with all the API groups the operator's reconcilers and resource builders need.
func LoadDAPs ¶
func LoadDAPs(paths []string) ([]*datadoghqv1alpha1.DatadogAgentProfile, error)
LoadDAPs reads DatadogAgentProfile YAML manifests from disk.
func LoadDDA ¶
func LoadDDA(path string) (*datadoghqv2alpha1.DatadogAgent, error)
LoadDDA reads a DatadogAgent YAML manifest from disk.
func Render ¶
Render runs the operator reconcilers against the provided DDA and DAPs using a fake client, and returns all Kubernetes resources the operator would create. The returned scheme can be used to restore GVK on the collected objects (for serialization).
func Serialize ¶
Serialize converts resources to YAML or JSON with consistent, sorted key ordering. Key ordering is guaranteed because we round-trip through map[string]interface{} first; encoding/json sorts map keys alphabetically, and sigs.k8s.io/yaml converts via JSON. Supported formats: "yaml" (default), "json".
Types ¶
type Options ¶
type Options struct {
// DDA is the input DatadogAgent. Required.
DDA *datadoghqv2alpha1.DatadogAgent
// DAPs are optional DatadogAgentProfiles. They are passed to the
// reconciler regardless of ProfileEnabled, but only take effect when
// ProfileEnabled is true.
DAPs []*datadoghqv1alpha1.DatadogAgentProfile
// ProfileEnabled toggles DatadogAgentProfile reconciliation, mirroring
// the operator's --datadogAgentProfileEnabled flag.
ProfileEnabled bool
// SupportCilium emits CiliumNetworkPolicy resources alongside NetworkPolicy.
SupportCilium bool
}
Options configures a Render invocation.