Skip to content

fix: nil pointer when evaluating when cronjob.enabled=true - #872

Merged
varet80 merged 2 commits into
nextcloud:mainfrom
sapslaj:fix-nil-pointer-evaluating-with-cronjob-enabled
Jul 23, 2026
Merged

fix: nil pointer when evaluating when cronjob.enabled=true#872
varet80 merged 2 commits into
nextcloud:mainfrom
sapslaj:fix-nil-pointer-evaluating-with-cronjob-enabled

Conversation

@sapslaj

@sapslaj sapslaj commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Description of the change

The if block checking if Redis is enabled needs to be anchored correctly since we are inside a with block (with .Values.cronjob.sidecar). Otherwise you get an error:

Error: nextcloud/templates/deployment.yaml:274:26
  executing "nextcloud/templates/deployment.yaml" at <.Values.redis.enabled>:
    nil pointer evaluating interface {}.redis

Benefits

Makes the chart renderable with --set cronjob.enabled=true.

Possible drawbacks

I believe this is the only occurrence but I might have missed an {{- if .Values.redis.enabled }} that needs to be {{- if $.Values.redis.enabled }} instead in some branch. I went through all the places where it was introduced in #752 but might have missed others.

Applicable issues

Additional information

Checklist

@sapslaj
sapslaj force-pushed the fix-nil-pointer-evaluating-with-cronjob-enabled branch 2 times, most recently from 256e381 to 3ac21d1 Compare July 22, 2026 22:02
sapslaj added 2 commits July 22, 2026 18:03
The `if` block checking if Redis is enabled needs to be anchored
correctly since we are inside a `with` block (`with
.Values.cronjob.sidecar`). Otherwise you get an error:

```
Error: nextcloud/templates/deployment.yaml:274:26
  executing "nextcloud/templates/deployment.yaml" at <.Values.redis.enabled>:
    nil pointer evaluating interface {}.redis
```

Signed-off-by: sapslaj <saps.laj@gmail.com>
Signed-off-by: sapslaj <saps.laj@gmail.com>
@sapslaj
sapslaj force-pushed the fix-nil-pointer-evaluating-with-cronjob-enabled branch from 3ac21d1 to 5b2bd61 Compare July 22, 2026 22:03
@varet80

varet80 commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

LGTM

@varet80
varet80 enabled auto-merge July 23, 2026 02:58
@varet80
varet80 disabled auto-merge July 23, 2026 02:58
@varet80
varet80 enabled auto-merge July 23, 2026 02:58
@varet80
varet80 merged commit c968d8b into nextcloud:main Jul 23, 2026
12 checks passed
@sapslaj
sapslaj deleted the fix-nil-pointer-evaluating-with-cronjob-enabled branch July 23, 2026 14:59
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