-
Notifications
You must be signed in to change notification settings - Fork 5
/
vars.go
66 lines (63 loc) · 1.5 KB
/
vars.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package main
import (
"context"
"os"
"path/filepath"
"time"
)
var (
ctx, cancel = context.WithTimeout(context.Background(), time.Minute*10)
namespace = "test"
kubeconfig = filepath.Join(os.Getenv("HOME"), ".kube/config")
filename = "../../testdata/examples/deployment.yaml"
updateFile = "../../testdata/examples/deployment-update1.yaml"
filename2 = "../../testdata/nginx/nginx-deploy.yaml"
name = "mydep"
name2 = "nginx-deploy"
label = "type=deployment"
)
var (
unstructName = "mydep-unstruct"
unstructData = map[string]interface{}{
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": map[string]interface{}{
"name": unstructName,
"labels": map[string]interface{}{
"app": unstructName,
"type": "deployment",
},
},
"spec": map[string]interface{}{
// replicas type is int32, not string.
"replicas": 1,
"selector": map[string]interface{}{
"matchLabels": map[string]interface{}{
"app": unstructName,
"type": "deployment",
},
},
"template": map[string]interface{}{
"metadata": map[string]interface{}{
"labels": map[string]interface{}{
"app": unstructName,
"type": "deployment",
},
},
"spec": map[string]interface{}{
"containers": []map[string]interface{}{
{
"name": "nginx",
"image": "nginx",
"resources": map[string]interface{}{
"limits": map[string]interface{}{
"cpu": "100m",
},
},
},
},
},
},
},
}
)