-
Notifications
You must be signed in to change notification settings - Fork 99
/
kapp_restrict.go
90 lines (73 loc) · 1.73 KB
/
kapp_restrict.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
// Copyright 2020 VMware, Inc.
// SPDX-License-Identifier: Apache-2.0
package deploy
import (
"github.com/vmware-tanzu/carvel-kapp-controller/pkg/exec"
)
var (
kappAllowedSharedOpts = []string{
// Globals
"--column",
"--debug",
"--json",
"--tty",
"--dangerous-ignore-failing-api-services",
"--dangerous-scope-to-fallback-allowed-namespaces",
// Filtering
"--filter",
"--filter-age",
"--filter-kind",
"--filter-kind-name",
"--filter-kind-ns",
"--filter-kind-ns-name",
"--filter-name",
"--filter-ns",
"--kube-api-qps",
"--kube-api-burst",
}
kappAllowedChangeOpts = []string{
// Diffing
"--diff-changes",
"--diff-against-last-applied",
"--diff-context",
"--diff-line-numbers",
"--diff-mask",
"--diff-run",
"--diff-summary",
// Applying
"--apply-check-interval",
"--apply-concurrency",
"--apply-default-update-strategy",
"--apply-ignored",
"--apply-timeout",
"--exit-early-on-apply-error",
// Waiting
"--wait",
"--wait-check-interval",
"--wait-concurrency",
"--wait-ignored",
"--wait-timeout",
"--exit-early-on-wait-error",
}
)
var (
kappAllowedDeployFlagSet = exec.NewFlagSet(kappAllowedSharedOpts, kappAllowedChangeOpts, []string{
"--dangerous-allow-empty-list-of-resources",
"--existing-non-labeled-resources-check",
"--existing-non-labeled-resources-check-concurrency",
"--dangerous-override-ownership-of-existing-resources",
"--into-ns",
"--map-ns",
"--logs",
"--logs-all",
"--app-changes-max-to-keep",
"--labels",
"--patch",
})
kappAllowedInspectFlagSet = exec.NewFlagSet(kappAllowedSharedOpts, []string{
"--raw",
"--status",
"--tree",
})
kappAllowedDeleteFlagSet = exec.NewFlagSet(kappAllowedSharedOpts, kappAllowedChangeOpts)
)