Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use checksum from Hook release: #66

Merged
merged 2 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tinkerbell/stack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.3.1
version: 0.4.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.3.1"
appVersion: "0.4.0"

dependencies:
- name: tink
Expand Down
24 changes: 13 additions & 11 deletions tinkerbell/stack/templates/nginx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,22 @@ spec:
initContainers:
- name: init-hook-download
image: {{ .Values.stack.hook.image }}
command: ["/bin/sh", "-xeuc"]
command: ["bash", "-xeuc"]
args:
- |
cd /usr/share/nginx/html
{{- range $index, $keys := .Values.stack.hook.downloads }}
p=/tmp/hook{{ $index }}.tar.gz
rm -f $p
wget -O $p {{ $keys.url }}
sha512sum -c <<EOF
{{ $keys.sha512sum }} $p
EOF
tar -zxvf $p
rm -f $p
{{- end }}
rm -f *.tar.gz checksum.txt vmlinuz* initramfs*
base_loc="https://github.com/tinkerbell/hook/releases/download/latest"
files="$base_loc/hook_aarch64.tar.gz $base_loc/hook_x86_64.tar.gz $base_loc/checksum.txt"
tmp_dir=$(mktemp -d)
for f in ${files}; do
echo "${f}"
wget -P "${tmp_dir}" "${f}"
done
(cd "${tmp_dir}" && sha512sum -c checksum.txt)
mv "${tmp_dir}"/checksum.txt .
for f in ${tmp_dir}/*.tar.gz; do tar --no-same-permissions --overwrite -ozxvf "${f}" && rm -f "${f}"; done
rm -rf "${tmp_dir}"
volumeMounts:
- mountPath: /usr/share/nginx/html
name: hook-artifacts
Expand Down
10 changes: 4 additions & 6 deletions tinkerbell/stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@ stack:
enabled: true
name: hook-files
port: 8080
image: alpine
image: bash
downloadsDest: /opt/hook
downloads:
- url: https://github.com/tinkerbell/hook/releases/download/v0.8.1/hook_x86_64.tar.gz
sha512sum: 29d8cf6991272eea20499d757252b07deba824eb778368192f9ab88b215a0dafa584e83422dac08feeb43ddce65f485557ad66210f005a81ab95fb53b7d8d424
- url: https://github.com/tinkerbell/hook/releases/download/v0.8.1/hook_aarch64.tar.gz
sha512sum: f740af6941b2b7d4edcded3f0ae19985ef160fb5cb82995c7e6ce528ad8171a6e0b49920bdc2c58242efed84e9000bcfb53bf1c004cf13190092a1501eaa9dd6
# downloadURL only works with the > 0.8.1 Hook release.
# This is because previous Hook versions didn't provide a checksum file.
downloadURL: https://github.com/tinkerbell/hook/releases/download/latest
kubevip:
enabled: true
name: kube-vip
Expand Down