flux

package
v0.16.5 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FluxChangeDiff

func FluxChangeDiff(currentSpec, newSpec *cluster.Spec) *types.ChangeDiff

Types

type FileGenerator

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

func NewFileGenerator

func NewFileGenerator() *FileGenerator

func NewFileGeneratorWithWriterTemplater

func NewFileGeneratorWithWriterTemplater(fluxWriter, eksaWriter filewriter.FileWriter, fluxTemplater, eksaTemplater Templater) *FileGenerator

NewFileGeneratorWithWriterTemplater takes flux and eksa writer and templater interface to build the generator. This is only for testing.

func (*FileGenerator) Init

func (g *FileGenerator) Init(writer filewriter.FileWriter, eksaSystemDir, fluxSystemDir string) error

func (*FileGenerator) WriteClusterConfig

func (g *FileGenerator) WriteClusterConfig(clusterSpec *cluster.Spec, datacenterConfig providers.DatacenterConfig, machineConfigs []providers.MachineConfig) error

func (*FileGenerator) WriteEksaFiles

func (g *FileGenerator) WriteEksaFiles(clusterSpec *cluster.Spec, datacenterConfig providers.DatacenterConfig, machineConfigs []providers.MachineConfig) error

func (*FileGenerator) WriteEksaKustomization

func (g *FileGenerator) WriteEksaKustomization() error

func (*FileGenerator) WriteFluxKustomization

func (g *FileGenerator) WriteFluxKustomization(clusterSpec *cluster.Spec) error

func (*FileGenerator) WriteFluxPatch

func (g *FileGenerator) WriteFluxPatch(clusterSpec *cluster.Spec) error

func (*FileGenerator) WriteFluxSync

func (g *FileGenerator) WriteFluxSync() error

func (*FileGenerator) WriteFluxSystemFiles

func (g *FileGenerator) WriteFluxSystemFiles(clusterSpec *cluster.Spec) error

type Flux

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

func NewFlux

func NewFlux(fluxClient FluxClient, kubeClient KubeClient, gitTools *gitFactory.GitTools, cliConfig *config.CliConfig) *Flux

func NewFluxFromGitOpsFluxClient

func NewFluxFromGitOpsFluxClient(fluxClient GitOpsFluxClient, gitClient GitClient, writer filewriter.FileWriter, cliConfig *config.CliConfig) *Flux

func (*Flux) Bootstrap

func (f *Flux) Bootstrap(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec) error

func (*Flux) BootstrapGit

func (f *Flux) BootstrapGit(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec) error

func (*Flux) BootstrapGithub

func (f *Flux) BootstrapGithub(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec) error

func (*Flux) CleanupGitRepo

func (f *Flux) CleanupGitRepo(ctx context.Context, clusterSpec *cluster.Spec) error

func (*Flux) ForceReconcileGitRepo

func (f *Flux) ForceReconcileGitRepo(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec) error

func (*Flux) Install

func (f *Flux) Install(ctx context.Context, cluster *types.Cluster, oldSpec, newSpec *cluster.Spec) error

func (*Flux) InstallGitOps

func (f *Flux) InstallGitOps(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec, datacenterConfig providers.DatacenterConfig, machineConfigs []providers.MachineConfig) error

func (*Flux) PauseClusterResourcesReconcile added in v0.11.2

func (f *Flux) PauseClusterResourcesReconcile(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec, provider providers.Provider) error

func (*Flux) ResumeClusterResourcesReconcile added in v0.11.2

func (f *Flux) ResumeClusterResourcesReconcile(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec, provider providers.Provider) error

func (*Flux) Uninstall

func (f *Flux) Uninstall(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec) error

func (*Flux) UpdateGitEksaSpec

func (f *Flux) UpdateGitEksaSpec(ctx context.Context, clusterSpec *cluster.Spec, datacenterConfig providers.DatacenterConfig, machineConfigs []providers.MachineConfig) error

func (*Flux) Upgrade

func (f *Flux) Upgrade(ctx context.Context, managementCluster *types.Cluster, currentSpec *cluster.Spec, newSpec *cluster.Spec) (*types.ChangeDiff, error)

func (*Flux) Validations

func (f *Flux) Validations(ctx context.Context, clusterSpec *cluster.Spec) []validations.Validation

type FluxClient

type FluxClient interface {
	BootstrapGithub(ctx context.Context, cluster *types.Cluster, fluxConfig *v1alpha1.FluxConfig) error
	BootstrapGit(ctx context.Context, cluster *types.Cluster, fluxConfig *v1alpha1.FluxConfig, cliConfig *config.CliConfig) error
	Uninstall(ctx context.Context, cluster *types.Cluster, fluxConfig *v1alpha1.FluxConfig) error
	Reconcile(ctx context.Context, cluster *types.Cluster, fluxConfig *v1alpha1.FluxConfig) error
}

FluxClient is an interface that abstracts the basic commands of flux executable.

type GitClient

type GitClient interface {
	GetRepo(ctx context.Context) (repo *git.Repository, err error)
	CreateRepo(ctx context.Context, opts git.CreateRepoOpts) error
	Clone(ctx context.Context) error
	Push(ctx context.Context) error
	Pull(ctx context.Context, branch string) error
	PathExists(ctx context.Context, owner, repo, branch, path string) (exists bool, err error)
	Add(filename string) error
	Remove(filename string) error
	Commit(message string) error
	Branch(name string) error
	Init() error
}

type GitOpsFluxClient

type GitOpsFluxClient interface {
	BootstrapGithub(ctx context.Context, cluster *types.Cluster, fluxConfig *v1alpha1.FluxConfig) error
	BootstrapGit(ctx context.Context, cluster *types.Cluster, fluxConfig *v1alpha1.FluxConfig, cliConfig *config.CliConfig) error
	Uninstall(ctx context.Context, cluster *types.Cluster, fluxConfig *v1alpha1.FluxConfig) error
	GetCluster(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec) (eksaCluster *v1alpha1.Cluster, err error)
	DisableResourceReconcile(ctx context.Context, cluster *types.Cluster, resourceType, objectName, namespace string) error
	EnableResourceReconcile(ctx context.Context, cluster *types.Cluster, resourceType, objectName, namespace string) error
	Reconcile(ctx context.Context, cluster *types.Cluster, fluxConfig *v1alpha1.FluxConfig) error
	ForceReconcile(ctx context.Context, cluster *types.Cluster, namespace string) error
	DeleteSystemSecret(ctx context.Context, cluster *types.Cluster, namespace string) error
}

type KubeClient

type KubeClient interface {
	GetEksaCluster(ctx context.Context, cluster *types.Cluster, clusterName string) (*v1alpha1.Cluster, error)
	UpdateAnnotation(ctx context.Context, resourceType, objectName string, annotations map[string]string, opts ...executables.KubectlOpt) error
	RemoveAnnotation(ctx context.Context, resourceType, objectName string, key string, opts ...executables.KubectlOpt) error
	DeleteSecret(ctx context.Context, managementCluster *types.Cluster, secretName, namespace string) error
}

KubeClient is an interface that abstracts the basic commands of kubectl executable.

type Templater

type Templater interface {
	WriteToFile(templateContent string, data interface{}, fileName string, f ...filewriter.FileOptionsFunc) (filePath string, err error)
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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