Documentation ¶
Index ¶
- func BuildConfigFromFlags(masterUrl, kubeconfigPath, saTokenPath string) (*rest.Config, error)
- func PodReady(podScheduledIndicator chan string, since time.Time) func(event watch.Event) (bool, error)
- func RegisterKubeconfigFlag(flags *pflag.FlagSet)
- func WaitForPod(ctx context.Context, clientset *kubernetes.Clientset, namespace string, ...) error
- type ConfigWithMeta
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildConfigFromFlags ¶
BuildConfigFromFlags modified after copied from here https://github.com/kubernetes/client-go/blob/cf830e3cb3abbcc32cc1b6bea4feb1a9a1881af3/tools/clientcmd/client_config.go#L616
func PodReady ¶ added in v1.2.0
func PodReady(podScheduledIndicator chan string, since time.Time) func(event watch.Event) (bool, error)
PodReady returns true if the Pod is ready.
func RegisterKubeconfigFlag ¶ added in v1.2.0
RegisterKubeconfigFlag registers `--kubeconfig` flag.
func WaitForPod ¶ added in v1.2.0
func WaitForPod(ctx context.Context, clientset *kubernetes.Clientset, namespace string, name string, exitCondition watchtools.ConditionFunc) error
WaitForPod watches a given Pod until the exitCondition is true.
Types ¶
type ConfigWithMeta ¶ added in v1.2.0
func LoadRestConfigWithMetaInformation ¶ added in v1.2.0
func LoadRestConfigWithMetaInformation() (*ConfigWithMeta, error)
LoadRestConfigWithMetaInformation loads a REST Config. Config precedence:
* --kubeconfig flag pointing at a file
* KUBECONFIG environment variable pointing at a file
* In-cluster config if running in cluster
* $HOME/.kube/config if exists.
code inspired by sigs.k8s.io/controller-runtime@v0.13.1/pkg/client/config/config.go