Documentation
¶
Index ¶
- Variables
- func ClusterDetailsFromContext(ctx context.Context) (*autodetect.ClusterDetails, error)
- func ClusterDetailsFromContextOrExit(ctx context.Context) *autodetect.ClusterDetails
- func ClusterKindFromContext(ctx context.Context) autodetect.Kind
- func ContextWithClusterDetails(parent context.Context, clusterDetails *autodetect.ClusterDetails) context.Context
- func ContextWithKubeClient(parent context.Context, kubeClient *kube.Client) context.Context
- func K8SVersionFromContext(ctx context.Context) *version.Version
- func KubeClientFromContext(ctx context.Context) (*kube.Client, error)
- func KubeClientFromContextOrExit(ctx context.Context) *kube.Client
Constants ¶
This section is empty.
Variables ¶
var ( ErrCtxIsNil = errors.New("context is nil when trying to get kube client") ErrCtxWithoutKubeClient = errors.New("context does not contain kube client") )
var (
ErrCtxWithoutClusterDetails = errors.New("context does not contain cluster info")
)
Functions ¶
func ClusterDetailsFromContext ¶
func ClusterDetailsFromContext(ctx context.Context) (*autodetect.ClusterDetails, error)
ClusterDetailsFromContext returns the current cluster details from ctx.
func ClusterDetailsFromContextOrExit ¶
func ClusterDetailsFromContextOrExit(ctx context.Context) *autodetect.ClusterDetails
ClusterDetailsFromContextOrExit returns the current cluster details from ctx.
If no details are currently set in ctx the program will exit with an error message.
func ClusterKindFromContext ¶
func ClusterKindFromContext(ctx context.Context) autodetect.Kind
ClusterKindFromContext returns the current cluster kind from ctx. If no kind is currently set in ctx, it returns autodetect.KindUnknown
func ContextWithClusterDetails ¶
func ContextWithClusterDetails(parent context.Context, clusterDetails *autodetect.ClusterDetails) context.Context
ContextWithClusterDetails returns a copy of parent with ClusterDetails set as the current details.
func ContextWithKubeClient ¶
ContextWithKubeClient returns a copy of parent with kubeClient set as the current client.
func K8SVersionFromContext ¶
K8SVersionFromContext returns the current k8s version from ctx. If no version is currently set in ctx, it returns nil
func KubeClientFromContext ¶
KubeClientFromContext returns the current kube client from ctx.
Types ¶
This section is empty.