Skip to content

Commit

Permalink
Make torcx support optional (#850)
Browse files Browse the repository at this point in the history
  • Loading branch information
jknipper authored Jan 24, 2024
1 parent e19a4ba commit 6ad5e5a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
14 changes: 10 additions & 4 deletions pkg/templates/node_1.26.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ systemd:
contents: |
[Service]
ExecStart=
ExecStart=/usr/bin/env PATH=${TORCX_BINDIR}:${PATH} ${TORCX_BINDIR}/containerd
ExecStart=/usr/bin/containerd
- name: docker.service
enable: true
dropins:
Expand Down Expand Up @@ -324,10 +324,16 @@ storage:
inline: |
#!/usr/bin/env bash
set -eux
mkdir -p /etc/containerd
# copy original file just in case config injection fails
mkdir -p /etc/containerd/
cp /run/torcx/unpack/docker/usr/share/containerd/config.toml /etc/containerd/config.toml
cp /run/torcx/unpack/docker/usr/share/containerd/config.toml output.toml
if [ -f "/run/torcx/unpack/docker/usr/share/containerd/config.toml" ]; then
cp /run/torcx/unpack/docker/usr/share/containerd/config.toml /etc/containerd/config.toml
fi
# without torcx
if [ -f "/usr/share/containerd/config.toml" ]; then
cp -f /usr/share/containerd/config.toml /etc/containerd/config.toml
fi
cp -f /etc/containerd/config.toml output.toml
#download xtoml
curl https://repo.{{ .OpenstackRegion }}.cloud.sap/controlplane/xtoml/xtoml -o xtoml
chmod +x xtoml
Expand Down
14 changes: 10 additions & 4 deletions pkg/templates/node_1.27.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ systemd:
contents: |
[Service]
ExecStart=
ExecStart=/usr/bin/env PATH=${TORCX_BINDIR}:${PATH} ${TORCX_BINDIR}/containerd
ExecStart=/usr/bin/containerd
- name: docker.service
enable: true
dropins:
Expand Down Expand Up @@ -322,10 +322,16 @@ storage:
inline: |
#!/usr/bin/env bash
set -eux
mkdir -p /etc/containerd
# copy original file just in case config injection fails
mkdir -p /etc/containerd/
cp /run/torcx/unpack/docker/usr/share/containerd/config.toml /etc/containerd/config.toml
cp /run/torcx/unpack/docker/usr/share/containerd/config.toml output.toml
if [ -f "/run/torcx/unpack/docker/usr/share/containerd/config.toml" ]; then
cp /run/torcx/unpack/docker/usr/share/containerd/config.toml /etc/containerd/config.toml
fi
# without torcx
if [ -f "/usr/share/containerd/config.toml" ]; then
cp -f /usr/share/containerd/config.toml /etc/containerd/config.toml
fi
cp -f /etc/containerd/config.toml output.toml
#download xtoml
curl https://repo.{{ .OpenstackRegion }}.cloud.sap/controlplane/xtoml/xtoml -o xtoml
chmod +x xtoml
Expand Down

0 comments on commit 6ad5e5a

Please sign in to comment.