Skip to content

Commit

Permalink
Merge pull request #26 from jordojordo/main
Browse files Browse the repository at this point in the history
Bump Kubewarden 1.2.0 and 1.2.1 - Add case for multi line icon property
  • Loading branch information
jordojordo authored Sep 25, 2023
2 parents 265e00b + 6fa9c24 commit ab3ba94
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/sync-extensions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 3 additions & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
}
Expand Down
17 changes: 13 additions & 4 deletions scripts/bundle-catalog
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ab3ba94

Please sign in to comment.