Skip to content

Commit 9418759

Browse files
committed
Add mapkubeapis plugin to handle deprecated or deleted APIs
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
1 parent 1b9be27 commit 9418759

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

entry

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,14 @@ helm_update() {
5252

5353
# Upgrade only if the chart is already deployed
5454
if [[ "${STATUS}" == "deployed" ]]; then
55-
echo Already installed ${NAME}, upgrading
55+
echo "Already installed ${NAME}"
56+
if [[ "${HELM}" == "helm_v3" ]]; then
57+
${HELM} mapkubeapis ${NAME} --namespace ${TARGET_NAMESPACE}
58+
else
59+
${HELM} mapkubeapis ${NAME} --v2
60+
fi
61+
62+
echo "Upgrading ${NAME}"
5663
shift 1
5764
${HELM} upgrade "$@" ${NAME} ${CHART} ${TIMEOUT_ARG} ${VALUES}
5865
exit

package/Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ COPY --from=extract /usr/bin/helm_v3 /usr/bin/helm
1313
RUN mkdir -p /go/src/github.com/k3s-io/helm-set-status && \
1414
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 && \
1515
make -C /go/src/github.com/k3s-io/helm-set-status install
16+
RUN mkdir -p /go/src/github.com/helm/helm-mapkubeapis && \
17+
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 && \
18+
make -C /go/src/github.com/helm/helm-mapkubeapis && \
19+
mkdir -p /root/.local/share/helm/plugins/helm-mapkubeapis && \
20+
cp -vr /go/src/github.com/helm/helm-mapkubeapis/plugin.yaml \
21+
/go/src/github.com/helm/helm-mapkubeapis/bin \
22+
/go/src/github.com/helm/helm-mapkubeapis/config \
23+
/root/.local/share/helm/plugins/helm-mapkubeapis/
1624

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

0 commit comments

Comments
 (0)