Documentation
¶
Overview ¶
Package flux provides generators for Flux GitOps resources.
Index ¶
Constants ¶
const DefaultInterval = time.Minute
DefaultInterval is the default reconciliation interval for Instance.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Distribution ¶
type Distribution struct {
Version string `json:"version" yaml:"version"`
Registry string `json:"registry" yaml:"registry"`
}
Distribution references the Flux manifests and controller images.
type Instance ¶
type Instance struct {
APIVersion string `json:"apiVersion" yaml:"apiVersion"`
Kind string `json:"kind" yaml:"kind"`
Metadata InstanceMetadata `json:"metadata" yaml:"metadata"`
Spec InstanceSpec `json:"spec" yaml:"spec"`
}
Instance represents a Flux Operator Instance CR for scaffolding. This is a simplified version for YAML generation, without runtime.Object methods.
type InstanceGenerator ¶
type InstanceGenerator struct {
// contains filtered or unexported fields
}
InstanceGenerator generates Instance CR manifests.
func NewInstanceGenerator ¶
func NewInstanceGenerator() *InstanceGenerator
NewInstanceGenerator creates a new InstanceGenerator.
func (*InstanceGenerator) Generate ¶
func (g *InstanceGenerator) Generate(opts InstanceGeneratorOptions) (string, error)
Generate creates a Instance CR manifest.
type InstanceGeneratorOptions ¶
type InstanceGeneratorOptions struct {
yamlgenerator.Options
// ProjectName is used to construct the OCI registry URL.
ProjectName string
// RegistryHost is the host of the local OCI registry.
RegistryHost string
// RegistryPort is the port of the local OCI registry.
RegistryPort int32
// Ref is the OCI artifact tag/reference (defaults to "dev").
Ref string
// Interval is the reconciliation interval.
Interval time.Duration
// SecretName is the name of the Kubernetes secret containing registry credentials.
// If set, a secretRef will be added to the sync configuration.
SecretName string
}
InstanceGeneratorOptions contains options for generating Instance.
type InstanceMetadata ¶
type InstanceMetadata struct {
Name string `json:"name" yaml:"name"`
Namespace string `json:"namespace" yaml:"namespace"`
Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
}
InstanceMetadata contains the metadata for a Instance.
type InstanceSpec ¶
type InstanceSpec struct {
Distribution Distribution `json:"distribution" yaml:"distribution"`
Sync *Sync `json:"sync,omitempty" yaml:"sync,omitempty"`
}
InstanceSpec contains the distribution and sync configuration.
type Sync ¶
type Sync struct {
Kind string `json:"kind" yaml:"kind"`
URL string `json:"url" yaml:"url"`
Ref string `json:"ref" yaml:"ref"`
Path string `json:"path" yaml:"path"`
Interval *metav1.Duration `json:"interval,omitempty" yaml:"interval,omitempty"`
PullSecret string `json:"pullSecret,omitempty" yaml:"pullSecret,omitempty"`
}
Sync configures the OCI source that Flux will track and apply.