Documentation
¶
Index ¶
- Constants
- Variables
- func ContextName(cluster *infrastructure.KubernetesCluster) string
- func IsConfigNotFoundError(err error) bool
- func ReloginNeeded(err error) error
- func RemoveClusterFromKubeConfig(client *api.Client, clusterContext string) error
- func SetContextProject(kubeconfigPath string, contextName string, project string) error
- type ClusterCmd
- type Cmd
- type Config
- type LoginCmd
- type OIDCCmd
- type SetProjectCmd
Constants ¶
View Source
const (
LoginCmdName = "auth login"
)
View Source
const OIDCCmdName = "auth oidc"
Variables ¶
View Source
var (
// ErrConfigNotFound describes a missing nctl config in the kubeconfig
ErrConfigNotFound configError = "nctl config not found"
)
Functions ¶
func ContextName ¶
func ContextName(cluster *infrastructure.KubernetesCluster) string
func IsConfigNotFoundError ¶ added in v1.1.0
IsConfigNotFoundError returns true if the nctl config could not be found in the kubconfig context
func ReloginNeeded ¶ added in v1.1.0
ReloginNeeded returns an error which outputs the given err with a message saying that a re-login is needed.
func RemoveClusterFromKubeConfig ¶ added in v1.1.0
Types ¶
type ClusterCmd ¶
type Cmd ¶
type Cmd struct {
Login LoginCmd `cmd:"" help:"Login to nineapis.ch."`
Cluster ClusterCmd `cmd:"" help:"Authenticate with Kubernetes Cluster."`
OIDC OIDCCmd `cmd:"" help:"Perform interactive OIDC login." hidden:""`
SetProject SetProjectCmd `cmd:"" help:"Set the default project to be used."`
}
type Config ¶ added in v1.1.0
Config is used to store information in the kubeconfig context created
func ReadConfig ¶ added in v1.1.0
type LoginCmd ¶
type LoginCmd struct {
Organization string `arg:"" help:"Name of the organization to login to."`
APIURL string `help:"The URL of the Nine API" default:"https://nineapis.ch" env:"NCTL_API_URL" name:"api-url"`
APIToken string `help:"Use a static API token instead of using an OIDC login." env:"NCTL_API_TOKEN"`
IssuerURL string `help:"Issuer URL is the OIDC issuer URL of the API." default:"https://auth.nine.ch/auth/realms/pub"`
ClientID string `help:"Client ID is the OIDC client ID of the API." default:"nineapis.ch-f178254"`
ExecPlugin bool `help:"Automatically run exec plugin after writing the kubeconfig." hidden:"" default:"true"`
}
Click to show internal directories.
Click to hide internal directories.