From f53d56d83a092293fc62605c02dba789e4b2ba0c Mon Sep 17 00:00:00 2001 From: Jonathan Innis Date: Fri, 23 Feb 2024 17:45:49 -0800 Subject: [PATCH] Remove unused release-crd target --- Makefile | 5 +---- hack/release/common.sh | 11 ++++++----- hack/release/release-crd.sh | 17 ----------------- 3 files changed, 7 insertions(+), 26 deletions(-) delete mode 100755 hack/release/release-crd.sh diff --git a/Makefile b/Makefile index 1c9440021654..72f1eaa283ee 100644 --- a/Makefile +++ b/Makefile @@ -158,9 +158,6 @@ snapshot: ## Builds and publishes snapshot release release: ## Builds and publishes stable release $(WITH_GOFLAGS) ./hack/release/release.sh -release-crd: ## Packages and publishes a karpenter-crd helm chart - $(WITH_GOFLAGS) ./hack/release/release-crd.sh - prepare-website: ## prepare the website for release ./hack/release/prepare-website.sh @@ -186,7 +183,7 @@ update-karpenter: ## Update kubernetes-sigs/karpenter to latest go get -u sigs.k8s.io/karpenter@HEAD go mod tidy -.PHONY: help presubmit ci-test ci-non-test run test deflake e2etests e2etests-deflake benchmark coverage verify vulncheck licenses image apply install delete docgen codegen stable-release-pr snapshot release release-crd prepare-website toolchain issues website tidy download update-karpenter +.PHONY: help presubmit ci-test ci-non-test run test deflake e2etests e2etests-deflake benchmark coverage verify vulncheck licenses image apply install delete docgen codegen stable-release-pr snapshot release prepare-website toolchain issues website tidy download update-karpenter define newline diff --git a/hack/release/common.sh b/hack/release/common.sh index 87a0f8602d71..ebd74c37ccf4 100644 --- a/hack/release/common.sh +++ b/hack/release/common.sh @@ -1,18 +1,14 @@ #!/usr/bin/env bash set -euo pipefail -GITHUB_ACCOUNT="aws" ECR_GALLERY_NAME="karpenter" RELEASE_REPO_ECR="${RELEASE_REPO_ECR:-public.ecr.aws/${ECR_GALLERY_NAME}/}" -RELEASE_REPO_GH="${RELEASE_REPO_GH:-ghcr.io/${GITHUB_ACCOUNT}/karpenter}" SNAPSHOT_ECR="021119463062.dkr.ecr.us-east-1.amazonaws.com" SNAPSHOT_REPO_ECR="${SNAPSHOT_REPO_ECR:-${SNAPSHOT_ECR}/karpenter/snapshot/}" CURRENT_MAJOR_VERSION="0" -MAIN_GITHUB_ACCOUNT="aws" - snapshot() { local commit_sha version helm_chart_version @@ -26,6 +22,7 @@ Commit: ${commit_sha} Helm Chart Version ${helm_chart_version}" authenticatePrivateRepo + echo "authenticated, now building" build "${SNAPSHOT_REPO_ECR}" "${version}" "${helm_chart_version}" "${commit_sha}" } @@ -61,9 +58,12 @@ build() { helm_chart_version="${3}" commit_sha="${4}" + echo "calculating the date epoch" date_epoch="$(dateEpoch)" + echo "getting the build date" build_date="$(buildDate "${date_epoch}")" + echo "GOFLAGS=${GOFLAGS:-} SOURCE_DATE_EPOCH=${date_epoch} KO_DATA_DATE_EPOCH=${date_epoch} KO_DOCKER_REPO=${oci_repo} ko publish -B -t ${version} ./cmd/controller" img="$(GOFLAGS=${GOFLAGS:-} SOURCE_DATE_EPOCH="${date_epoch}" KO_DATA_DATE_EPOCH="${date_epoch}" KO_DOCKER_REPO="${oci_repo}" ko publish -B -t "${version}" ./cmd/controller)" img_repo="$(echo "${img}" | cut -d "@" -f 1 | cut -d ":" -f 1)" img_tag="$(echo "${img}" | cut -d "@" -f 1 | cut -d ":" -f 2 -s)" @@ -127,7 +127,8 @@ buildDate() { date_epoch="${1}" - date -u -r "${date_epoch}" "+%Y-%m-%dT%H:%M:%SZ" 2>/dev/null + echo "got the date_epoch: ${date_epoch}" + date -u -r ${date_epoch} "+%Y-%m-%dT%H:%M:%SZ" } prepareWebsite() { diff --git a/hack/release/release-crd.sh b/hack/release/release-crd.sh deleted file mode 100755 index cced2a5d79a0..000000000000 --- a/hack/release/release-crd.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" -# shellcheck source=hack/release/common.sh -source "${SCRIPT_DIR}/common.sh" - -commit_sha="$(git rev-parse HEAD)" -git_tag="$(git describe --exact-match --tags || echo "no tag")" - -BUILD_DATE="$(buildDate "$(dateEpoch)")" - -publishHelmChart "${RELEASE_REPO_GH}" "karpenter-crd" "${commit_sha}" "${commit_sha}" "${BUILD_DATE}" - -if [[ "${git_tag}" == v* ]]; then - publishHelmChart "${RELEASE_REPO_GH}" "karpenter-crd" "${git_tag#v}" "${commit_sha}" "${BUILD_DATE}" -fi