diff --git a/scripts/sync-to-eks-charts.sh b/scripts/sync-to-eks-charts.sh index 0001eef4e8..be09dd5486 100755 --- a/scripts/sync-to-eks-charts.sh +++ b/scripts/sync-to-eks-charts.sh @@ -6,13 +6,12 @@ SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" BUILD_DIR="${SCRIPTPATH}/../build" REPO="aws/amazon-vpc-cni-k8s" -HELM_CHART_NAME="aws-vpc-cni" +HELM_CHART_NAME=${HELM_CHART_NAME:-'aws-vpc-cni'} HELM_CHART_BASE_BIR="${SCRIPTPATH}/../charts" CHARTS_REPO="aws/eks-charts" CHARTS_REPO_NAME=$(echo ${CHARTS_REPO} | cut -d'/' -f2) -HELM_CHART_DIR="${HELM_CHART_BASE_BIR}/${HELM_CHART_NAME}" PR_ID=$(uuidgen | cut -d '-' -f1) SYNC_DIR="${BUILD_DIR}/eks-charts-sync" @@ -29,7 +28,7 @@ if [[ "${KERNEL}" == "darwin" ]]; then OS="macOS" fi -VERSION=$(make -s -f "${SCRIPTPATH}/../Makefile" version) +VERSION=$(echo $(make -s -f "${SCRIPTPATH}/../Makefile" version) | cut -d'-' -f1) USAGE=$(cat << EOM Usage: sync-to-eks-charts -r @@ -52,6 +51,7 @@ while getopts "b:r:n" opt; do REPO="$OPTARG" ;; b ) # binary basename + HELM_CHART_NAME="$OPTARG" BINARY_BASE="$OPTARG" ;; n ) # Include release notes @@ -64,6 +64,14 @@ while getopts "b:r:n" opt; do esac done +if [[ "$HELM_CHART_NAME" =~ ^(aws-vpc-cni|cni-metrics-helper)$ ]]; then + echo "chose to sync chart $HELM_CHART_NAME" +else + echo "invalid chart name, quit the script" + exit 0 +fi + +HELM_CHART_DIR="${HELM_CHART_BASE_BIR}/${HELM_CHART_NAME}" if [[ -z "${REPO}" ]]; then echo "Repo (-r) must be specified if no \"make repo-full-name\" target exists"