fluxcd

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FluxCD

type FluxCD struct {
	// Namespace is the Kubernetes namespace where FluxCD components will be installed.
	// If empty, defaults to "flux-system".
	Namespace string
}

FluxCD is an Extension that installs FluxCD (https://fluxcd.io) into the test environment. FluxCD is a GitOps continuous delivery solution for Kubernetes that keeps clusters in sync with configuration sources (like Git repositories) and automates configuration updates.

This extension installs the following FluxCD components:

  • source-controller: Handles source definitions (Git, Helm, OCI repositories)
  • kustomize-controller: Applies Kustomize overlays from sources
  • helm-controller: Manages Helm releases
  • notification-controller: Handles event notifications and webhooks
  • image-reflector-controller: Scans container registries for image metadata
  • image-automation-controller: Automates image updates in Git

All components are installed into the specified namespace (defaults to "flux-system").

Usage:

openmcp := setup.OpenMCPSetup{
    Extensions: []extensions.Extension{
        &fluxcd.FluxCD{
            Namespace: "custom-flux-ns", // Optional, defaults to "flux-system"
        },
    },
}

func (*FluxCD) Install

func (f *FluxCD) Install(ctx context.Context, cfg *envconf.Config) error

Install deploys FluxCD into the Kubernetes cluster using the native Go API. This method generates FluxCD manifests programmatically and applies them to the cluster, eliminating the need for the external flux CLI tool.

The installation process:

  1. Generates installation manifests using flux2's manifestgen package
  2. Splits the multi-document YAML into individual resources
  3. Unmarshals each resource as an unstructured object
  4. Creates each resource in the cluster (gracefully handling already-exists errors)

Returns an error if manifest generation or resource creation fails.

func (*FluxCD) Name

func (f *FluxCD) Name() string

Name returns the unique identifier for this extension.

func (*FluxCD) RegisterSchemes

func (f *FluxCD) RegisterSchemes(_ context.Context, scheme *runtime.Scheme) error

RegisterSchemes registers FluxCD's custom resource schemes with the Kubernetes client. This enables the test framework to work with FluxCD custom resources like HelmRelease, Kustomization, GitRepository, HelmRepository, etc.

The following schemes are registered:

  • helm-controller (HelmRelease)
  • kustomize-controller (Kustomization)
  • source-controller (GitRepository, HelmRepository, HelmChart, OCIRepository, Bucket)

Returns an error if any scheme registration fails.

Jump to

Keyboard shortcuts

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