e558a3e363788bd284aaac84a082afa1c2212e47
- Author
- TheEdgeOfRage <git@theedgeofrage.com>
- Committer
- TheEdgeOfRage <git@theedgeofrage.com>
- Date
Message
Diff
This diff is truncated to protect this page.
1diff --git a/src/core/deterministic.ts b/src/core/deterministic.ts
2index 2d2d9eb628ff77676b31d8014bebdce6d4b30135..c8615ed1c43ab76b6f803e5c595f28a214b091bd 100644
3--- a/src/core/deterministic.ts
4+++ b/src/core/deterministic.ts
5@@ -65,6 +65,121 @@ const FIND_UNARY = new Set([
6 "-writable",
7 "-executable",
8 ]);
9+const KUBECTL_MUTATIONS = new Set([
10+ "apply",
11+ "autoscale",
12+ "cordon",
13+ "create",
14+ "delete",
15+ "drain",
16+ "edit",
17+ "expose",
18+ "label",
19+ "patch",
20+ "replace",
21+ "scale",
22+ "taint",
23+ "uncordon",
24+]);
25+const KUBECTL_SUBCOMMAND_MUTATIONS = new Map<string, ReadonlySet<string>>([
26+ ["auth", new Set(["reconcile"])],
27+ ["certificate", new Set(["approve", "deny"])],
28+ ["rollout", new Set(["pause", "restart", "resume", "undo"])],
29+ ["set", new Set(["env", "image", "resources", "selector", "serviceaccount", "subject"])],
30+]);
31+const KUBECTL_VALUE_OPTIONS = new Set([
32+ "--as",
33+ "--as-group",
34+ "--as-uid",
35+ "--cache-dir",
36+ "--certificate-authority",
37+ "--client-certificate",
38+ "--client-key",
39+ "--cluster",
40+ "--context",
41+ "--kubeconfig",
42+ "--kuberc",
43+ "--namespace",
44+ "--password",
45+ "--profile",
46+ "--request-timeout",
47+ "--server",
48+ "--tls-server-name",
49+ "--token",
50+ "--user",
51+ "--username",
52+ "--v",
53+ "--vmodule",
54+ "-n",
55+ "-s",
56+ "-v",
57+]);
58+const AWS_MUTATION_PREFIXES = [
59+ "abort-",
60+ "accept-",
61+ "activate-",
62+ "add-",
63+ "allocate-",
64+ "approve-",
65+ "associate-",
66+ "attach-",
67+ "authorize-",
68+ "batch-write-",
69+ "cancel-",
70+ "commit-",
71+ "complete-",
72+ "copy-",
73+ "create-",
74+ "deactivate-",
75+ "delete-",
76+ "deregister-",
77+ "detach-",
78+ "disable-",
79+ "disassociate-",
80+ "enable-",
81+ "execute-",
82+ "import-",
83+ "invoke-",
84+ "merge-",
85+ "modify-",
86+ "move-",
87+ "patch-",
88+ "promote-",
89+ "publish-",
90+ "put-",
91+ "register-",
92+ "reject-",
93+ "release-",
94+ "remove-",
95+ "replace-",
96+ "reset-",
97+ "restore-",
98+ "reboot-",
99+ "revoke-",
100+ "rotate-",
101+ "run-",
102+ "send-",
103+ "set-",
104+ "start-",
105diff --git a/test/core/deterministic.test.ts b/test/core/deterministic.test.ts
106index 0487ad96653a989b171d0563573d9832c1e87757..031ba91c4ffce51db02780de2743a7ecfd714804 100644
107--- a/test/core/deterministic.test.ts
108+++ b/test/core/deterministic.test.ts
109@@ -81,6 +81,14 @@ const asks = [
110 "find ~ -name '*.ts'",
111 "docker volume rm app-data",
112 "docker compose down -v",
113+ "kubectl --namespace default apply -f deploy.yaml",
114+ "kubectl rollout restart deployment/api",
115+ "kubectl set image deployment/api api=example/api:next",
116+ "kubectl certificate approve request",
117+ "kubectl auth reconcile -f role.yaml",
118+ "aws --profile production iam attach-user-policy --user-name deploy --policy-arn arn",
119+ "aws s3api put-object --bucket production --key file --body file",
120+ "aws configure set region us-east-1",
121 "wc -l mixed/*.swift",
122 "cd injected && grep -r needle --include=*.go .",
123 "cat safe/*.swift",