diff --git a/charts/karpenter-crd/Chart.yaml b/charts/karpenter-crd/Chart.yaml
index 70d122d7e5ec..ce3066a47213 100644
--- a/charts/karpenter-crd/Chart.yaml
+++ b/charts/karpenter-crd/Chart.yaml
@@ -1,6 +1,6 @@
apiVersion: v2
name: karpenter-crd
-description: A Helm chart for Karpenter Custom Resource Definitions (CRDs)
+description: A Helm chart for Karpenter Custom Resource Definitions (CRDs).
type: application
version: 0.36.0
appVersion: 0.36.0
diff --git a/charts/karpenter-crd/README.md b/charts/karpenter-crd/README.md
new file mode 100644
index 000000000000..566d9a7efa12
--- /dev/null
+++ b/charts/karpenter-crd/README.md
@@ -0,0 +1,15 @@
+# karpenter-crd
+
+![Version: 0.36.0](https://img.shields.io/badge/Version-0.36.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.36.0](https://img.shields.io/badge/AppVersion-0.36.0-informational?style=flat-square)
+
+A Helm chart for Karpenter Custom Resource Definitions (CRDs).
+
+**Homepage:**
+
+## Source Code
+
+*
+
+----------------------------------------------
+
+Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/helm-docs/).
diff --git a/charts/karpenter-crd/README.md.gotmpl b/charts/karpenter-crd/README.md.gotmpl
new file mode 100644
index 000000000000..7991d3c23035
--- /dev/null
+++ b/charts/karpenter-crd/README.md.gotmpl
@@ -0,0 +1,20 @@
+{{ template "chart.header" . }}
+{{ template "chart.deprecationWarning" . }}
+
+{{ template "chart.badgesSection" . }}
+
+{{ template "chart.description" . }}
+
+{{ template "chart.homepageLine" . }}
+
+{{ template "chart.maintainersSection" . }}
+
+{{ template "chart.sourcesSection" . }}
+
+{{ template "chart.requirementsSection" . }}
+
+{{ template "chart.valuesSection" . }}
+
+----------------------------------------------
+
+Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/helm-docs/).
diff --git a/charts/karpenter-crd/artifacthub-repo.yaml b/charts/karpenter-crd/artifacthub-repo.yaml
index 194c8d2496ea..814833c19915 100644
--- a/charts/karpenter-crd/artifacthub-repo.yaml
+++ b/charts/karpenter-crd/artifacthub-repo.yaml
@@ -1,4 +1,4 @@
-repositoryID: fda7ffc4-4672-4218-8264-321ec3b4e3cc
+repositoryID: 2cfb6f76-afe1-447f-b036-cd2e230d07d7
owners: []
# - name: awsadmin1
# email: artifacthub1@aws.com
diff --git a/charts/karpenter-crd/values.yaml b/charts/karpenter-crd/values.yaml
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/charts/karpenter/README.md b/charts/karpenter/README.md
index 497818969d2e..3ba2824468c6 100644
--- a/charts/karpenter/README.md
+++ b/charts/karpenter/README.md
@@ -111,3 +111,6 @@ cosign verify public.ecr.aws/karpenter/karpenter:0.36.0 \
| webhook.metrics.port | int | `8001` | The container port to use for webhook metrics. |
| webhook.port | int | `8443` | The container port to use for the webhook. |
+----------------------------------------------
+
+Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/helm-docs/).
diff --git a/charts/karpenter/README.md.gotmpl b/charts/karpenter/README.md.gotmpl
index 1e641e1ee586..ee4c8d1e4c0c 100644
--- a/charts/karpenter/README.md.gotmpl
+++ b/charts/karpenter/README.md.gotmpl
@@ -39,4 +39,6 @@ cosign verify public.ecr.aws/karpenter/karpenter:{{ template "chart.version" . }
{{ template "chart.valuesSection" . }}
-{{ template "helm-docs.versionFooter" . }}
+----------------------------------------------
+
+Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/helm-docs/).
diff --git a/hack/release/common.sh b/hack/release/common.sh
index 04a1c26286d4..00d5c96e0ea3 100644
--- a/hack/release/common.sh
+++ b/hack/release/common.sh
@@ -76,7 +76,7 @@ build() {
}
publishHelmChart() {
- local oci_repo helm_chart version commit_sha build_date ah_config_file_name helm_chart_artifact helm_chart_digest
+ local oci_repo helm_chart version commit_sha build_date helm_chart_artifact helm_chart_digest
oci_repo="${1}"
helm_chart="${2}"
@@ -84,21 +84,15 @@ publishHelmChart() {
commit_sha="${4}"
build_date="${5}"
- ah_config_file_name="${helm_chart}/artifacthub-repo.yaml"
helm_chart_artifact="${helm_chart}-${version}.tgz"
+ updateAhConfig "${oci_repo}" "${helm_chart}"
+
yq e -i ".appVersion = \"${version}\"" "charts/${helm_chart}/Chart.yaml"
yq e -i ".version = \"${version}\"" "charts/${helm_chart}/Chart.yaml"
cd charts
- if [[ -s "${ah_config_file_name}" ]] && [[ "$oci_repo" == "${RELEASE_REPO_ECR}" ]]; then
- # ECR requires us to create an empty config file for an alternative
- # media type artifact push rather than /dev/null
- # https://github.com/aws/containers-roadmap/issues/1074
- temp=$(mktemp)
- echo {} > "${temp}"
- oras push "${oci_repo}${helm_chart}:artifacthub.io" --config "${temp}:application/vnd.cncf.artifacthub.config.v1+yaml" "${ah_config_file_name}:application/vnd.cncf.artifacthub.repository-metadata.layer.v1.yaml"
- fi
+
helm dependency update "${helm_chart}"
helm lint "${helm_chart}"
helm package "${helm_chart}" --version "${version}"
@@ -110,6 +104,41 @@ publishHelmChart() {
cosignOciArtifact "${version}" "${commit_sha}" "${build_date}" "${oci_repo}${helm_chart}:${version}@${helm_chart_digest}"
}
+updateAhConfig() {
+ local oci_repo helm_chart ah_config_path image_config_path image_config media_type oci_repository oci_image old_config_digest blob_digest
+
+ oci_repo="${1}"
+ helm_chart="${2}"
+
+ ah_config_path="./charts/${helm_chart}/artifacthub-repo.yaml"
+
+ if [[ -f "${ah_config_path}" ]] && [[ "${oci_repo}" == "${RELEASE_REPO_ECR}" ]]; then
+ # ECR requires us to create an empty config file for an alternative
+ # media type artifact push rather than /dev/null
+ # https://github.com/aws/containers-roadmap/issues/1074
+ image_config_path="$(mktemp)"
+ echo "{}" > "${image_config_path}"
+
+ image_config="${image_config_path}:application/vnd.cncf.artifacthub.config.v1+yaml"
+ media_type="application/vnd.cncf.artifacthub.repository-metadata.layer.v1.yaml"
+ oci_repository="${oci_repo}${helm_chart}"
+ oci_image="${oci_repository}:artifacthub.io"
+
+ old_config_digest="$(crane digest "${oci_image}" || true)"
+
+ if [[ -n "${old_config_digest}" ]]; then
+ blob_digest="$(oras manifest fetch --output - "${oci_repository}@${old_config_digest}" | jq -r --arg mediaType "${media_type}" '.layers[] | select(.mediaType == $mediaType) | .digest')"
+
+ if [[ "$(oras blob fetch --output - "${oci_repository}@${blob_digest}")" != "$(cat "${ah_config_path}")" ]]; then
+ oras push --config "${image_config}" "${oci_image}" "${ah_config_path}:${media_type}"
+ crane delete "${oci_repository}@${old_config_digest}"
+ fi
+ else
+ oras push --config "${image_config}" "${oci_image}" "${ah_config_path}:${media_type}"
+ fi
+ fi
+}
+
cosignOciArtifact() {
local version commit_sha build_date artifact