aboutsummaryrefslogtreecommitdiffstats
path: root/test/security/k8s/src/check/check.go
blob: 91e9e5fd2e3ea1f34a5b0447b19932843d0e1074 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package check

// Informer collects and returns information on cluster.
type Informer interface {
	// GetAPIParams returns API server parameters.
	GetAPIParams() ([]string, error)
	// GetSchedulerParams returns scheduler parameters.
	GetSchedulerParams() ([]string, error)
	// GetControllerManagerParams returns controller manager parameters.
	GetControllerManagerParams() ([]string, error)
	// GetEtcdParams returns etcd parameters.
	GetEtcdParams() ([]string, error)
}

// Command represents commands run on cluster.
type Command int

const (
	// APIProcess represents API server command ("kube-apiserver").
	APIProcess Command = iota
	// SchedulerProcess represents scheduler command ("kube-scheduler").
	SchedulerProcess
	// ControllerManagerProcess represents controller manager command ("kube-controller-manager").
	ControllerManagerProcess
	// EtcdProcess represents controller manager service ("etcd").
	EtcdProcess
)

func (c Command) String() string {
	names := [...]string{
		"kube-apiserver",
		"kube-scheduler",
		"kube-controller-manager",
		"etcd",
	}

	if c < APIProcess || c > EtcdProcess {
		return "exit"
	}
	return names[c]
}