Repository navigation
Conversation
kingdonb
force-pushed
the
deploy
branch
3 times, most recently
from
June 22, 2024 21:13
8b43278 to
7d88c84
Compare
Signed-off-by: Kingdon Barrett <[email protected]>
Signed-off-by: Kingdon Barrett <[email protected]>
Signed-off-by: Kingdon Barrett <[email protected]>
Signed-off-by: Kingdon Barrett <[email protected]>
Signed-off-by: Kingdon Barrett <[email protected]>
Signed-off-by: Kingdon Barrett <[email protected]>
kingdonb
pushed a commit
that referenced
this pull request
Nov 23, 2025
….merge (cozystack#1583) [nats] Fixes for NATS App Helm chart, fix template issues with config.merge value ## What this PR does This PR fixes two critical bugs in the NATS application chart (`packages/apps/nats`) that prevented successful deployment when using user authentication with custom configuration: **Bug #1: YAML Parse Error with Empty config.merge** - When users were defined but `config.merge` was empty (`{}`), the Helm template would fail with YAML parse errors - Fixed by adding safe existence checks before accessing `.Values.config.merge` and preventing rendering of empty merge blocks **Bug #2: Incorrect Config Nesting** - When both `users` and `config.merge` were defined, custom NATS config values (e.g., `max_payload`, `max_connections`) were incorrectly nested as children of the `accounts` object instead of being placed at the root NATS configuration level - This caused NATS pods to crash with "Expected map entries for accounts" errors - Fixed by correcting the indentation from `nindent 12` to `nindent 10` in the template The related issue is cozystack#1354 ### Changes Made **File**: `packages/apps/nats/templates/nats.yaml` 1. Line 55: Added safe existence checks for `.Values.config.merge` 2. Line 66: Added length validation to prevent rendering empty merge objects 3. Line 67: Fixed indentation to ensure config values merge at root level ### Impact - Enables NATS deployments with user authentication and custom configuration - Fixes Stalwart mail server clustering scenarios that require NATS with authentication - Resolves HelmRelease failures in multi-tenant environments ### Testing Can be tested with: ```yaml apiVersion: apps.cozystack.io/v1alpha1 kind: NATS metadata: name: test-nats spec: replicas: 2 users: testuser: {} config: merge: max_payload: 2097152 max_connections: 500 ``` Expected result: HelmRelease succeeds, NATS pods start successfully, and configuration is valid. --- ### Release note ```release-note [nats] Fix NATS application chart template bugs that prevented deployments with user authentication and custom configuration. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Enhanced configuration validation with improved guard conditions to ensure proper handling of merge configurations. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
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.
This PR is me figuring out the build system well enough to test: