Compare commits

...

3 Commits

Author SHA1 Message Date
Quentin McGaw (desktop)
f569998c93 Fix: install latest apk-tools before using apk 2021-08-09 14:44:06 +00:00
Quentin McGaw (desktop)
9877366c51 Fix: install latest apk-tools by default 2021-08-09 14:43:46 +00:00
Quentin McGaw (desktop)
61066e3896 Fix restart mutex unlocking for loops 2021-08-09 14:38:15 +00:00
2 changed files with 5 additions and 2 deletions

View File

@@ -156,8 +156,8 @@ ENTRYPOINT ["/entrypoint"]
EXPOSE 8000/tcp 8888/tcp 8388/tcp 8388/udp
HEALTHCHECK --interval=5s --timeout=5s --start-period=10s --retries=1 CMD /entrypoint healthcheck
ARG TARGETPLATFORM
RUN apk add --no-cache --update -X "https://dl-cdn.alpinelinux.org/alpine/v3.12/main" openvpn==2.4.11-r0 && \
if [ "${TARGETPLATFORM}" != "linux/ppc64le" ]; then apk add --no-cache --update apk-tools==2.12.6-r0; fi && \
RUN apk add --no-cache --update -l apk-tools && \
apk add --no-cache --update -X "https://dl-cdn.alpinelinux.org/alpine/v3.12/main" openvpn==2.4.11-r0 && \
mv /usr/sbin/openvpn /usr/sbin/openvpn2.4 && \
apk del openvpn && \
apk add --no-cache --update openvpn ca-certificates iptables ip6tables unbound tzdata && \

View File

@@ -37,6 +37,7 @@ func (s *State) ApplyStatus(ctx context.Context, status models.LoopStatus) (
switch existingStatus {
case constants.Stopped, constants.Completed:
default:
s.statusMu.Unlock()
return "already " + existingStatus.String(), nil
}
@@ -55,6 +56,7 @@ func (s *State) ApplyStatus(ctx context.Context, status models.LoopStatus) (
return newStatus.String(), nil
case constants.Stopped:
if existingStatus != constants.Running {
s.statusMu.Unlock()
return "already " + existingStatus.String(), nil
}
@@ -73,6 +75,7 @@ func (s *State) ApplyStatus(ctx context.Context, status models.LoopStatus) (
return newStatus.String(), nil
default:
s.statusMu.Unlock()
return "", fmt.Errorf("%w: %s: it can only be one of: %s, %s",
ErrInvalidStatus, status, constants.Running, constants.Stopped)
}