env

package
v0.0.0-...-6c25587 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 8 Imported by: 63

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// TARGET_OUT environment variable
	// nolint: revive, stylecheck
	TARGET_OUT Variable = "TARGET_OUT"

	// LOCAL_OUT environment variable
	// nolint: revive, stylecheck
	LOCAL_OUT Variable = "LOCAL_OUT"

	// REPO_ROOT environment variable
	// nolint: revive, stylecheck
	REPO_ROOT Variable = "REPO_ROOT"

	// HUB is the Docker hub to be used for images.
	// nolint: revive, stylecheck
	HUB Variable = "HUB"

	// TAG is the Docker tag to be used for images.
	// nolint: revive, stylecheck
	TAG Variable = "TAG"

	// VARIANT is the Docker variant to be used for images.
	// nolint: revive, stylecheck
	VARIANT Variable = "VARIANT"

	// PULL_POLICY is the image pull policy to use when rendering templates.
	// nolint: revive, stylecheck
	PULL_POLICY Variable = "PULL_POLICY"

	// ECHO_IMAGE is the image to use when deploying echo services.
	// nolint: golint, revive, stylecheck
	ECHO_IMAGE Variable = "ECHO_IMAGE"

	// GRPC_ECHO_IMAGE is the image to use for a separate gRPC-only container in echo Pods.
	// nolint: golint, revive, stylecheck
	GRPC_ECHO_IMAGE Variable = "GRPC_ECHO_IMAGE"

	// KUBECONFIG is the list of Kubernetes configuration files. If configuration files are specified on
	// the command-line, that takes precedence.
	// nolint: revive, stylecheck
	KUBECONFIG Variable = "KUBECONFIG"

	// IstioSrc is the location of istio source ($TOP/src/istio.io/istio
	IstioSrc = REPO_ROOT.ValueOrDefaultFunc(getDefaultIstioSrc)

	// IstioOut is the location of the output directory ($TOP/out)
	IstioOut = verifyFile(TARGET_OUT, TARGET_OUT.ValueOrDefaultFunc(getDefaultIstioOut))

	// LocalOut is the location of the output directory for the OS we are running in,
	// not necessarily the OS we are building for
	LocalOut = verifyFile(LOCAL_OUT, LOCAL_OUT.ValueOrDefaultFunc(getDefaultIstioOut))

	// OtelCollectorInstallFilePath is the OpenTelemetry installation file.
	OtelCollectorInstallFilePath = path.Join(IstioSrc, getSampleFile("open-telemetry/otel.yaml"))

	// GCEMetadataServerInstallFilePath is the GCE Metadata Server installation file.
	GCEMetadataServerInstallFilePath = path.Join(IstioSrc, getInstallationFile("gcemetadata/gce_metadata_server.yaml"))

	// RegistryRedirectorServerInstallFilePath is the registry redirector installation file.
	RegistryRedirectorServerInstallFilePath = path.Join(IstioSrc, getInstallationFile("registryredirector/registry_redirector_server.yaml"))
)
View Source
var (

	// Root folder of this project
	// This relies on the fact this file is 3 levels up from the root; if this changes, adjust the path below
	Root = filepath.Join(filepath.Dir(b), "../../..")
)

Functions

func CheckFileExists

func CheckFileExists(path string) error

func ReadDepsSHA

func ReadDepsSHA(name string) (string, error)

func ReadVersion

func ReadVersion() (string, error)

ReadVersion returns the contents of the $ROOTDIR/VERSION file

Types

type Variable

type Variable string

Variable is a wrapper for an environment variable.

func (Variable) Name

func (e Variable) Name() string

Name of the environment variable.

func (Variable) Value

func (e Variable) Value() string

Value of the environment variable.

func (Variable) ValueOrDefault

func (e Variable) ValueOrDefault(defaultValue string) string

ValueOrDefault returns the value of the environment variable if it is non-empty. Otherwise returns the value provided.

func (Variable) ValueOrDefaultFunc

func (e Variable) ValueOrDefaultFunc(defaultValueFunc func() string) string

ValueOrDefaultFunc returns the value of the environment variable if it is non-empty. Otherwise returns the value function provided.

Jump to

Keyboard shortcuts

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