connect

package
v0.23.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: May 10, 2023 License: MPL-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CriticalStatus = map[string]bool{
	"Error":                      true,
	"Unknown":                    true,
	"ImagePullBackOff":           true,
	"CrashLoopBackOff":           true,
	"RunContainerError":          true,
	"ErrImagePull":               true,
	"CreateContainerConfigError": true,
	"InvalidImageName":           true,
}

CriticalStatus container status

View Source
var SortPodsByNewest = func(pods []corev1.Pod, i, j int) bool {
	return pods[i].CreationTimestamp.Unix() > pods[j].CreationTimestamp.Unix()
}

Functions

func GetKubeConfig

func GetKubeConfig(ctx context.Context, kubeClient *kubernetes.Clientset, vclusterName, namespace string, log log.Logger) (*api.Config, error)

GetKubeConfig attempts to read the kubeconfig from the default Secret and falls back to reading from filesystem if the Secret is not read successfully. Reading from filesystem is implemented for the backward compatibility and can be eventually removed in the future.

This is retried until the kube config is successfully retrieve, or until 10 minute timeout is reached.

func HasPodProblem

func HasPodProblem(pod *corev1.Pod) bool

func SafeConcatName

func SafeConcatName(name ...string) string

Types

type Connection

type Connection struct {
	Address                   string
	BackgroundProxy           bool
	Context                   string
	Insecure                  bool
	KubeConfig                string
	KubeConfigContextName     string
	LocalPort                 int
	Log                       log.Logger
	Namespace                 string
	PodName                   string
	Print                     bool
	Server                    string
	ServiceAccount            string
	ServiceAccountClusterRole string
	ServiceAccountExpiration  int
	UpdateCurrent             bool
	// contains filtered or unexported fields
}

func (*Connection) Connect

func (conn *Connection) Connect(vclusterName string, command []string) error

Jump to

Keyboard shortcuts

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