Documentation ¶
Index ¶
- Constants
- func BuildCloudKubernetesConfig(ts oauth2.TokenSource, remoteServer string) *rest.Config
- func CloudKubernetesContextName(projectID, region string) string
- func ExpandUser(path string) string
- func GetCloudKubernetesContext() (string, error)
- func GetRobotKubernetesContext() (string, error)
- func LoadOutOfClusterConfig(context string) (*rest.Config, error)
- func LoadOutOfClusterConfigLocal() (*rest.Config, error)
- func UpdateSecret(ctx context.Context, k8s kubernetes.Interface, input *corev1.Secret) error
- type PrefixingRoundtripper
Constants ¶
const (
LocalContext = "kubernetes-admin@kubernetes"
)
Variables ¶
This section is empty.
Functions ¶
func BuildCloudKubernetesConfig ¶
func BuildCloudKubernetesConfig(ts oauth2.TokenSource, remoteServer string) *rest.Config
BuildCloudKubernetesConfig build a kubernetes config for authenticated access to the cloud project.
func CloudKubernetesContextName ¶
CloudKubernetesContextName generates the name of the cloud kubernetes context from the GCP project ID and region.
func ExpandUser ¶
Expand paths of the form "~/path" to absolute paths.
func GetCloudKubernetesContext ¶
GetCloudKubernetesContext returns the name of the cloud kubernetes context.
func GetRobotKubernetesContext ¶
GetRobotKubernetesContext returns the name of the robot kubernetes context provided by the kubernetes-relay-client.
func LoadOutOfClusterConfigLocal ¶
LoadOutOfClusterConfig loads a local kubernetes config on the robot or workstation.
func UpdateSecret ¶
UpdateSecret (over-) writes a k8s secret.
Types ¶
type PrefixingRoundtripper ¶
type PrefixingRoundtripper struct { Prefix string Base http.RoundTripper }
PrefixingRoundtripper is a HTTP roundtripper that adds a specified prefix to all HTTP requests. We need to use it instead of setting APIPath because autogenerated and dynamic Kubernetes clients overwrite the REST config's APIPath.