config

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package config stores the global configuration and constants.

Index

Constants

View Source
const (
	GithubProject = "defenseunicorns/zarf"

	// ZarfMaxChartNameLength limits helm chart name size to account for K8s/helm limits and zarf prefix
	ZarfMaxChartNameLength   = 40
	ZarfGeneratedPasswordLen = 24
	ZarfGeneratedSecretLen   = 48

	ZarfAgentHost = "agent-hook.zarf.svc"

	ZarfConnectLabelName             = "zarf.dev/connect-name"
	ZarfConnectAnnotationDescription = "zarf.dev/connect-description"
	ZarfConnectAnnotationURL         = "zarf.dev/connect-url"

	ZarfManagedByLabel     = "app.kubernetes.io/managed-by"
	ZarfCleanupScriptsPath = "/opt/zarf"

	ZarfPackagePrefix = "zarf-package-"

	ZarfDeployStage = "Deploy"
	ZarfCreateStage = "Create"
	ZarfMirrorStage = "Mirror"
)

Zarf Global Configuration Constants.

View Source
const (
	ZarfArtifactTokenName = "zarf-artifact-registry-token"

	ZarfImagePullSecretName = "private-registry"
	ZarfGitServerSecretName = "private-git-server"

	ZarfRegistryPushUser                   = "zarf-push"
	ZarfRegistryPullUser                   = "zarf-pull"
	ZarfInClusterContainerRegistryNodePort = 31999

	ZarfGitPushUser = "zarf-git-user"
	ZarfGitReadUser = "zarf-git-read-user"

	ZarfInClusterGitServiceURL      = "http://zarf-gitea-http.zarf.svc.cluster.local:3000"
	ZarfInClusterArtifactServiceURL = ZarfInClusterGitServiceURL + "/api/packages/" + ZarfGitPushUser

	ZarfLoggingUser = "zarf-admin"
)

Zarf Constants for In-Cluster Services.

Variables

View Source
var (
	// CLIVersion track the version of the CLI
	CLIVersion = "unset"

	// ActionsUseSystemZarf sets whether to use Zarf from the system path if Zarf is being used as a library
	ActionsUseSystemZarf = false

	// ActionsCommandZarfPrefix sets a sub command prefix that Zarf commands are under in the current binary if Zarf is being used as a library (and use system Zarf is not specified)
	ActionsCommandZarfPrefix = ""

	// CommonOptions tracks user-defined values that apply across commands
	CommonOptions types.ZarfCommonOptions

	// CLIArch is the computer architecture of the device executing the CLI commands
	CLIArch string

	// ZarfSeedPort is the NodePort Zarf uses for the 'seed registry'
	ZarfSeedPort string

	// SkipLogFile is a flag to skip logging to a file
	SkipLogFile bool

	// NoColor is a flag to disable colors in output
	NoColor bool

	CosignPublicKey string
	ZarfSchema      embed.FS

	ZarfDefaultCachePath   = filepath.Join("~", ".zarf-cache")
	ZarfDefaultHelmTimeout = 15 * time.Minute
)

Zarf Global Configuration Variables.

Functions

func GetAbsCachePath added in v0.22.0

func GetAbsCachePath() string

GetAbsCachePath gets the absolute cache path for images and git repos.

func GetAbsHomePath added in v0.28.1

func GetAbsHomePath(path string) string

GetAbsHomePath replaces ~ with the absolute path to a user's home dir

func GetArch

func GetArch(archs ...string) string

GetArch returns the arch based on a priority list with options for overriding.

func GetCraneAuthOption added in v0.18.3

func GetCraneAuthOption(username string, secret string) crane.Option

GetCraneAuthOption returns a crane auth option with the provided credentials.

func GetCraneOptions

func GetCraneOptions(insecure bool, archs ...string) []crane.Option

GetCraneOptions returns a crane option object with the correct options & platform.

func GetDataInjectionMarker added in v0.21.0

func GetDataInjectionMarker() string

GetDataInjectionMarker returns the data injection marker based on the current CLI start time.

func GetStartTime added in v0.21.0

func GetStartTime() int64

GetStartTime returns the timestamp of when the CLI was started.

func GetValidPackageExtensions

func GetValidPackageExtensions() [2]string

GetValidPackageExtensions returns the valid package extensions.

func IsValidFileExtension added in v0.30.0

func IsValidFileExtension(filename string) bool

IsValidFileExtension returns true if the filename has a valid package extension.

Types

This section is empty.

Directories

Path Synopsis
Package lang contains the language strings for english used by Zarf Alternative languages can be created by duplicating this file and changing the build tag to "//go:build alt_language && <language>".
Package lang contains the language strings for english used by Zarf Alternative languages can be created by duplicating this file and changing the build tag to "//go:build alt_language && <language>".

Jump to

Keyboard shortcuts

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