| 124 | } |
| 125 | |
| 126 | func TestToEnvName(t *testing.T) { |
| 127 | testCases := []struct { |
| 128 | name string |
| 129 | in string |
| 130 | want string |
| 131 | }{ |
| 132 | {name: "hyphen and dot", in: "a-b.c", want: "A_B_C"}, |
| 133 | {name: "slash", in: "kube/system", want: "KUBE_SYSTEM"}, |
| 134 | {name: "mixed case", in: "KiteBase", want: "KITEBASE"}, |
| 135 | } |
| 136 | |
| 137 | for _, tc := range testCases { |
| 138 | t.Run(tc.name, func(t *testing.T) { |
| 139 | got := ToEnvName(tc.in) |
| 140 | if got != tc.want { |
| 141 | t.Fatalf("ToEnvName(%q) = %q, want %q", tc.in, got, tc.want) |
| 142 | } |
| 143 | }) |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | func TestGenerateKubectlAgentName(t *testing.T) { |
| 148 | testCases := []struct { |