fix bw installation -.-
All checks were successful
continuous-integration/drone/push Build is passing

Fixes #29
This commit is contained in:
Tobias Trabelsi 2023-06-24 18:31:00 +02:00
parent aa015cc7ba
commit 682f77e9b8
Signed by: lerentis
GPG Key ID: FF0C2839718CAF2E
2 changed files with 5 additions and 3 deletions

View File

@ -4,7 +4,7 @@ LABEL org.opencontainers.image.source=https://github.com/Lerentis/bitwarden-crd-
LABEL org.opencontainers.image.description="Kubernetes Operator to create k8s secrets from bitwarden" LABEL org.opencontainers.image.description="Kubernetes Operator to create k8s secrets from bitwarden"
LABEL org.opencontainers.image.licenses=MIT LABEL org.opencontainers.image.licenses=MIT
ARG PYTHON_VERSION=3.11.3-r11 ARG PYTHON_VERSION=3.11.4-r0
ARG PIP_VERSION=23.1.2-r0 ARG PIP_VERSION=23.1.2-r0
ARG GCOMPAT_VERSION=1.1.0-r1 ARG GCOMPAT_VERSION=1.1.0-r1
ARG LIBCRYPTO_VERSION=3.1.0-r4 ARG LIBCRYPTO_VERSION=3.1.0-r4
@ -24,6 +24,8 @@ RUN set -eux; \
cd /tmp; \ cd /tmp; \
wget https://github.com/bitwarden/clients/releases/download/cli-v${BW_VERSION}/bw-linux-${BW_VERSION}.zip; \ wget https://github.com/bitwarden/clients/releases/download/cli-v${BW_VERSION}/bw-linux-${BW_VERSION}.zip; \
unzip /tmp/bw-linux-${BW_VERSION}.zip; \ unzip /tmp/bw-linux-${BW_VERSION}.zip; \
mv /tmp/bw /usr/local/bin/bw; \
chmod +x /usr/local/bin/bw; \
;; \ ;; \
*) \ *) \
echo "Unsupported arch: ${ARCH}"; \ echo "Unsupported arch: ${ARCH}"; \

View File

@ -32,9 +32,9 @@ def command_wrapper(logger, command, use_success: bool = True):
shell=True, shell=True,
env=system_env) env=system_env)
out, err = sp.communicate() out, err = sp.communicate()
resp = json.loads(out.decode(encoding='UTF-8'))
if "DEBUG" in system_env: if "DEBUG" in system_env:
logger.info(resp) logger.info(out.decode(encoding='UTF-8'))
resp = json.loads(out.decode(encoding='UTF-8'))
if resp["success"] != None and (not use_success or (use_success and resp["success"] == True)): if resp["success"] != None and (not use_success or (use_success and resp["success"] == True)):
return resp return resp
logger.warn(resp) logger.warn(resp)