conf

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2024 License: Apache-2.0 Imports: 7 Imported by: 7

Documentation

Overview

Package conf is used to create an instance of *rest.Config

Index

Constants

This section is empty.

Variables

View Source
var DefaultClusterContext = ""

DefaultClusterContext default cluster context

Functions

func New

func New(fileName string) (*rest.Config, error)

New returns Kubernetes configuration value of type *rest.Config. filename is kubeconfig file

func NewInCluster

func NewInCluster() (*rest.Config, error)

NewInCluster for clients that expect to be running inside a pod on kubernetes

func NewWithContextName

func NewWithContextName(fileName, context string) (*rest.Config, error)

NewWithContextName returns k8s config value of type *rest.Config

func ResolveClusterContext

func ResolveClusterContext() string

ResolveClusterContext returns cluster context name based on --context flag.

func ResolveKubeConfigFile

func ResolveKubeConfigFile() string

ResolveKubeConfigFile returns the kubeconfig file from either flag --kubeconfig or env KUBECONFIG. If flag.Parsed() is true then lookup for --kubeconfig flag. If --kubeconfig, or KUBECONFIG, or $HOME/.kube/config not provided then assume in cluster.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL