env

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package env provides functions to get the cluster name from environment

Index

Constants

View Source
const (
	// ClusterNameEnvKey is the environment variable that specifies the system cluster name.
	// ClusterName can be attached to the created resource. When there are multiple clusters, the resource can be found by the api by the cluster name.
	ClusterNameEnvKey = "SYSTEM_CLUSTER_NAME" // NOSONAR // ignore: "Key" detected here, make sure this is not a hard-coded credential

	// BASE_DOMAIN used to get the data of BASE_DAMAIN from the environment variable.
	// Usually used as the base value of label or annotation. For example: {BASE_DOMAIN}/label: value.
	BaseDomainEnvKey = "BASE_DOMAIN"
)

Variables

View Source
var GetCurrentClusterName = defaultGetCurrentClusterName

GetCurrentClusterName returns current cluster name

Functions

func BaseDomain added in v0.11.0

func BaseDomain() string

BaseDomain return BASE_DOMAIN value from environment variable. when BASE_DOMAIN not set, will return "katanomi.dev"

func ClusterName

func ClusterName() string

ClusterName returns the cluster name that describes the cluster name the instance runs on. You need to specify the relevant environment variables through deployment when deploying.

Types

This section is empty.

Jump to

Keyboard shortcuts

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