Skip to content
This repository has been archived by the owner on Jul 4, 2024. It is now read-only.

Commit

Permalink
Remove 2to3 initContainer from installer (#1486)
Browse files Browse the repository at this point in the history
  • Loading branch information
tgorgol authored Jul 3, 2020
1 parent d7517b0 commit 02b2917
Showing 1 changed file with 0 additions and 53 deletions.
53 changes: 0 additions & 53 deletions installation/resources/installer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -198,59 +198,6 @@ spec:
- mountPath: /etc/certs
name: helm-certs
readOnly: true
- name: 2to3
image: eu.gcr.io/kyma-project/test-infra/alpine-kubectl:v20200529-34b39bd3
terminationMessagePolicy: "FallbackToLogsOnError"
command:
- /bin/bash
- -c
- |
set -e
HELM_2_BINARY=$(which helm)
HELM_3_BINARY=$(which helm3)
SECRET_NAME="helm-secret"
NAMESPACE="compass-installer"
CHART_BLACKLIST=( "gateway-0.0.1" "application-0.0.1" )
echo "---> Install requirements"
apk add git jq
echo "---> Get HELM_2 certs"
${HELM_2_BINARY} init -c
if [[ $(kubectl get -n kube-system deploy tiller-deploy -o name) ]]; then
if [[ $(kubectl get -n "${NAMESPACE}" secret "${SECRET_NAME}" -o name) ]]; then
kubectl get -n "${NAMESPACE}" secret "${SECRET_NAME}" -o jsonpath="{.data['global\\.helm\\.ca\\.crt']}" | base64 --decode > "$(helm home)/ca.pem"
kubectl get -n "${NAMESPACE}" secret "${SECRET_NAME}" -o jsonpath="{.data['global\\.helm\\.tls\\.crt']}" | base64 --decode > "$(helm home)/cert.pem"
kubectl get -n "${NAMESPACE}" secret "${SECRET_NAME}" -o jsonpath="{.data['global\\.helm\\.tls\\.key']}" | base64 --decode > "$(helm home)/key.pem"
else
echo "------> No HELM_2 Certs found, failing"
exit 1
fi
else
echo "------> No Tiller deployment found, exiting gracefully"
exit 0
fi
echo "---> Get current releases"
${HELM_2_BINARY} ls --tls --all --output json | jq '.Releases[] | .Name + " " + .Namespace + " " + .Chart' | tr -d '"' > helm2-releases
if [[ ! $(${HELM_3_BINARY} plugin list | grep '2to3') ]]; then
echo "---> Get migration plugin"
${HELM_3_BINARY} plugin install https://github.com/helm/helm-2to3.git
echo "---> Migrate config files"
yes | ${HELM_3_BINARY} 2to3 move config
fi
echo "---> Migrate releases"
while read line; do
release=$(echo $line | cut -d " " -f1)
ns=$(echo $line | cut -d " " -f2)
chart=$(echo $line | cut -d " " -f3)
if [[ " ${CHART_BLACKLIST[@]} " =~ " ${chart} " ]]; then
echo "------> Release ${release} is blacklisted by ${chart}"
continue
fi
if [[ $(${HELM_3_BINARY} get all ${release} -n ${ns} 2> /dev/null) ]]; then
echo "------> Release ${release} in ns ${ns} already migrated!"
else
${HELM_3_BINARY} 2to3 convert ${release}
fi
done < helm2-releases
containers:
- name: compass-installer-container
image: eu.gcr.io/kyma-project/develop/installer:408cb6a6
Expand Down

0 comments on commit 02b2917

Please sign in to comment.