32ef58435d
This change replaces the usage of the clientcmd's PathOptions with a simpler filepath approach. The handling of the kube config file associated with airshipctl is now entirely managed by airshipctl. This also introduces the environment variable AIRSHIP_KUBECONFIG, which can be used to override the default location for airship's kube config. It can in turn be overridden by the command line argument. Prior to this change, the kube config object was created by creating a kubernetes client, then stripping off that client's config object. As a side effect, this change removes the middleman, and creates the kube config object directly from file. Change-Id: I99ba88d50a0f45c40597a58fe4b3fdfeb7d1467d
55 lines
1.6 KiB
Go
55 lines
1.6 KiB
Go
package config
|
|
|
|
// OutputFormat denotes the form with which to display tabulated data
|
|
type OutputFormat string
|
|
|
|
// Constants related to the ClusterType type
|
|
const (
|
|
Ephemeral = "ephemeral"
|
|
Target = "target"
|
|
AirshipClusterNameSep = "_"
|
|
AirshipClusterDefaultType = Target
|
|
)
|
|
|
|
// Sorted
|
|
var AllClusterTypes = [2]string{Ephemeral, Target}
|
|
|
|
// Constants defining default values
|
|
const (
|
|
AirshipConfigGroup = "airshipit.org"
|
|
AirshipConfigVersion = "v1alpha1"
|
|
AirshipConfigApiVersion = AirshipConfigGroup + "/" + AirshipConfigVersion
|
|
AirshipConfigKind = "Config"
|
|
|
|
AirshipConfigDir = ".airship"
|
|
AirshipConfig = "config"
|
|
AirshipKubeConfig = "kubeconfig"
|
|
|
|
AirshipConfigEnv = "AIRSHIPCONFIG"
|
|
AirshipKubeConfigEnv = "AIRSHIP_KUBECONFIG"
|
|
)
|
|
|
|
// Constants defining CLI flags
|
|
const (
|
|
FlagAPIServer = "server"
|
|
FlagAuthInfoName = "user"
|
|
FlagBearerToken = "token"
|
|
FlagCAFile = "certificate-authority"
|
|
FlagCertFile = "client-certificate"
|
|
FlagClusterName = "cluster"
|
|
FlagClusterType = "cluster-type"
|
|
FlagContext = "context"
|
|
FlagCurrentContext = "current-context"
|
|
FlagConfigFilePath = "airshipconf"
|
|
FlagEmbedCerts = "embed-certs"
|
|
FlagImpersonate = "as"
|
|
FlagImpersonateGroup = "as-group"
|
|
FlagInsecure = "insecure-skip-tls-verify"
|
|
FlagKeyFile = "client-key"
|
|
FlagManifest = "manifest"
|
|
FlagNamespace = "namespace"
|
|
FlagPassword = "password"
|
|
FlagTimeout = "request-timeout"
|
|
FlagUsername = "username"
|
|
)
|