Skip to content

Commit

Permalink
Add mapkubeapis plugin to handle deprecated or deleted APIs
Browse files Browse the repository at this point in the history
Signed-off-by: Brad Davidson <[email protected]>
  • Loading branch information
brandond committed Sep 14, 2021
1 parent 1b9be27 commit 9418759
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
9 changes: 8 additions & 1 deletion entry
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,14 @@ helm_update() {

# Upgrade only if the chart is already deployed
if [[ "${STATUS}" == "deployed" ]]; then
echo Already installed ${NAME}, upgrading
echo "Already installed ${NAME}"
if [[ "${HELM}" == "helm_v3" ]]; then
${HELM} mapkubeapis ${NAME} --namespace ${TARGET_NAMESPACE}
else
${HELM} mapkubeapis ${NAME} --v2
fi

echo "Upgrading ${NAME}"
shift 1
${HELM} upgrade "$@" ${NAME} ${CHART} ${TIMEOUT_ARG} ${VALUES}
exit
Expand Down
8 changes: 8 additions & 0 deletions package/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ COPY --from=extract /usr/bin/helm_v3 /usr/bin/helm
RUN mkdir -p /go/src/github.com/k3s-io/helm-set-status && \
curl -L https://github.com/k3s-io/helm-set-status/archive/refs/tags/v0.1.2.tar.gz | tar xvzf - --strip-components=1 -C /go/src/github.com/k3s-io/helm-set-status && \
make -C /go/src/github.com/k3s-io/helm-set-status install
RUN mkdir -p /go/src/github.com/helm/helm-mapkubeapis && \
curl -L https://github.com/helm/helm-mapkubeapis/archive/refs/tags/v0.1.0.tar.gz | tar xvzf - --strip-components=1 -C /go/src/github.com/helm/helm-mapkubeapis && \
make -C /go/src/github.com/helm/helm-mapkubeapis && \
mkdir -p /root/.local/share/helm/plugins/helm-mapkubeapis && \
cp -vr /go/src/github.com/helm/helm-mapkubeapis/plugin.yaml \
/go/src/github.com/helm/helm-mapkubeapis/bin \
/go/src/github.com/helm/helm-mapkubeapis/config \
/root/.local/share/helm/plugins/helm-mapkubeapis/

FROM alpine:3.12
RUN apk add -U --no-cache ca-certificates jq bash git && \
Expand Down

0 comments on commit 9418759

Please sign in to comment.