Skip to content

Commit ef093a9

Browse files
committed
test(gen): variables backslash
Signed-off-by: 90dy <[email protected]>
1 parent e34d1af commit ef093a9

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

src/gen/fixtures/test-variables.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
NODE_NAME=$(hostname)
3+
EXTERNAL_IP=$(hostname -I | tr ' ' '\n' | head -1)
4+
// # 3. Patch node status (run as cluster-admin)
5+
sudo kubectl --kubeconfig ${kubeconfigPath} patch node ${NODE_NAME} \
6+
--subresource=status \
7+
--type=json \
8+
-p="[{'op':'add','path':'/status/addresses/-','value':{'type':'ExternalIP','address':'${EXTERNAL_IP}'}}]"
9+
# 4. Remove cloud provider taint
10+
sudo kubectl --kubeconfig ${kubeconfigPath} taint node ${NODE_NAME} node.cloudprovider.kubernetes.io/uninitialized-
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { sh } from "@tmpl/core";
2+
3+
export default sh`
4+
#!/bin/bash
5+
6+
NODE_NAME=$(hostname)
7+
EXTERNAL_IP=$(hostname -I | tr ' ' '\n' | head -1)
8+
9+
// # 3. Patch node status (run as cluster-admin)
10+
sudo kubectl --kubeconfig \${kubeconfigPath} patch node \${NODE_NAME} \
11+
--subresource=status \
12+
--type=json \
13+
-p="[{'op':'add','path':'/status/addresses/-','value':{'type':'ExternalIP','address':'\${EXTERNAL_IP}'}}]"
14+
15+
# 4. Remove cloud provider taint
16+
sudo kubectl --kubeconfig \${kubeconfigPath} taint node \${NODE_NAME} node.cloudprovider.kubernetes.io/uninitialized-
17+
`;

0 commit comments

Comments
 (0)