Skip to content

Deploy (do not merge) - #2

Closed
kingdonb wants to merge 21 commits into
mainfrom
deploy
Closed

kingdonb wants to merge 21 commits into
mainfrom
deploy

Conversation

@kingdonb

Copy link
Copy Markdown
Owner

No description provided.

kvaps and others added 8 commits June 26, 2024 10:43
Signed-off-by: Kingdon Barrett <[email protected]>

move fluxcd and operator back to system

Signed-off-by: Andrei Kvapil <[email protected]>
fixup registry

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]>
built 0.1.27

Signed-off-by: Kingdon Barrett <[email protected]>
kingdonb added 10 commits June 26, 2024 10:47
Signed-off-by: Kingdon Barrett <[email protected]>
(0.1.28 is already tagged as f0e5e9dc9e503e915f25a5888866b3b17d8ceb10)

Signed-off-by: Kingdon Barrett <[email protected]>
When the local apply is finished, we still have yet to resume. Flux is
not "ok ok" until the HelmRelease is ready too.

Signed-off-by: Kingdon Barrett <[email protected]>
it was incorrect

Signed-off-by: Kingdon Barrett <[email protected]>
Signed-off-by: Kingdon Barrett <[email protected]>
where `helm upgrade` can find them for the post-renderer

Otherwise, these variables will not be available in the
fluxcd-kustomize.sh script

Signed-off-by: Kingdon Barrett <[email protected]>
Signed-off-by: Kingdon Barrett <[email protected]>
@kingdonb kingdonb closed this Jun 28, 2024
@kingdonb
kingdonb deleted the deploy branch June 28, 2024 14:52
@kingdonb kingdonb mentioned this pull request Jun 28, 2024
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 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants