k8s: Add scheduler information collection
[integration.git] / test / security / k8s / src / check / check.go
1 package check
2
3 // Informer collects and returns information on cluster.
4 type Informer interface {
5         // GetAPIParams returns API server parameters.
6         GetAPIParams() ([]string, error)
7         // GetSchedulerParams returns scheduler parameters.
8         GetSchedulerParams() ([]string, error)
9 }
10
11 // Command represents commands run on cluster.
12 type Command int
13
14 const (
15         // APIProcess represents API server command ("kube-apiserver").
16         APIProcess Command = iota
17         // SchedulerProcess represents scheduler command ("kube-scheduler").
18         SchedulerProcess
19 )
20
21 func (c Command) String() string {
22         names := [...]string{
23                 "kube-apiserver",
24                 "kube-scheduler",
25         }
26
27         if c < APIProcess || c > SchedulerProcess {
28                 return "exit"
29         }
30         return names[c]
31 }
32
33 // Service represents services run on Rancher-based cluster.
34 type Service int
35
36 const (
37         // APIService represents API server service ("kubernetes/kubernetes").
38         APIService Service = iota
39         // SchedulerService represents scheduler service ("kubernetes/scheduler").
40         SchedulerService
41 )
42
43 func (s Service) String() string {
44         names := [...]string{
45                 "kubernetes/kubernetes",
46                 "kubernetes/scheduler",
47         }
48
49         if s < APIService || s > SchedulerService {
50                 return ""
51         }
52         return names[s]
53 }