Documentation ¶
Index ¶
Constants ¶
View Source
const GcloudDefaultFormat = "gke_{{ .Project }}_{{ .Cluster.Location }}_{{ .Cluster.Name }}"
GcloudDefaultFormat is the default context format used by the gcloud get-credentials command.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cluster ¶
type Cluster struct { Name string `json:"name"` Server string `json:"server"` Location string `json:"location"` CertificateAuthorityData []byte `json:"certificateAuthorityData"` }
func GetCluster ¶
type ContextNameFactory ¶
type Credentials ¶
type Credentials struct { AccessToken string `json:"access_token"` ExpiryTime time.Time `json:"token_expiry"` }
func GetGcpCredentials ¶
func GetGcpCredentials(ctx context.Context) (*Credentials, error)
type TemplateFactory ¶
type TemplateFactory struct { Format string // contains filtered or unexported fields }
func NewContextNameFactory ¶
func NewContextNameFactory(fallbackFormat string) (*TemplateFactory, error)
NewContextNameFactory returns a new ContextNameFactory, preferring the format string in `$KUBECTL_GKE_CONTEXT_FORMAT` over the provided string.
Click to show internal directories.
Click to hide internal directories.