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

Fix command flag '--' for dfdaemon #185

Merged
merged 1 commit into from
Aug 3, 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
6 changes: 3 additions & 3 deletions charts/dragonfly/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: dragonfly
description: Dragonfly is an intelligent P2P based image and file distribution system
icon: https://raw.githubusercontent.com/dragonflyoss/Dragonfly2/main/docs/images/logo/dragonfly.svg
type: application
version: 1.0.8
appVersion: 1.0.8
version: 1.0.9
appVersion: 1.0.9
keywords:
- dragonfly
- d7y
Expand All @@ -26,7 +26,7 @@ sources:

annotations:
artifacthub.io/changes: |
- Add dots to documentation comments.
- Fix command flag '--' for dfdaemon.

artifacthub.io/links: |
- name: Chart Source
Expand Down
22 changes: 11 additions & 11 deletions charts/dragonfly/templates/dfdaemon/dfdaemon-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -294,23 +294,23 @@ spec:
{{- if .Values.containerRuntime.docker.restart }}
# inject docker proxy setting and restart docker
# currently, without host pid in container, we can not nsenter with pid and can not invoke systemctl correctly.
status=$(nsenter -t 1 -m systemctl -- status docker --no-pager | grep http-proxy.conf)
status=$(nsenter -t 1 -m -- systemctl status docker --no-pager | grep http-proxy.conf)
if [[ -n "$status" ]]; then
echo Docker proxy already enabled, skip
else
echo Try to inject proxy and restart docker
path=$(nsenter -t 1 -m systemctl -- show -p FragmentPath docker.service | grep -o "/.*systemd.*")
path=$(nsenter -t 1 -m -- systemctl show -p FragmentPath docker.service | grep -o "/.*systemd.*")
if [[ -z "$path" ]]; then
echo docker.service not found
exit 1
fi
nsenter -t 1 -m mkdir -- -p "$path".d
nsenter -t 1 -m sh -- -c "echo '[Service]' > $path.d/http-proxy.conf"
nsenter -t 1 -m sh -- -c "echo 'Environment=\"HTTP_PROXY=http://127.0.0.1:{{ .Values.dfdaemon.hostPort}}\"' >> $path.d/http-proxy.conf"
nsenter -t 1 -m sh -- -c "echo 'Environment=\"HTTPS_PROXY=http://127.0.0.1:{{ .Values.dfdaemon.hostPort}}\"' >> $path.d/http-proxy.conf"
nsenter -t 1 -m sh -- -c "echo 'Environment=\"NO_PROXY={{ join "," .Values.containerRuntime.docker.skipHosts }}\"' >> $path.d/http-proxy.conf"
nsenter -t 1 -m systemctl -- daemon-reload
nsenter -t 1 -m systemctl -- restart docker.service
nsenter -t 1 -m -- mkdir -p "$path".d
nsenter -t 1 -m -- sh -c "echo '[Service]' > $path.d/http-proxy.conf"
nsenter -t 1 -m -- sh -c "echo 'Environment=\"HTTP_PROXY=http://127.0.0.1:{{ .Values.dfdaemon.hostPort}}\"' >> $path.d/http-proxy.conf"
nsenter -t 1 -m -- sh -c "echo 'Environment=\"HTTPS_PROXY=http://127.0.0.1:{{ .Values.dfdaemon.hostPort}}\"' >> $path.d/http-proxy.conf"
nsenter -t 1 -m -- sh -c "echo 'Environment=\"NO_PROXY={{ join "," .Values.containerRuntime.docker.skipHosts }}\"' >> $path.d/http-proxy.conf"
nsenter -t 1 -m -- systemctl daemon-reload
nsenter -t 1 -m -- systemctl restart docker.service
fi
{{- end }}
volumeMounts:
Expand Down Expand Up @@ -463,7 +463,7 @@ spec:
# restart containerd
# currently, without host pid in container, we can not nsenter with pid and can not invoke systemctl correctly.
if [[ "$need_restart" -gt 0 ]]; then
nsenter -t 1 -m systemctl -- restart containerd.service
nsenter -t 1 -m -- systemctl restart containerd.service
fi
volumeMounts:
- name: containerd-conf
Expand Down Expand Up @@ -526,7 +526,7 @@ spec:
echo "Registry $domain added"
fi
done
nsenter -t 1 -m systemctl -- reload crio.service
nsenter -t 1 -m -- systemctl reload crio.service
volumeMounts:
- name: etc
mountPath: /host/etc
Expand Down
Loading