Documentation ¶
Index ¶
- func CopyFileFromPod(restConfig *restclient.Config, clientConfig clientcmd.ClientConfig, ...) error
- func GetContexts(clientConfig *clientcmd.ClientConfig) (map[string]*api.Context, error)
- func GetKubeconfig(client *rancher.Client, clusterID string) (*clientcmd.ClientConfig, error)
- func GetPodLogs(client *rancher.Client, clusterID string, podName string, namespace string, ...) (string, error)
- type LogStreamer
- type RestGetter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyFileFromPod ¶
func CopyFileFromPod(restConfig *restclient.Config, clientConfig clientcmd.ClientConfig, podName, namespace, filename, dest string) error
CopyFileFromPod is function that copies files from a pod. The parameter takes the kubeconfig in form of a restclient.Config object, the pod name, the namespace of the pod, the filename, and then the local destination (dest) where the file will be copied to.
func GetContexts ¶
GetContexts is a helper function that lists the contexts of a kubeconfig
func GetKubeconfig ¶
GetKubeconfig generates a kubeconfig froma specific cluster, and returns it in the form of a *clientcmd.ClientConfig
Types ¶
type LogStreamer ¶
type LogStreamer struct {
// contains filtered or unexported fields
}
LogStreamer is a struct that acts like io.Writer inorder to retrieve Stdout from a kubectl exec command in pod
func KubectlExec ¶
func KubectlExec(restConfig *restclient.Config, podName, namespace string, command []string) (*LogStreamer, error)
KubectlExec is function that runs `kubectl exec` in a specified pod of a cluster. The function takes the kubeconfig in form of a restclient.Config object, the pod name, the namespace of the pod, and the command a user wants to run.
func (*LogStreamer) String ¶
func (l *LogStreamer) String() string
String stringer for the LogStreamer
type RestGetter ¶
type RestGetter struct { genericclioptions.RESTClientGetter // contains filtered or unexported fields }
func NewRestGetter ¶
func NewRestGetter(restConfig *rest.Config, clientConfig clientcmd.ClientConfig) (*RestGetter, error)
func (*RestGetter) ToDiscoveryClient ¶
func (r *RestGetter) ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error)
ToDiscoveryClient returns a cached discovery client.
func (*RestGetter) ToRESTConfig ¶
func (r *RestGetter) ToRESTConfig() (*rest.Config, error)
ToRESTConfig returns restconfig
func (*RestGetter) ToRESTMapper ¶
func (r *RestGetter) ToRESTMapper() (meta.RESTMapper, error)
ToRESTMapper returns a RESTMapper.
func (*RestGetter) ToRawKubeConfigLoader ¶
func (r *RestGetter) ToRawKubeConfigLoader() clientcmd.ClientConfig
ToRawKubeConfigLoader return kubeconfig loader as-is