blob: 91e9e5fd2e3ea1f34a5b0447b19932843d0e1074 [file] [log] [blame]
Pawel Wieczorek76dd9bf2019-09-26 16:43:01 +02001package check
2
3// Informer collects and returns information on cluster.
4type Informer interface {
5 // GetAPIParams returns API server parameters.
6 GetAPIParams() ([]string, error)
Pawel Wieczorek96f4e2f2019-09-27 16:10:33 +02007 // GetSchedulerParams returns scheduler parameters.
8 GetSchedulerParams() ([]string, error)
Pawel Wieczorek5a61d612019-09-27 18:26:13 +02009 // GetControllerManagerParams returns controller manager parameters.
10 GetControllerManagerParams() ([]string, error)
Pawel Wieczorekf649f222019-10-07 17:00:49 +020011 // GetEtcdParams returns etcd parameters.
12 GetEtcdParams() ([]string, error)
Pawel Wieczorek76dd9bf2019-09-26 16:43:01 +020013}
14
15// Command represents commands run on cluster.
16type Command int
17
18const (
19 // APIProcess represents API server command ("kube-apiserver").
20 APIProcess Command = iota
Pawel Wieczorek96f4e2f2019-09-27 16:10:33 +020021 // SchedulerProcess represents scheduler command ("kube-scheduler").
22 SchedulerProcess
Pawel Wieczorek5a61d612019-09-27 18:26:13 +020023 // ControllerManagerProcess represents controller manager command ("kube-controller-manager").
24 ControllerManagerProcess
Pawel Wieczorekf649f222019-10-07 17:00:49 +020025 // EtcdProcess represents controller manager service ("etcd").
26 EtcdProcess
Pawel Wieczorek76dd9bf2019-09-26 16:43:01 +020027)
28
29func (c Command) String() string {
30 names := [...]string{
31 "kube-apiserver",
Pawel Wieczorek96f4e2f2019-09-27 16:10:33 +020032 "kube-scheduler",
Pawel Wieczorek5a61d612019-09-27 18:26:13 +020033 "kube-controller-manager",
Pawel Wieczorekf649f222019-10-07 17:00:49 +020034 "etcd",
Pawel Wieczorek76dd9bf2019-09-26 16:43:01 +020035 }
36
Pawel Wieczorekf649f222019-10-07 17:00:49 +020037 if c < APIProcess || c > EtcdProcess {
Pawel Wieczorek76dd9bf2019-09-26 16:43:01 +020038 return "exit"
39 }
40 return names[c]
41}