Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions charts/ocean-kubernetes-controller/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ helm install spot spot/ocean-kubernetes-controller \

Kubernetes: `>=1.20.0-0`

Helm: `>=3.9.0`

| Repository | Name | Version |
|------------|------|---------|
| https://kubernetes-sigs.github.io/metrics-server | metrics-server | 3.11.0 |
Expand Down
16 changes: 15 additions & 1 deletion charts/ocean-kubernetes-controller/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -352,4 +352,18 @@ or if another log shipping destination host is specified.
true
{{- end }}
{{- end }}
{{- end }}
{{- end }}

{{/*
This function validates the Helm version. It checks if the Helm version is 3.7 or higher.
If the Helm version is less than 3.7, it will cause the Helm operation to fail with an error message.
*/}}
{{- define "ocean-kubernetes-controller.validateHelmVersion" -}}
{{- $helmVersion := .Capabilities.HelmVersion.Version }}
{{- if $helmVersion -}}
{{- if semverCompare ">=v3.9.0" (semver $helmVersion).String -}}
{{- else -}}
{{- fail "Helm version 3.9.0 or higher is required to install this chart" -}}
{{- end -}}
{{- end -}}
{{- end -}}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{ include "ocean-kubernetes-controller.validateHelmVersion" . }}
{{ include "ocean-kubernetes-controller.deployMetricsServer" . }}
apiVersion: apps/v1
kind: Deployment
Expand Down