Skip to content

Commit e738700

Browse files
committed
fixup! refactor: Address review feedback
1 parent d5245bd commit e738700

File tree

12 files changed

+39
-88
lines changed

12 files changed

+39
-88
lines changed

.goreleaser.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ dockers:
103103
- image_templates:
104104
- 'ghcr.io/nutanix-cloud-native/caren-helm-reg:v{{ trimprefix .Version "v" }}-amd64'
105105
use: buildx
106-
dockerfile: ./hack/addons/mindthegap-helm-registry/Dockerfile
106+
dockerfile: ./hack/addons/helm-chart-bundler/Dockerfile
107107
extra_files:
108-
- hack/addons/mindthegap-helm-registry/repos.yaml
108+
- hack/addons/helm-chart-bundler/repos.yaml
109109
build_flag_templates:
110110
- "--platform=linux/amd64"
111111
- "--pull"
@@ -119,9 +119,9 @@ dockers:
119119
- image_templates:
120120
- 'ghcr.io/nutanix-cloud-native/caren-helm-reg:v{{ trimprefix .Version "v" }}-arm64'
121121
use: buildx
122-
dockerfile: ./hack/addons/mindthegap-helm-registry/Dockerfile
122+
dockerfile: ./hack/addons/helm-chart-bundler/Dockerfile
123123
extra_files:
124-
- hack/addons/mindthegap-helm-registry/repos.yaml
124+
- hack/addons/helm-chart-bundler/repos.yaml
125125
build_flag_templates:
126126
- "--platform=linux/arm64"
127127
- "--pull"

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ repos:
5555
name: addons-repo-yaml
5656
entry: make template-helm-repository
5757
language: system
58-
files: "hack/addons/mindthegap-helm-registry/repos.yaml"
58+
files: "hack/addons/helm-chart-bundler/repos.yaml"
5959
pass_filenames: false
6060
- id: check-devbox-lock
6161
name: check-devbox-lock

charts/cluster-api-runtime-extensions-nutanix/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ A Helm chart for cluster-api-runtime-extensions-nutanix
3838
| helmRepository.images.mindthegap.pullPolicy | string | `"IfNotPresent"` | |
3939
| helmRepository.images.mindthegap.repository | string | `"ghcr.io/mesosphere/mindthegap"` | |
4040
| helmRepository.images.mindthegap.tag | string | `"v1.16.0"` | |
41-
| helmRepository.securityContext.fsGroup | int | `65534` | |
42-
| helmRepository.securityContext.runAsUser | int | `65534` | |
41+
| helmRepository.securityContext.fsGroup | int | `65532` | |
42+
| helmRepository.securityContext.runAsGroup | int | `65532` | |
43+
| helmRepository.securityContext.runAsUser | int | `65532` | |
4344
| hooks.ccm.aws.helmAddonStrategy.defaultValueTemplateConfigMap.create | bool | `true` | |
4445
| hooks.ccm.aws.helmAddonStrategy.defaultValueTemplateConfigMap.name | string | `"default-aws-ccm-helm-values-template"` | |
4546
| hooks.ccm.aws.k8sMinorVersionToCCMVersion."1.27" | string | `"v1.27.9"` | |

charts/cluster-api-runtime-extensions-nutanix/templates/helm-config.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,47 +10,47 @@ data:
1010
aws-ccm: |
1111
ChartName: aws-cloud-controller-manager
1212
ChartVersion: 0.0.8
13-
RepositoryURL: {{ if .Values.selfHostedRegistry }}oci://helm-repository.{{ .Release.Namespace }}.svc/charts{{ else }}https://kubernetes.github.io/cloud-provider-aws{{ end }}
13+
RepositoryURL: "{{ if .Values.selfHostedRegistry }}oci://helm-repository.{{ .Release.Namespace }}.svc/charts{{ else }}https://kubernetes.github.io/cloud-provider-aws{{ end }}"
1414
aws-ebs-csi: |
1515
ChartName: aws-ebs-csi-driver
1616
ChartVersion: 2.35.1
17-
RepositoryURL: {{ if .Values.selfHostedRegistry }}oci://helm-repository.{{ .Release.Namespace }}.svc/charts{{ else }}https://kubernetes-sigs.github.io/aws-ebs-csi-driver{{ end }}
17+
RepositoryURL: "{{ if .Values.selfHostedRegistry }}oci://helm-repository.{{ .Release.Namespace }}.svc/charts{{ else }}https://kubernetes-sigs.github.io/aws-ebs-csi-driver{{ end }}"
1818
cilium: |
1919
ChartName: cilium
2020
ChartVersion: 1.16.2
21-
RepositoryURL: {{ if .Values.selfHostedRegistry }}oci://helm-repository.{{ .Release.Namespace }}.svc/charts{{ else }}https://helm.cilium.io/{{ end }}
21+
RepositoryURL: "{{ if .Values.selfHostedRegistry }}oci://helm-repository.{{ .Release.Namespace }}.svc/charts{{ else }}https://helm.cilium.io/{{ end }}"
2222
cluster-autoscaler: |
2323
ChartName: cluster-autoscaler
2424
ChartVersion: 9.40.0
25-
RepositoryURL: {{ if .Values.selfHostedRegistry }}oci://helm-repository.{{ .Release.Namespace }}.svc/charts{{ else }}https://kubernetes.github.io/autoscaler{{ end }}
25+
RepositoryURL: "{{ if .Values.selfHostedRegistry }}oci://helm-repository.{{ .Release.Namespace }}.svc/charts{{ else }}https://kubernetes.github.io/autoscaler{{ end }}"
2626
local-path-provisioner-csi: |
2727
ChartName: local-path-provisioner
2828
ChartVersion: 0.0.29
29-
RepositoryURL: {{ if .Values.selfHostedRegistry }}oci://helm-repository.{{ .Release.Namespace }}.svc/charts{{ else }}https://charts.containeroo.ch{{ end }}
29+
RepositoryURL: "{{ if .Values.selfHostedRegistry }}oci://helm-repository.{{ .Release.Namespace }}.svc/charts{{ else }}https://charts.containeroo.ch{{ end }}"
3030
metallb: |
3131
ChartName: metallb
3232
ChartVersion: 0.14.8
33-
RepositoryURL: {{ if .Values.selfHostedRegistry }}oci://helm-repository.{{ .Release.Namespace }}.svc/charts{{ else }}https://metallb.github.io/metallb{{ end }}
33+
RepositoryURL: "{{ if .Values.selfHostedRegistry }}oci://helm-repository.{{ .Release.Namespace }}.svc/charts{{ else }}https://metallb.github.io/metallb{{ end }}"
3434
nfd: |
3535
ChartName: node-feature-discovery
3636
ChartVersion: 0.16.4
37-
RepositoryURL: {{ if .Values.selfHostedRegistry }}oci://helm-repository.{{ .Release.Namespace }}.svc/charts{{ else }}https://kubernetes-sigs.github.io/node-feature-discovery/charts{{ end }}
37+
RepositoryURL: "{{ if .Values.selfHostedRegistry }}oci://helm-repository.{{ .Release.Namespace }}.svc/charts{{ else }}https://kubernetes-sigs.github.io/node-feature-discovery/charts{{ end }}"
3838
nutanix-ccm: |
3939
ChartName: nutanix-cloud-provider
4040
ChartVersion: 0.4.1
41-
RepositoryURL: {{ if .Values.selfHostedRegistry }}oci://helm-repository.{{ .Release.Namespace }}.svc/charts{{ else }}https://nutanix.github.io/helm/{{ end }}
41+
RepositoryURL: "{{ if .Values.selfHostedRegistry }}oci://helm-repository.{{ .Release.Namespace }}.svc/charts{{ else }}https://nutanix.github.io/helm/{{ end }}"
4242
nutanix-storage-csi: |
4343
ChartName: nutanix-csi-storage
4444
ChartVersion: 3.1.0
45-
RepositoryURL: {{ if .Values.selfHostedRegistry }}oci://helm-repository.{{ .Release.Namespace }}.svc/charts{{ else }}https://nutanix.github.io/helm-releases/{{ end }}
45+
RepositoryURL: "{{ if .Values.selfHostedRegistry }}oci://helm-repository.{{ .Release.Namespace }}.svc/charts{{ else }}https://nutanix.github.io/helm-releases/{{ end }}"
4646
snapshot-controller: |
4747
ChartName: snapshot-controller
4848
ChartVersion: 3.0.6
49-
RepositoryURL: {{ if .Values.selfHostedRegistry }}oci://helm-repository.{{ .Release.Namespace }}.svc/charts{{ else }}https://piraeus.io/helm-charts/{{ end }}
49+
RepositoryURL: "{{ if .Values.selfHostedRegistry }}oci://helm-repository.{{ .Release.Namespace }}.svc/charts{{ else }}https://piraeus.io/helm-charts/{{ end }}"
5050
tigera-operator: |
5151
ChartName: tigera-operator
5252
ChartVersion: v3.28.2
53-
RepositoryURL: {{ if .Values.selfHostedRegistry }}oci://helm-repository.{{ .Release.Namespace }}.svc/charts{{ else }}https://docs.tigera.io/calico/charts{{ end }}
53+
RepositoryURL: "{{ if .Values.selfHostedRegistry }}oci://helm-repository.{{ .Release.Namespace }}.svc/charts{{ else }}https://docs.tigera.io/calico/charts{{ end }}"
5454
kind: ConfigMap
5555
metadata:
5656
creationTimestamp: null

charts/cluster-api-runtime-extensions-nutanix/values.schema.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@
7878
"fsGroup": {
7979
"type": "integer"
8080
},
81+
"runAsGroup": {
82+
"type": "integer"
83+
},
8184
"runAsUser": {
8285
"type": "integer"
8386
}

charts/cluster-api-runtime-extensions-nutanix/values.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,9 @@ helmRepository:
143143
tag: "v1.16.0"
144144
pullPolicy: IfNotPresent
145145
securityContext:
146-
runAsUser: 65534
147-
fsGroup: 65534
146+
runAsUser: 65532
147+
runAsGroup: 65532
148+
fsGroup: 65532
148149

149150
# -- Optional secrets used for pulling the container image
150151
imagePullSecrets: []

hack/addons/add-warning-helm-configmap.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ readonly SCRIPT_DIR
88
# shellcheck source=hack/common.sh
99
source "${SCRIPT_DIR}/../common.sh"
1010
ASSETS_DIR="$(mktemp -d -p "${TMPDIR:-/tmp}")"
11+
trap 'rm -rf "${ASSETS_DIR}"' EXIT
12+
1113
mv "${GIT_REPO_ROOT}/charts/cluster-api-runtime-extensions-nutanix/templates/helm-config.yaml" "${ASSETS_DIR}/helm-config.yaml"
1214
# add warning not to edit file directly
1315
cat <<EOF >"${GIT_REPO_ROOT}/charts/cluster-api-runtime-extensions-nutanix/templates/helm-config.yaml"

hack/addons/generate-mindthegap-repofile.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@ readonly SCRIPT_DIR
99
source "${SCRIPT_DIR}/../common.sh"
1010

1111
ASSETS_DIR="$(mktemp -d -p "${TMPDIR:-/tmp}")"
12+
trap 'rm -rf "${ASSETS_DIR}"' EXIT
1213

1314
cp "${GIT_REPO_ROOT}/charts/cluster-api-runtime-extensions-nutanix/templates/helm-config.yaml" "${ASSETS_DIR}"
1415

15-
# this sed line is needed because the go library is unable to parse yaml with a template string.
16-
sed -i s/"{{ .Values.helmAddonsConfigMap }}"/placeholder/g "${ASSETS_DIR}/helm-config.yaml"
1716
go run "${GIT_REPO_ROOT}/hack/tools/mindthegap-helm-reg/main.go" --input-configmap-file="${ASSETS_DIR}/helm-config.yaml" --output-file="${ASSETS_DIR}/repos.yaml"
1817

1918
# add warning not to edit file directly
20-
cat <<EOF >"${GIT_REPO_ROOT}/hack/addons/mindthegap-helm-registry/repos.yaml"
19+
cat <<EOF >"${GIT_REPO_ROOT}/hack/addons/helm-chart-bundler/repos.yaml"
2120
$(cat "${GIT_REPO_ROOT}/hack/license-header.yaml.txt")
2221
2322
#=================================================================

hack/addons/mindthegap-helm-registry/Dockerfile renamed to hack/addons/helm-chart-bundler/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ARG MINDTHEGAP_VERSION=v1.16.0
22

33
FROM --platform=${BUILDPLATFORM} ghcr.io/mesosphere/mindthegap:${MINDTHEGAP_VERSION} as bundle_builder
44
# This gets called by goreleaser so the copy source has to be the path relative to the repo root.
5-
RUN --mount=source=./hack/addons/mindthegap-helm-registry/repos.yaml,target=/repos.yaml \
5+
RUN --mount=source=./hack/addons/helm-chart-bundler/repos.yaml,target=/repos.yaml \
66
["/ko-app/mindthegap", "create", "bundle", "--helm-charts-file=/repos.yaml", "--output-file=/tmp/helm-charts.tar"]
77

88
FROM --platform=${TARGETPLATFORM} busybox:1.37.0-musl as static-busybox
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright 2024 Nutanix. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
#=================================================================
5+
# DO NOT EDIT THIS FILE
6+
# IT HAS BEEN GENERATED BY /hack/addons/generate-mindthegap-repofile.sh
7+
#=================================================================
8+
{}

0 commit comments

Comments
 (0)