Skip to content
Merged
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
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ doc/diff: ## Check documentation 'charts/helm_lib/README.md' was rebuilt only

.PHONY: ci/tests/install-plugin
ci/tests/unit/install-plugin: ## Install unittest plugin locally
helm plugin list | grep -q unittest || helm plugin install --version $(UNITTEST_VERSION) https://github.com/helm-unittest/helm-unittest
@helm plugin list 2>/dev/null | grep -q "unittest.*$(UNITTEST_VERSION)" || { \
helm plugin uninstall unittest 2>/dev/null || true; \
helm plugin install --version $(UNITTEST_VERSION) https://github.com/helm-unittest/helm-unittest; \
}

.PHONY: ci/tests/unit
ci/tests/unit: ## Run unittest locally
Expand Down
2 changes: 1 addition & 1 deletion charts/helm_lib/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
type: library
name: deckhouse_lib_helm
version: 1.72.3
version: 1.72.4
description: "Helm utils template definitions for Deckhouse modules."
5 changes: 5 additions & 0 deletions charts/helm_lib/templates/_csi_controller.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
{{- $registryBase := $context.Values.global.modulesImages.registry.base }}
{{- /* Try to get from storage foundation module if enabled */}}
{{- if $context.Values.global.enabledModules | has "storage-foundation" }}
{{- $sfRegistryHost := dig "registry" "base" "" (default dict $context.Values.storageFoundation) }}
{{- if $sfRegistryHost }}
{{- $registryBase = join "/" (list $sfRegistryHost "modules" "storage-foundation" ) }}
{{- else }}
{{- $registryBase = join "/" (list $registryBase "modules" "storage-foundation" ) }}
{{- end }}
{{- $storageFoundationDigests := index $context.Values.global.modulesImages.digests "storageFoundation" | default dict }}
{{- $currentMinor := int $kubernetesSemVer.Minor }}
{{- $kubernetesMajor := int $kubernetesSemVer.Major }}
Expand Down
2 changes: 2 additions & 0 deletions tests/templates/helm_lib_csi_image_with_common_fallback.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ commonNotFound: {{ include "helm_lib_csi_image_with_common_fallback" (list . "cs
otherModulesEnabled: {{ include "helm_lib_csi_image_with_common_fallback" (list . "csiExternalProvisioner" (semver "1.25.0")) }}
---
emptyStorageFoundationDigests: {{ include "helm_lib_csi_image_with_common_fallback" (list . "csiExternalProvisioner" (semver "1.25.0")) }}
---
storageFoundationCustomRegistry: {{ include "helm_lib_csi_image_with_common_fallback" (list . "csiExternalProvisioner" (semver "1.25.0")) }}
22 changes: 22 additions & 0 deletions tests/tests/helm_lib_csi_image_with_common_fallback_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,25 @@ tests:
path: "emptyStorageFoundationDigests"
value: null

- it: should use storageFoundation registry base when explicitly set
documentIndex: 11
set:
global:
enabledModules:
- storage-foundation
modulesImages:
registry:
base: "registry.deckhouse.io/deckhouse/ce"
digests:
storageFoundation:
csiExternalProvisionerForK8SGE125: "sha256:sf-provisioner-125"
common:
csiExternalProvisioner125: "sha256:common-provisioner-125"
storageFoundation:
registry:
base: "registry.example.com/deckhouse"
asserts:
- equal:
path: "storageFoundationCustomRegistry"
value: "registry.example.com/deckhouse/modules/storage-foundation@sha256:sf-provisioner-125"

Loading