flux

package
v5.26.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package flux provides generators for Flux GitOps resources.

Index

Constants

View Source
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 FluxInstance 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 FluxInstance CR manifests.

func NewInstanceGenerator

func NewInstanceGenerator() *InstanceGenerator

NewInstanceGenerator creates a new InstanceGenerator.

func (*InstanceGenerator) Generate

Generate creates a FluxInstance 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 FluxInstance.

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 FluxInstance.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL