basecluster

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigurationsYaml = `` /* 4402-byte string literal not displayed */

Variables

View Source
var (
	ErrMultipleManifests    = errors.New("multiple manifests found")
	ErrNoManifest           = errors.New("failed to find base cluster manifest file")
	ErrNoKustomizationYaml  = errors.New("kustomization.yaml is missing")
	ErrNoConfigurationsYaml = errors.New("configurations.yaml is missing")
	ErrMultipleClusters     = errors.New("there are 2 or more clusters")
	ErrNoClusterResource    = errors.New("no cluster resource found")
	ErrBuilderFailedRun     = errors.New("builder failed to run")
	ErrResourceHasNamespace = errors.New("resource has a namespace defined")
	Err2orMoreClusters      = errors.New("there are 2 or more clusters")
)

Functions

func Prepare

func Prepare(fileName string, validateOnly bool, casMax, casMin int) (clusterName string, modifiedYaml []byte, err error)

Prepare checks a cluster API manifest file for problems, and if validateOnly is false, outputs a modified copy as modifiedYaml if some resources have a namespace that needs removal. If validateOnly is true or no modifications are necessary, then modifiedYaml is nil. An error is returned if other types of (non-namespace related) issues are found in the manifest.

func PrepareGitDir

func PrepareGitDir(
	creds *argocd.RepoCreds,
	repoUrl string,
	repoRevision string,
	repoPath string,
	casMax int,
	casMin int,
) (clusterName string, changed bool, err error)

func Validate

func Validate(fileName string) (clusterName string, err error)

Validate verifies whether the resources in the specified file contain one and only one cluster, and that no resources have a namespace specified. If successful, the function returns the name of the cluster.

func ValidateGitDir

func ValidateGitDir(
	creds *argocd.RepoCreds,
	repoUrl string,
	repoRevision string,
	repoPath string,
) (clusterName string, err error)

Types

type KustomizationTemplateParams

type KustomizationTemplateParams struct {
	ManifestFileName string
}

Jump to

Keyboard shortcuts

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