lang

package
v0.24.0-rc5 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

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>".

Index

Constants

View Source
const (
	ErrLoadingConfig       = "failed to load config: %w"
	ErrLoadState           = "Failed to load the Zarf State from the Kubernetes cluster."
	ErrMarshal             = "failed to marshal file: %w"
	ErrNoClusterConnection = "Failed to connect to the Kubernetes cluster."
	ErrTunnelFailed        = "Failed to create a tunnel to the Kubernetes cluster."
	ErrUnmarshal           = "failed to unmarshal file: %w"
	ErrWritingFile         = "failed to write the file %s: %s"
)

All language strings should be in the form of a constant The constants should be grouped by the top level package they are used in (or common) The format should be <PathName><Err/Info><ShortDescription> Debug messages will not be a part of the language strings since they are not intended to be user facing Include sprintf formatting directives in the string if needed.

View Source
const (
	// root zarf command
	RootCmdShort = "DevSecOps for Airgap"
	RootCmdLong  = "Zarf eliminates the complexity of air gap software delivery for Kubernetes clusters and cloud native workloads\n" +
		"using a declarative packaging strategy to support DevSecOps in offline and semi-connected environments."

	RootCmdFlagLogLevel    = "Log level when running Zarf. Valid options are: warn, info, debug, trace"
	RootCmdFlagArch        = "Architecture for OCI images"
	RootCmdFlagSkipLogFile = "Disable log file creation"
	RootCmdFlagNoProgress  = "Disable fancy UI progress bars, spinners, logos, etc"
	RootCmdFlagCachePath   = "Specify the location of the Zarf cache directory"
	RootCmdFlagTempDir     = "Specify the temporary directory to use for intermediate files"
	RootCmdFlagInseure     = "" /* 189-byte string literal not displayed */

	RootCmdDeprecatedDeploy = "Please use \"zarf package deploy %s\" to deploy this package."
	RootCmdDeprecatedCreate = "Please use \"zarf package create\" to create this package."

	RootCmdErrInvalidLogLevel = "Invalid log level. Valid options are: warn, info, debug, trace."

	// zarf connect
	CmdConnectShort = "Access services or pods deployed in the cluster."
	CmdConnectLong  = "Uses a k8s port-forward to connect to resources within the cluster referenced by your kube-context.\n" +
		"Three default options for this command are <REGISTRY|LOGGING|GIT>. These will connect to the Zarf created resources " +
		"(assuming they were selected when performing the `zarf init` command).\n\n" +
		"Packages can provide service manifests that define their own shortcut connection options. These options will be " +
		"printed to the terminal when the package finishes deploying.\n If you don't remember what connection shortcuts your deployed " +
		"package offers, you can search your cluster for services that have the 'zarf.dev/connect-name' label. The value of that label is " +
		"the name you will pass into the 'zarf connect' command. \n\n" +
		"Even if the packages you deploy don't define their own shortcut connection options, you can use the command flags " +
		"to connect into specific resources. You can read the command flag descriptions below to get a better idea how to connect " +
		"to whatever resource you are trying to connect to."

	// zarf connect list
	CmdConnectListShort = "List all available connection shortcuts."

	CmdConnectFlagName       = "Specify the resource name.  E.g. name=unicorns or name=unicorn-pod-7448499f4d-b5bk6"
	CmdConnectFlagNamespace  = "Specify the namespace.  E.g. namespace=default"
	CmdConnectFlagType       = "Specify the resource type.  E.g. type=svc or type=pod"
	CmdConnectFlagLocalPort  = "(Optional, autogenerated if not provided) Specify the local port to bind to.  E.g. local-port=42000"
	CmdConnectFlagRemotePort = "Specify the remote port of the resource to bind to.  E.g. remote-port=8080"
	CmdConnectFlagCliOnly    = "Disable browser auto-open"

	// zarf destroy
	CmdDestroyShort = "Tear it all down, we'll miss you Zarf..."
	CmdDestroyLong  = "Tear down Zarf.\n\n" +
		"Deletes everything in the 'zarf' namespace within your connected k8s cluster.\n\n" +
		"If Zarf deployed your k8s cluster, this command will also tear your cluster down by " +
		"searching through /opt/zarf for any scripts that start with 'zarf-clean-' and executing them. " +
		"Since this is a cleanup operation, Zarf will not stop the teardown if one of the scripts produce " +
		"an error.\n\n" +
		"If Zarf did not deploy your k8s cluster, this command will delete the Zarf namespace, delete secrets " +
		"and labels that only Zarf cares about, and optionally uninstall components that Zarf deployed onto " +
		"the cluster. Since this is a cleanup operation, Zarf will not stop the uninstalls if one of the " +
		"resources produce an error while being deleted."

	CmdDestroyFlagConfirm          = "REQUIRED. Confirm the destroy action to prevent accidental deletions"
	CmdDestroyFlagRemoveComponents = "Also remove any installed components outside the zarf namespace"

	CmdDestroyErrNoScriptPath           = "" /* 128-byte string literal not displayed */
	CmdDestroyErrScriptPermissionDenied = "Received 'permission denied' when trying to execute the script (%s). Please double-check you have the correct kube-context."

	// zarf init
	CmdInitShort = "Prepares a k8s cluster for the deployment of Zarf packages"
	CmdInitLong  = "Injects a docker registry as well as other optional useful things (such as a git server " +
		"and a logging stack) into a k8s cluster under the 'zarf' namespace " +
		"to support future application deployments. \n" +
		"If you do not have a k8s cluster already configured, this command will give you " +
		"the ability to install a cluster locally.\n\n" +
		"This command looks for a zarf-init package in the local directory that the command was executed " +
		"from. If no package is found in the local directory and the Zarf CLI exists somewhere outside of " +
		"the current directory, Zarf will failover and attempt to find a zarf-init package in the directory " +
		"that the Zarf binary is located in.\n\n\n\n" +
		"Example Usage:\n" +
		"# Initializing without any optional components:\nzarf init\n\n" +
		"# Initializing w/ Zarfs internal git server:\nzarf init --components=git-server\n\n" +
		"# Initializing w/ Zarfs internal git server and PLG stack:\nzarf init --components=git-server,logging\n\n" +
		"# Initializing w/ an internal registry but with a different nodeport:\nzarf init --nodeport=30333\n\n" +
		"# Initializing w/ an external registry:\nzarf init --registry-push-password={PASSWORD} --registry-push-username={USERNAME} --registry-url={URL}\n\n" +
		"# Initializing w/ an external git server:\nzarf init --git-push-password={PASSWORD} --git-push-username={USERNAME} --git-url={URL}\n\n"

	CmdInitErrFlags             = "Invalid command flags were provided."
	CmdInitErrDownload          = "failed to download the init package: %s"
	CmdInitErrValidateGit       = "the 'git-push-username' and 'git-push-password' flags must be provided if the 'git-url' flag is provided"
	CmdInitErrValidateRegistry  = "the 'registry-push-username' and 'registry-push-password' flags must be provided if the 'registry-url' flag is provided "
	CmdInitErrUnableCreateCache = "Unable to create the cache directory: %s"

	CmdInitDownloadAsk       = "It seems the init package could not be found locally, but can be downloaded from %s"
	CmdInitDownloadNote      = "Note: This will require an internet connection."
	CmdInitDownloadConfirm   = "Do you want to download this init package?"
	CmdInitDownloadCancel    = "Confirm selection canceled: %s"
	CmdInitDownloadErrManual = "download the init package manually and place it in the current working directory"

	CmdInitFlagSet = "Specify deployment variables to set on the command line (KEY=value)"

	CmdInitFlagConfirm      = "Confirm the install without prompting"
	CmdInitFlagComponents   = "Specify which optional components to install.  E.g. --components=git-server,logging"
	CmdInitFlagStorageClass = "Specify the storage class to use for the registry.  E.g. --storage-class=standard"

	CmdInitFlagGitURL      = "External git server url to use for this Zarf cluster"
	CmdInitFlagGitPushUser = "Username to access to the git server Zarf is configured to use. User must be able to create repositories via 'git push'"
	CmdInitFlagGitPushPass = "Password for the push-user to access the git server"
	CmdInitFlagGitPullUser = "Username for pull-only access to the git server"
	CmdInitFlagGitPullPass = "Password for the pull-only user to access the git server"

	CmdInitFlagRegURL      = "External registry url address to use for this Zarf cluster"
	CmdInitFlagRegNodePort = "Nodeport to access a registry internal to the k8s cluster. Between [30000-32767]"
	CmdInitFlagRegPushUser = "Username to access to the registry Zarf is configured to use"
	CmdInitFlagRegPushPass = "Password for the push-user to connect to the registry"
	CmdInitFlagRegPullUser = "Username for pull-only access to the registry"
	CmdInitFlagRegPullPass = "Password for the pull-only user to access the registry"
	CmdInitFlagRegSecret   = "Registry secret value"

	// zarf tools
	CmdToolsShort = "Collection of additional tools to make airgap easier"

	CmdToolsArchiverShort           = "Compress/Decompress generic archives, including Zarf packages."
	CmdToolsArchiverCompressShort   = "Compress a collection of sources based off of the destination file extension."
	CmdToolsArchiverCompressErr     = "Unable to perform compression"
	CmdToolsArchiverDecompressShort = "Decompress an archive or Zarf package based off of the source file extension."
	CmdToolsArchiverDecompressErr   = "Unable to perform decompression"

	CmdToolsRegistryShort = "Tools for working with container registries using go-containertools."

	CmdToolGetGitDeprecation  = "Deprecated: This command has been replaced by 'zarf tools get-creds git' and will be removed in a future release."
	CmdToolsGetGitPasswdShort = "Returns the push user's password for the Git server"
	CmdToolsGetGitPasswdLong  = "Reads the password for a user with push access to the configured Git server from the zarf-state secret in the zarf namespace"
	CmdToolsGetGitPasswdInfo  = "Git Server Push Password: "

	CmdToolsMonitorShort = "Launch a terminal UI to monitor the connected cluster using K9s."

	CmdToolsClearCacheShort         = "Clears the configured git and image cache directory."
	CmdToolsClearCacheErr           = "Unable to clear the cache directory %s"
	CmdToolsClearCacheSuccess       = "Successfully cleared the cache from %s"
	CmdToolsClearCacheFlagCachePath = "Specify the location of the Zarf  artifact cache (images and git repositories)"

	CmdToolsGenPkiShort       = "Generates a Certificate Authority and PKI chain of trust for the given host"
	CmdToolsGenPkiSuccess     = "Successfully created a chain of trust for %s"
	CmdToolsGenPkiFlagAltName = "Specify Subject Alternative Names for the certificate"

	CmdToolsSbomShort = "Generates a Software Bill of Materials (SBOM) for the given package"
	CmdToolsSbomErr   = "Unable to create sbom (syft) CLI"

	CmdToolsGetCredsShort = "Display a Table of credentials for deployed components. Pass a component name to get a single credential."
	CmdToolsGetCredsLong  = "" /* 143-byte string literal not displayed */

	// zarf version
	CmdVersionShort = "SBOM tools provided by Anchore Syft"
	CmdVersionLong  = "Displays the version of the Zarf release that the Zarf binary was built from."

	// cmd viper setup
	CmdViperErrLoadingConfigFile = "failed to load config file: %w"
	CmdViperInfoUsingConfigFile  = "Using config file %s"
)

Zarf CLI commands.

View Source
const (
	AgentInfoWebhookAllowed = "Webhook [%s - %s] - Allowed: %t"
	AgentInfoShutdown       = "Shutdown gracefully..."
	AgentInfoPort           = "Server running in port: %s"

	AgentErrBadRequest             = "could not read request body: %s"
	AgentErrBindHandler            = "Unable to bind the webhook handler"
	AgentErrCouldNotDeserializeReq = "could not deserialize request: %s"
	AgentErrGetState               = "failed to load zarf state from file: %w"
	AgentErrHostnameMatch          = "failed to complete hostname matching: %w"
	AgentErrImageSwap              = "Unable to swap the host for (%s)"
	AgentErrInvalidMethod          = "invalid method only POST requests are allowed"
	AgentErrInvalidOp              = "invalid operation: %s"
	AgentErrInvalidType            = "only content type 'application/json' is supported"
	AgentErrMarshallJSONPatch      = "unable to marshall the json patch"
	AgentErrMarshalResponse        = "unable to marshal the response"
	AgentErrNilReq                 = "malformed admission review: request is nil"
	AgentErrShutdown               = "unable to properly shutdown the web server"
	AgentErrStart                  = "Failed to start the web server"
)

Zarf Agent messages These are only seen in the Kubernetes logs.

View Source
const (
	PkgValidateMustBeUppercase            = "variable name '%s' must be all uppercase and contain no special characters except _"
	PkgValidateErrAction                  = "invalid action: %w"
	PkgValidateErrChart                   = "invalid chart definition: %w"
	PkgValidateErrChartName               = "chart %s exceed the maximum length of %d characters"
	PkgValidateErrChartNameMissing        = "chart %s must include a name"
	PkgValidateErrChartNamespaceMissing   = "chart %s must include a namespace"
	PkgValidateErrChartURLOrPath          = "chart %s must only have a url or localPath"
	PkgValidateErrChartVersion            = "chart %s must include a chart version"
	PkgValidateErrComponentNameNotUnique  = "component name '%s' is not unique"
	PkgValidateErrComponent               = "invalid component: %w"
	PkgValidateErrComponentReqDefault     = "component %s cannot be both required and default"
	PkgValidateErrComponentReqGrouped     = "component %s cannot be both required and grouped"
	PkgValidateErrComponentYOLO           = "component %s incompatible with the online-only package flag (metadata.yolo): %w"
	PkgValidateErrConstant                = "invalid package constant: %w"
	PkgValidateErrImportPathInvalid       = "invalid file path \"%s\" provided directory must contain a valid zarf.yaml file"
	PkgValidateErrImportPathMissing       = "imported package %s must include a path"
	PkgValidateErrInitNoYOLO              = "sorry, you can't YOLO an init package"
	PkgValidateErrManifest                = "invalid manifest definition: %w"
	PkgValidateErrManifestFileOrKustomize = "manifest %s must have at least one file or kustomization"
	PkgValidateErrManifestNameLength      = "manifest %s exceed the maximum length of %d characters"
	PkgValidateErrManifestNameMissing     = "manifest %s must include a name"
	PkgValidateErrName                    = "invalid package name: %w"
	PkgValidateErrPkgConstantName         = "constant name '%s' must be all uppercase and contain no special characters except _"
	PkgValidateErrPkgName                 = "package name '%s' must be all lowercase and contain no special characters except -"
	PkgValidateErrVariable                = "invalid package variable: %w"
	PkgValidateErrYOLONoArch              = "cluster architecture not allowed"
	PkgValidateErrYOLONoDistro            = "cluster distros not allowed"
	PkgValidateErrYOLONoGit               = "git repos not allowed"
	PkgValidateErrYOLONoOCI               = "OCI images not allowed"
)

src/internal/packager/validate.

Variables

View Source
var (
	ErrInitNotFound = errors.New("this command requires a zarf-init package, but one was not found on the local system. Re-run the last command again without '--confirm' to download the package")
)

Collection of reusable error messages.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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