k8s

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KubeapiSubsystemName          = "kubernetes-api"
	KubeapiClientCheckDescription = "can initialize the client"
	KubeapiAccessCheckDescription = "can query the Kubernetes API"
)
View Source
const (
	KubernetesDeployments = "deployments"
	KubernetesPods        = "pods"

	KubectlSubsystemName                = "kubectl"
	KubectlIsInstalledCheckDescription  = "is in $PATH"
	KubectlVersionCheckDescription      = "has compatible version"
	KubectlConnectivityCheckDescription = "can talk to Kubernetes cluster"
)

Variables

This section is empty.

Functions

func CanonicalKubernetesNameFromFriendlyName

func CanonicalKubernetesNameFromFriendlyName(friendlyName string) (string, error)

CanonicalKubernetesNameFromFriendlyName returns a canonical name from common shorthands used in command line tools. This works based on https://github.com/kubernetes/kubernetes/blob/63ffb1995b292be0a1e9ebde6216b83fc79dd988/pkg/kubectl/kubectl.go#L39

Types

type Kubectl

type Kubectl interface {
	Version() ([3]int, error)
	StartProxy(potentialErrorWhenStartingProxy chan error, port int) error
	UrlFor(namespace string, extraPathStartingWithSlash string) (*url.URL, error)
	ProxyPort() int
	healthcheck.StatusChecker
}

func NewKubectl

func NewKubectl(shell shell.Shell) (Kubectl, error)

type KubernetesApi

type KubernetesApi interface {
	UrlFor(namespace string, extraPathStartingWithSlash string) (*url.URL, error)
	NewClient() (*http.Client, error)
	healthcheck.StatusChecker
}

func NewK8sAPI

func NewK8sAPI(shell shell.Shell, k8sConfigFilesystemPathOverride string) (KubernetesApi, error)

type MockKubeApi

type MockKubeApi struct {
	SelfCheckResultsToReturn              []*healthcheckPb.CheckResult
	UrlForNamespaceReceived               string
	UrlExtraPathStartingWithSlashReceived string
	UrlForUrlToReturn                     *url.URL
	NewClientClientToReturn               *http.Client
	ErrorToReturn                         error
}

func (*MockKubeApi) NewClient

func (m *MockKubeApi) NewClient() (*http.Client, error)

func (*MockKubeApi) SelfCheck

func (m *MockKubeApi) SelfCheck() []*healthcheckPb.CheckResult

func (*MockKubeApi) UrlFor

func (m *MockKubeApi) UrlFor(namespace string, extraPathStartingWithSlash string) (*url.URL, error)

type MockKubectl

type MockKubectl struct {
	SelfCheckResultsToReturn []*healthcheckPb.CheckResult
}

func (*MockKubectl) ProxyPort

func (m *MockKubectl) ProxyPort() int

func (*MockKubectl) SelfCheck

func (m *MockKubectl) SelfCheck() []*healthcheckPb.CheckResult

func (*MockKubectl) StartProxy

func (m *MockKubectl) StartProxy(potentialErrorWhenStartingProxy chan error, port int) error

func (*MockKubectl) UrlFor

func (m *MockKubectl) UrlFor(namespace string, extraPathStartingWithSlash string) (*url.URL, error)

func (*MockKubectl) Version

func (m *MockKubectl) Version() ([3]int, error)

Jump to

Keyboard shortcuts

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