diff --git a/.github/workflows/sync-extensions.yml b/.github/workflows/sync-extensions.yml index b3b30db..c576a56 100644 --- a/.github/workflows/sync-extensions.yml +++ b/.github/workflows/sync-extensions.yml @@ -81,7 +81,7 @@ jobs: git config user.name 'github-actions[bot]' git config user.email 'github-actions[bot]@users.noreply.github.com' - - name: Login to GitHub Container Registry + - name: Login to Container Registry uses: docker/login-action@v2 with: username: ${{ secrets.DOCKER_USERNAME }} diff --git a/manifest.json b/manifest.json index ef9362e..a1eca41 100644 --- a/manifest.json +++ b/manifest.json @@ -20,7 +20,9 @@ "1.0.4", "1.0.5", "1.0.6", - "1.1.0" + "1.1.0", + "1.2.0", + "1.2.1" ] } } diff --git a/scripts/bundle-catalog b/scripts/bundle-catalog index a52fb62..ab82523 100755 --- a/scripts/bundle-catalog +++ b/scripts/bundle-catalog @@ -125,11 +125,19 @@ do ICON_FILE=$(ls -1 "${CONTAINER_TMP}/extensions/${NAME}/${VERSION}/plugin/img" | head -n 1) NEW_ICON=${ENDPOINT}/plugin/img/${ICON_FILE} - sed -i.bak -e 's@icon:.*@icon: '"$NEW_ICON"'@' ${CHART_FILE} + + # Check if '>-' exists in the icon property to remove the second line + if grep -q 'icon: >-' "${CHART_FILE}"; then + SECOND_LINE=$(sed -n '/^icon: >-/{n;p;q}' "${CHART_FILE}") + sed -i.bak '/^icon: >-/{n;d;}' "${CHART_FILE}" + sed -i -e 's@icon:.*@icon: '"${NEW_ICON}"'@' ${CHART_FILE} + else + sed -i.bak -e 's@icon:.*@icon: '"${NEW_ICON}"'@' ${CHART_FILE} + fi PKG_FILE=${CONTAINER_TMP}/extensions/${NAME}/${VERSION}/plugin/package.json - sed -i.bak -e 's@\"icon\": \".*\"@\"icon\": \"'"$NEW_ICON"'\"@' ${PKG_FILE} - rm -rf ${PKG_FILE}.bak + sed -i.bak -e 's@\"icon\": \".*\"@\"icon\": \"'"${NEW_ICON}"'\"@' ${PKG_FILE} + rm -f ${PKG_FILE}.bak ${CHART_FILE}.bak fi echo " + Packaging Helm chart" @@ -208,8 +216,9 @@ if [ ! -z "${IMAGE}" ]; then # Ensure that you do not overwrite production images if [[ "${DEST_NAMESPACE}" == "rancher" ]]; then - if docker manifest inspect 2>&1 1>/dev/null; then + if docker manifest inspect ${IMAGE} 2>&1 1>/dev/null; then echo -e "${RED}${BOLD}Cannot overwrite production image ${DEST_IMAGE_NAME} since it already exists${RESET}" + rm -rf ${TMP} exit 1 fi fi