Skip to content

[fix] inject registry as plain values to fix CEL validation - #820

Merged
ipaqsa merged 2 commits into
mainfrom
fix/registry-values-plain-json
Aug 14, 2026
Merged

[fix] inject registry as plain values to fix CEL validation#820
ipaqsa merged 2 commits into
mainfrom
fix/registry-values-plain-json

Conversation

@Fkuloff

@Fkuloff Fkuloff commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Overview

InjectRegistryValue wrote the *Registry struct straight into the module values tree; it now writes a plain map[string]any with the same JSON shape.

What this PR does / why we need it

CEL validation of x-deckhouse-validations converts values with structpb, which accepts only maps, slices and scalars, so every hook values patch failed with convert values to struct: proto: invalid type: *modules.Registry. It hits any module that has a root-level validation rule and an injected registry, i.e. every module delivered from a ModuleSource.

The typed pointer reached the validator because calculateResultValues leaves the merged map as is while there are no patches yet — ApplyValuesPatch returns early — so the first patch of the first hook already failed and the module never converged.

Special notes for your reviewer

ca stays omitted when empty, mirroring the omitempty tag, so rendered values and their checksum do not change.

Signed-off-by: Artem Kuleshov <artem.kuleshov@flant.com>
Signed-off-by: Artem Kuleshov <artem.kuleshov@flant.com>
@Fkuloff Fkuloff added the bug Something isn't working label Aug 14, 2026
@Fkuloff
Fkuloff marked this pull request as ready for review August 14, 2026 12:32
@ipaqsa ipaqsa changed the title [addon-operator] inject registry as plain values to fix CEL validation [fix] inject registry as plain values to fix CEL validation Aug 14, 2026
@ipaqsa
ipaqsa merged commit daf0078 into main Aug 14, 2026
10 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants