-
Notifications
You must be signed in to change notification settings - Fork 1
/
types.go
51 lines (42 loc) · 884 Bytes
/
types.go
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
42
43
44
45
46
47
48
49
50
51
package kubetest
import (
"k8s.io/client-go/kubernetes"
)
type kubeTest struct {
APIVersion string `yaml:"apiVersion"`
Kind string
Metadata metadata
Spec kubeTestSpec
testFilePath string
}
type kubeTestSpec struct {
Lifecycle lifecycle `yaml:"lifecycle"`
Tests []test
}
type test struct {
Resource resource `yaml:"resource"`
Type string
Spec map[string]interface{}
}
type metadata struct {
Name string
Namespace string
Labels map[string]string
}
type kubeTester interface {
test(res *resource) (bool, error)
}
type jsonTest struct {
JSONPath string
Value string
client *kubernetes.Clientset
}
type validationTest struct {
ContainsResponse string `yaml:"containsResponse"`
client *kubernetes.Clientset
}
type mutationTest struct {
JSONPath string
Value string
client *kubernetes.Clientset
}