flux

package
v0.0.0-...-bac2f6a Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package flux provides Flux integration for GitOps

Index

Constants

View Source
const (
	// FluxNamespace is the default Flux namespace
	FluxNamespace = "flux-system"

	// Source API Group
	SourceGroup   = "source.toolkit.fluxcd.io"
	SourceVersion = "v1"

	// Kustomize API Group
	KustomizeGroup   = "kustomize.toolkit.fluxcd.io"
	KustomizeVersion = "v1"

	// Helm API Group
	HelmGroup   = "helm.toolkit.fluxcd.io"
	HelmVersion = "v2beta2"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

Controller implements GitOps operations using Flux

func NewController

func NewController(
	client client.Client,
	scheme *runtime.Scheme,
	synchronizer gitops.GitSynchronizer,
	log logr.Logger,
) (*Controller, error)

NewController creates a new Flux controller

func (*Controller) GetStatus

GetStatus returns the current GitOps status from Flux

func (*Controller) Promote

func (c *Controller) Promote(ctx context.Context, platform *observabilityv1.ObservabilityPlatform, targetEnv string) error

Promote promotes the platform to a new environment

func (*Controller) Reconcile

Reconcile reconciles Flux resources for the platform

func (*Controller) Rollback

func (c *Controller) Rollback(ctx context.Context, platform *observabilityv1.ObservabilityPlatform, revision string) error

Rollback performs a rollback using Flux

func (*Controller) Sync

Sync synchronizes the platform using Flux

type FluxManager

type FluxManager struct {
	Client client.Client
	Scheme *runtime.Scheme
	Log    logr.Logger
}

FluxManager manages Flux v2 integration

func NewFluxManager

func NewFluxManager(client client.Client, scheme *runtime.Scheme, log logr.Logger) *FluxManager

NewFluxManager creates a new Flux manager

func (*FluxManager) CreateGitRepository

func (m *FluxManager) CreateGitRepository(
	ctx context.Context,
	platform *observabilityv1.ObservabilityPlatform,
	gitOps *gitopsv1beta1.GitOpsIntegrationSpec,
) error

CreateGitRepository creates a Flux GitRepository source

func (*FluxManager) CreateImageUpdateAutomation

func (m *FluxManager) CreateImageUpdateAutomation(
	ctx context.Context,
	platform *observabilityv1.ObservabilityPlatform,
	gitOps *gitopsv1beta1.GitOpsIntegrationSpec,
) error

CreateImageUpdateAutomation creates Flux image update automation

func (*FluxManager) CreateKustomization

func (m *FluxManager) CreateKustomization(
	ctx context.Context,
	platform *observabilityv1.ObservabilityPlatform,
	gitOps *gitopsv1beta1.GitOpsIntegrationSpec,
) error

CreateKustomization creates a Flux Kustomization

func (*FluxManager) CreateMultiEnvironmentKustomizations

func (m *FluxManager) CreateMultiEnvironmentKustomizations(
	ctx context.Context,
	platform *observabilityv1.ObservabilityPlatform,
	gitOps *gitopsv1beta1.GitOpsIntegrationSpec,
) error

CreateMultiEnvironmentKustomizations creates Kustomizations for multiple environments

func (*FluxManager) DeleteFluxResources

func (m *FluxManager) DeleteFluxResources(
	ctx context.Context,
	platform *observabilityv1.ObservabilityPlatform,
) error

DeleteFluxResources deletes all Flux resources for a platform

func (*FluxManager) GetSyncStatus

func (m *FluxManager) GetSyncStatus(
	ctx context.Context,
	platform *observabilityv1.ObservabilityPlatform,
) (*SyncStatus, error)

GetSyncStatus gets the sync status of Flux resources

func (*FluxManager) TriggerReconciliation

func (m *FluxManager) TriggerReconciliation(
	ctx context.Context,
	platform *observabilityv1.ObservabilityPlatform,
) error

TriggerReconciliation triggers a reconciliation of Flux resources

type KustomizationManager

type KustomizationManager struct {
	// contains filtered or unexported fields
}

KustomizationManager handles Flux Kustomization resources

func NewKustomizationManager

func NewKustomizationManager(client client.Client, scheme *runtime.Scheme, log logr.Logger) *KustomizationManager

NewKustomizationManager creates a new KustomizationManager

func (*KustomizationManager) CreateKustomization

func (m *KustomizationManager) CreateKustomization(ctx context.Context, gitops *observabilityv1.GitOpsDeployment) error

CreateKustomization creates a Flux Kustomization resource

func (*KustomizationManager) DeleteKustomization

func (m *KustomizationManager) DeleteKustomization(ctx context.Context, name, namespace string) error

DeleteKustomization deletes a Flux Kustomization and related resources

func (*KustomizationManager) ForceReconcile

func (m *KustomizationManager) ForceReconcile(ctx context.Context, name, namespace string) error

ForceReconcile forces a reconciliation of the Kustomization

func (*KustomizationManager) GetKustomizationStatus

func (m *KustomizationManager) GetKustomizationStatus(ctx context.Context, name, namespace string) (*KustomizationStatus, error)

GetKustomizationStatus gets the status of a Flux Kustomization

type KustomizationStatus

type KustomizationStatus struct {
	Ready                 bool
	LastAppliedRevision   string
	LastAttemptedRevision string
	Message               string
	Conditions            []interface{}
}

KustomizationStatus represents the status of a Kustomization

type SyncStatus

type SyncStatus struct {
	Ready                  bool
	Message                string
	LastAppliedRevision    string
	LastAttemptedRevision  string
	LastHandledReconcileAt *metav1.Time
}

SyncStatus represents the sync status of Flux resources

Jump to

Keyboard shortcuts

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