Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetConfig ¶
GetConfig returns the currently loaded configuration via LoadConfig(). Returns an error if LoadConfig() has not been called.
func GetUser ¶
GetUser returns the currently configured user for a context Returns an error if LoadConfig() has not been called.
func LoadConfig ¶
LoadConfig loads a kubeconfig from the specified kubeconfigFile, or uses the recommended file from kubectl defaults ($HOME/.kube/config). If the file exists it will use the existing configuration as a base for the changes, otherwise it starts a new configuration. Returns an error only if the existing file is not a valid configuration or it can't be read.
func Remove ¶
Remove deletes all items related to the specified target: cluster, context, user. Returns an error if LoadConfig() has not been called.f
func UpdateConfig ¶
UpdateConfig loads the current kubeconfig file and applies the changes described in the tokenData. Once applied, it writes the changes to disk. It will use the specified name for the names of the cluster, user and context. It will create an additional context for each of the aliases provided
Types ¶
type TokenInfo ¶
type TokenInfo struct { // Username the identifier of the logged in user Username string // IDToken the JWT token for the user IDToken string // ClientID the id of the client requesting the authentication ClientID string // ClientSecret a secret to identify the client requesting the authentication ClientSecret string // IssuerURL the URL of the OIDC provider IssuerURL string // IssuerCA base64 encoded CA used to validate the Issuers certificate IssuerCA string // ClusterName name of the cluster that can be accessed with the IDToken ClusterName string // ClusterAPIServerURL URL of the apiserver of the cluster that can be accessed with the IDToken ClusterAPIServerURL string // ClusterCA base64 encoded CA of the cluster that can be accessed with the IDToken ClusterCA string }
TokenInfo contains the data required to configure an OIDC authenticator for kubectl