[chore] update image helper - #214
Merged
Merged
Conversation
Signed-off-by: Stepan Paksashvili <stepan.paksashvili@flant.com>
ipaqsa
force-pushed
the
chore/update-image-helper
branch
from
September 1, 2026 13:36
bc1eac0 to
c23f55b
Compare
Signed-off-by: Stepan Paksashvili <stepan.paksashvili@flant.com>
Signed-off-by: Stepan Paksashvili <stepan.paksashvili@flant.com>
ldmonster
approved these changes
Sep 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Teaches every image helper about
Module.Package, and adds theEmbeddedflag.Until now only
helm_lib_module_imageknew about module packages. The other helpersalways read the platform image map, so
helm_lib_module_image_digestcould return adifferent digest than
helm_lib_module_imagehad just resolved for the same container.All six helpers now follow one rule:
.Module.Packagepresent, no module name given.Module.Packagepresent,<module-name>given.Module.PackageEmbedded packages. A package's images are either built into the platform image set
or pulled next to the package in a module registry:
Module.Package.Embedded<Package.Registry.repository>/<Package.Name>@<digest>true<global.modulesImages.registry.base>@<digest>An embedded image is already in the platform registry, so it is addressed by digest
alone — no package-name path segment — and neither
Package.Registry.repositorynorPackage.Nameis required for it to resolve.Common images stay platform images.
helm_lib_module_common_image*keeps readingglobal.modulesImages.digests.commonfor packaged and legacy modules alike; a packagedmodule does not ship its own copy of
kubeRbacProxyand friends.Deduplication
Four internal helpers absorb logic that was copy-pasted across the public helpers:
helm_lib_internal_module_own_packagehelm_lib_internal_module_package_registry_baseEmbeddedsplithelm_lib_internal_module_raw_nameif ge (len .) 3/ else-chart-name block, duplicated 4×helm_lib_internal_module_registry_baseThat override block is how the two override paths silently drifted apart:
helm_lib_module_imageappends the kebab-cased module name to the override host,helm_lib_module_image_no_failappends.Chart.Name. The difference is preserved, butit is now one argument at a call site with a comment, instead of two buried blocks.
Compatibility
A context without
.Module.Packageresolves exactly as before — same image, same digest,same registry base, same failure message in the same order. Behavior changes only for
contexts that carry a package, which is the point of the PR.
Deliberately not changed
Pre-existing quirks, kept so the legacy path stays bit-for-bit identical. Each is worth
a follow-up:
helm_lib_module_image/helm_lib_module_image_no_faillook the digest up in theplatform map with a three-argument
index, which raisesindex of nil pointerfor amodule absent from
global.modulesImages.digests— so_no_faildoes fail for anunknown module. The
_digest*helpers use| default dictand return empty instead.(
Image <container> has no digest)..Chart.Nameasymmetry of the override path described above.Tests
make ci/tests/unit— 84 suites, 375 tests, all passing. The package fixture gained aValues.globalblock so it matches the shape of a real root context and lost its staleDeckhouse.modulesImagesblock, which no longer exists in the values and was read bynothing. Two documents were added: one for embedded packages, one exercising every
helper against a package.
Beyond the suite, the old and the new template were rendered against 44 call
combinations — both context shapes, present/absent/quoted/kebab-cased module names, the
override set and unset, embedded and downloaded packages, and every failure path. All 26
legacy-context cases are byte-identical, error messages included; the differences are
confined to package contexts and are the intended ones.
make doc/diffis clean;README.mdis regenerated in the same commit.