-
Notifications
You must be signed in to change notification settings - Fork 5
/
main.go
46 lines (40 loc) · 1.08 KB
/
main.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
package main
import (
"context"
"log"
"os"
"path/filepath"
"time"
"github.com/forbearing/k8s/ingress"
)
var (
ctx, cancel = context.WithTimeout(context.Background(), time.Minute*10)
namespace = "test"
kubeconfig = filepath.Join(os.Getenv("HOME"), ".kube/config")
filename = "../../testdata/examples/ingress.yaml"
filename2 = "../../testdata/examples/ingress-multi.yaml"
update1File = "../../testdata/examples/ingress-update1.yaml"
update2File = "../../testdata/examples/ingress-update2.yaml"
update3File = "../../testdata/examples/ingress-update3.yaml"
name = "mying"
name2 = "mying-multi"
label = "type=ingress"
)
func main() {
Ingress_Tools()
}
func checkErr(name string, err error) {
if err != nil {
log.Printf("%s failed: %v\n", name, err)
} else {
log.Printf("%s success.\n", name)
}
}
// cleanup will delete or prune created deployments.
func cleanup(handler *ingress.Handler) {
handler.Delete(name)
handler.Delete(name2)
handler.DeleteFromFile(update1File)
handler.DeleteFromFile(update2File)
handler.DeleteFromFile(update3File)
}