Skip to content

Commit fd3f11e

Browse files
committed
feat: hide self contained registry behind a flag
1 parent 0cd5b10 commit fd3f11e

File tree

7 files changed

+21
-13
lines changed

7 files changed

+21
-13
lines changed

.goreleaser.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ before:
4949
sh -ec 'gojq --yaml-input --yaml-output \
5050
".releaseSeries |= (. + [{contract: \"v1beta1\", major: {{ .Major }}, minor: {{ .Minor }}}] | unique)" \
5151
metadata.yaml >release-metadata.yaml'
52-
- make replace-with-mindthegap
52+
- make template-mindthegap
5353

5454

5555
builds:

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ repos:
3636
pass_filenames: false
3737
- id: addons-repo-yaml
3838
name: addons-repo-yaml
39-
entry: make replace-with-mindthegap
39+
entry: make template-mindthegap
4040
language: system
4141
files: "hack/addons/mindthegap-helm-registry/repos.yaml"
4242
pass_filenames: false

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ A Helm chart for cluster-api-runtime-extensions-nutanix
8080
| resources.requests.cpu | string | `"100m"` | |
8181
| resources.requests.memory | string | `"128Mi"` | |
8282
| securityContext.runAsUser | int | `65532` | |
83+
| selfHostedRegistry | bool | `false` | |
84+
| selfHostedRegistryURI | string | `"oci://mindthegap.{{ .Release.Namespace }}.svc/charts"` | |
8385
| service.annotations | object | `{}` | |
8486
| service.port | int | `443` | |
8587
| service.type | string | `"ClusterIP"` | |

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,35 +10,35 @@ data:
1010
cilium: |
1111
ChartName: cilium
1212
ChartVersion: 1.15.0
13-
RepositoryURL: oci://mindthegap.{{ .Release.Namespace }}.svc/charts
13+
RepositoryURL: {{ if .Values.selfHostedRegistry }}{{ .Values.selfHostedRegistryURI }}{{ else }}https://helm.cilium.io/{{ end }}
1414
cluster-autoscaler: |
1515
ChartName: cluster-autoscaler
1616
ChartVersion: 9.35.0
17-
RepositoryURL: oci://mindthegap.{{ .Release.Namespace }}.svc/charts
17+
RepositoryURL: {{ if .Values.selfHostedRegistry }}{{ .Values.selfHostedRegistryURI }}{{ else }}https://kubernetes.github.io/autoscaler{{ end }}
1818
metallb: |
1919
ChartName: metallb
2020
ChartVersion: v0.14.5
21-
RepositoryURL: oci://mindthegap.{{ .Release.Namespace }}.svc/charts
21+
RepositoryURL: {{ if .Values.selfHostedRegistry }}{{ .Values.selfHostedRegistryURI }}{{ else }}https://metallb.github.io/metallb{{ end }}
2222
nfd: |
2323
ChartName: node-feature-discovery
2424
ChartVersion: 0.15.2
25-
RepositoryURL: oci://mindthegap.{{ .Release.Namespace }}.svc/charts
25+
RepositoryURL: {{ if .Values.selfHostedRegistry }}{{ .Values.selfHostedRegistryURI }}{{ else }}https://kubernetes-sigs.github.io/node-feature-discovery/charts{{ end }}
2626
nutanix-ccm: |
2727
ChartName: nutanix-cloud-provider
2828
ChartVersion: 0.3.3
29-
RepositoryURL: oci://mindthegap.{{ .Release.Namespace }}.svc/charts
29+
RepositoryURL: {{ if .Values.selfHostedRegistry }}{{ .Values.selfHostedRegistryURI }}{{ else }}https://nutanix.github.io/helm/{{ end }}
3030
nutanix-snapshot-csi: |
3131
ChartName: nutanix-csi-snapshot
3232
ChartVersion: 6.3.2
33-
RepositoryURL: oci://mindthegap.{{ .Release.Namespace }}.svc/charts
33+
RepositoryURL: {{ if .Values.selfHostedRegistry }}{{ .Values.selfHostedRegistryURI }}{{ else }}https://nutanix.github.io/helm/{{ end }}
3434
nutanix-storage-csi: |
3535
ChartName: nutanix-csi-storage
3636
ChartVersion: 3.0.0-beta.1912
37-
RepositoryURL: oci://mindthegap.{{ .Release.Namespace }}.svc/charts
37+
RepositoryURL: {{ if .Values.selfHostedRegistry }}{{ .Values.selfHostedRegistryURI }}{{ else }}https://nutanix.github.io/helm-releases/{{ end }}
3838
tigera-operator: |
3939
ChartName: tigera-operator
4040
ChartVersion: v3.26.4
41-
RepositoryURL: oci://mindthegap.{{ .Release.Namespace }}.svc/charts
41+
RepositoryURL: {{ if .Values.selfHostedRegistry }}{{ .Values.selfHostedRegistryURI }}{{ else }}https://docs.tigera.io/calico/charts{{ end }}
4242
kind: ConfigMap
4343
metadata:
4444
creationTimestamp: null

charts/cluster-api-runtime-extensions-nutanix/templates/mindthegap.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# This file contains the manifests to run a mindthegap deployment which contains helm charts for our addons.
44
# The pod is built via goreleaser with configuration from hack/addons.
55
#
6+
{{ if .Values.selfHostedRegistry }}
67
apiVersion: cert-manager.io/v1
78
kind: Issuer
89
metadata:
@@ -74,3 +75,4 @@ spec:
7475
- port: 443
7576
targetPort: 5000
7677
type: ClusterIP
78+
{{ end }}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ hooks:
8484

8585
helmAddonsConfigMap: default-helm-addons-config
8686

87+
selfHostedRegistry: false
88+
selfHostedRegistryURI: oci://mindthegap.{{ .Release.Namespace }}.svc/charts
89+
90+
8791
deployDefaultClusterClasses: true
8892

8993
deployment:

make/addons.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,6 @@ generate-helm-configmap: ; $(info $(M) genrating helm configmap) ## this file is
6363
generate-mindthegap-repofile: generate-helm-configmap ; $(info $(M) generating helm repofile for mindthgap)
6464
./hack/addons/generate-mindthegap-repofile.sh
6565

66-
.PHONY: replace-with-mindthegap
67-
replace-with-mindthegap: generate-mindthegap-repofile ## this is used by gorealeaser to set the helm value to this.
68-
sed -i 's/RepositoryURL:.*/RepositoryURL: oci:\/\/mindthegap.{{ .Release.Namespace }}.svc\/charts/g' "./charts/cluster-api-runtime-extensions-nutanix/templates/helm-config.yaml"
66+
.PHONY: template-mindthegap
67+
template-mindthegap: generate-mindthegap-repofile ## this is used by gorealeaser to set the helm value to this.
68+
sed -i '/RepositoryURL:/s#\(RepositoryURL: *\)\(.*\)#\1{{ if .Values.selfHostedRegistry }}{{ .Values.selfHostedRegistryURI }}{{ else }}\2{{ end }}#' "./charts/cluster-api-runtime-extensions-nutanix/templates/helm-config.yaml"

0 commit comments

Comments
 (0)