Skip to content

Commit a480782

Browse files
committed
*: Replace '$(pwd)' with '${PWD}'
PWD is in POSIX [1], so there's no need to execute a pwd process to get this value. This fixes everthing found by: $ git grep '\(pwd\)' except for hack/*.sh, which is being addressed by [2]. I'm using $PWD instead of ${PWD} in the module files to avoid them being interpolated [3] on template rendering [4]. [1]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_03 [2]: openshift#174 [3]: https://www.terraform.io/docs/configuration/interpolation.html [4]: https://www.terraform.io/docs/providers/template/d/file.html
1 parent ae7fe33 commit a480782

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

Documentation/dev/libvirt-howto.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ bazel build tarball
103103
```sh
104104
tar -zxf bazel-bin/tectonic-dev.tar.gz
105105
cd tectonic-dev
106-
export PATH=$(pwd)/installer:$PATH
106+
export PATH="${PWD}/installer:${PATH}"
107107
```
108108

109109
Initialize (the environment variables are a convenience):
@@ -139,7 +139,7 @@ You'll have to wait for etcd to reach quorum before this makes any progress.
139139
## Inspect the cluster with kubectl
140140
You'll need a kubectl binary on your path.
141141
```sh
142-
export KUBECONFIG=$(pwd)/$CLUSTER_NAME/generated/auth/kubeconfig
142+
export KUBECONFIG="${PWD}/${CLUSTER_NAME}/generated/auth/kubeconfig"
143143
kubectl get -n tectonic-system pods
144144
```
145145

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ These instructions can be used for AWS:
3131

3232
4. Add binaries to $PATH
3333
```sh
34-
export PATH=$(pwd)/installer:$PATH
34+
export PATH="${PWD}/installer:${PATH}"
3535
```
3636

3737
5. Edit Tectonic configuration file including the $CLUSTER_NAME

modules/bootkube/resources/bootkube.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ echo "Rendering Kubernetes core manifests..."
55

66
# shellcheck disable=SC2154
77
/usr/bin/docker run \
8-
--volume "$(pwd)":/assets:z \
8+
--volume "$PWD:/assets:z" \
99
--volume /etc/kubernetes:/etc/kubernetes:z \
1010
"${kube_core_renderer_image}" \
1111
--config=/assets/kco-config.yaml \
@@ -16,15 +16,15 @@ echo "Rendering TNC manifests..."
1616
# shellcheck disable=SC2154
1717
/usr/bin/docker run \
1818
--user 0 \
19-
--volume "$(pwd)":/assets:z \
19+
--volume "$PWD:/assets:z" \
2020
"${tnc_operator_image}" \
2121
--config=/assets/tnco-config.yaml \
2222
--render-bootstrap=true \
2323
--render-output=/assets/tnc-bootstrap
2424

2525
mkdir -p /etc/kubernetes/manifests/
26-
cp "$(pwd)/tnc-bootstrap/tectonic-node-controller-pod.yaml" /etc/kubernetes/manifests/
27-
cp "$(pwd)/tnc-bootstrap/tectonic-node-controller-config.yaml" /etc/kubernetes/tnc-config
26+
cp "$PWD/tnc-bootstrap/tectonic-node-controller-pod.yaml" /etc/kubernetes/manifests/
27+
cp "$PWD/tnc-bootstrap/tectonic-node-controller-config.yaml" /etc/kubernetes/tnc-config
2828

2929
# We originally wanted to run the etcd cert signer as
3030
# a static pod, but kubelet could't remove static pod
@@ -90,13 +90,13 @@ echo "etcd cluster up. Killing etcd certificate signer..."
9090
/usr/bin/docker kill $${signer_id}
9191
rm /etc/kubernetes/manifests/tectonic-node-controller-pod.yaml
9292

93-
cp -r "$(pwd)/bootstrap-configs" /etc/kubernetes/bootstrap-configs
93+
cp -r "$PWD/bootstrap-configs" /etc/kubernetes/bootstrap-configs
9494

9595
echo "Starting bootkube..."
9696

9797
# shellcheck disable=SC2154
9898
/usr/bin/docker run \
99-
--volume "$(pwd)":/assets:z \
99+
--volume "$PWD:/assets:z" \
100100
--volume /etc/kubernetes:/etc/kubernetes:z \
101101
--network=host \
102102
--entrypoint=/bootkube \

modules/tectonic/resources/tectonic-wrapper.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -e
33

44
# shellcheck disable=SC2086,SC2154
55
/usr/bin/docker run \
6-
--volume "$(pwd)":/assets \
6+
--volume "$PWD:/assets" \
77
--network=host \
88
--entrypoint=/bin/sh \
99
${hyperkube_image} \

tests/run.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ bazel build tarball smoke_tests
3636
echo -e "\\e[36m Unpacking artifacts...\\e[0m"
3737
tar -zxf bazel-bin/tectonic-dev.tar.gz
3838
cp bazel-bin/tests/smoke/linux_amd64_stripped/go_default_test tectonic-dev/smoke
39-
export PATH="$(pwd)/tectonic-dev/installer:${PATH}"
39+
export PATH="${PWD}/tectonic-dev/installer:${PATH}"
4040
cd tectonic-dev
4141

4242
echo -e "\\e[36m Creating Tectonic configuration...\\e[0m"
@@ -87,8 +87,8 @@ export TF_VAR_tectonic_admin_ssh_key="$(cat ~/.ssh/id_rsa.pub)"
8787
echo -e "\\e[36m Deploying Tectonic...\\e[0m"
8888
tectonic install --dir="${CLUSTER_NAME}"
8989
echo -e "\\e[36m Running smoke test...\\e[0m"
90-
export SMOKE_KUBECONFIG="$(pwd)/$CLUSTER_NAME/generated/auth/kubeconfig"
90+
export SMOKE_KUBECONFIG="${PWD}/${CLUSTER_NAME}/generated/auth/kubeconfig"
9191
export SMOKE_NODE_COUNT="5" # Sum of all nodes (master + worker)
92-
export SMOKE_MANIFEST_PATHS="$(pwd)/$CLUSTER_NAME/generated"
92+
export SMOKE_MANIFEST_PATHS="${PWD}/${CLUSTER_NAME}/generated"
9393
exec 5>&1
9494
SMOKE_TEST_OUTPUT=$(./smoke -test.v --cluster | tee >(cat - >&5))

0 commit comments

Comments
 (0)