Repository navigation
Conversation
When deploying onto a cluster that already had a stored manifest secret, assembleConfigForCommand used that manifest directly as the base config, bypassing deployer.DefaultConfig(). Manifests written by an older roxie (predating the imageRegistry field) left roxie.imageRegistry empty, which UsesCustomRegistry() treats as a custom registry, causing deploy to fail validation with "roxie.imageRegistry must include a registry host and org path (e.g. quay.io/rhacs-eng), got:". Always start from the built-in defaults and merge the manifest (and user config, then args) on top, so defaults are preserved when the manifest omits them. Non-empty manifest values still take precedence. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Contributor
|
Thanks for this PR! I've given my approval but would recommend also waiting for at least one of @porridge or @mclasmeier to take a look as well. |
AlexVulaj
approved these changes
Oct 15, 2026
vladbologa
reviewed
Oct 16, 2026
vladbologa
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for finding and fixing this!
| if configBase != nil { | ||
| // Merge the provided base (e.g. an existing cluster manifest) on top of | ||
| // the defaults; non-empty values in the base take precedence. | ||
| if err := mergo.Merge(&config, configBase, mergo.WithOverride, mergo.WithoutDereference); err != nil { |
Collaborator
There was a problem hiding this comment.
This seems ok for now, but could create problems in the future if we add e.g. an int field.
If the default value of that field is 1, and the user tries to set it to 0, it won't be posible.
An alternative would be to keep the direct copy and just add the missing field:
if config.Roxie.ImageRegistry == "" {
config.Roxie.ImageRegistry = constants.DefaultRegistry
}
But then every new field with a non-zero default needs such a fix. Not sure which one's better. Your approach would always work fine if all config fields were pointers.
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.
Problem
roxie deploy centralfails against a cluster that already has a stored manifest secret:Root cause
assembleConfigForCommandused an existing cluster manifest directly as the base config (config = *configBase), bypassingdeployer.DefaultConfig(). Manifests written by an older roxie (before theimageRegistryfield from ROX-35434) have an emptyroxie.imageRegistry. SinceUsesCustomRegistry()returnsImageRegistry != DefaultRegistry, an empty string is treated as a custom registry, sovalidateImageRegistry("")runs and fails with the emptygot:.Fix
Always start from
deployer.DefaultConfig()and merge the cluster manifest (then user config, then args) on top of it. This preserves built-in defaults when the manifest omits them, while non-empty manifest values still take precedence — matching the existingconfigBase == nillayering.Testing
TestAssembleConfigForCommand(fails before the fix, passes after).go build ./...,go test ./...,go vet, andgofmtall clean.🤖 Generated with Claude Code
Summary by CodeRabbit