Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/ctrlc-sync/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: ctrlc-sync
description: A Helm chart for ctrlc sync jobs in Kubernetes
type: application
version: 0.1.0
version: 0.1.1
appVersion: "v0.16.2"

maintainers:
Expand Down
2 changes: 1 addition & 1 deletion charts/ctrlc-sync/templates/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ spec:
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["ctrlc"]
args: ["sync", "kubernetes"]
args: ["sync", "kubernetes", "--provider={{ .Values.ctrlc.provider }}"]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

--provider is passed unconditionally, even when empty.

The default value for ctrlc.provider is "", so this renders as --provider= which may cause the CLI to fail or behave unexpectedly. Other optional fields in this template (e.g., timeZone, startingDeadlineSeconds) are guarded with {{- if }} — this should follow the same pattern.

Proposed fix: conditionally include the provider flag
-              args: ["sync", "kubernetes", "--provider={{ .Values.ctrlc.provider }}"]
+              args:
+                - "sync"
+                - "kubernetes"
+                {{- if .Values.ctrlc.provider }}
+                - "--provider={{ .Values.ctrlc.provider }}"
+                {{- end }}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
args: ["sync", "kubernetes", "--provider={{ .Values.ctrlc.provider }}"]
args:
- "sync"
- "kubernetes"
{{- if .Values.ctrlc.provider }}
- "--provider={{ .Values.ctrlc.provider }}"
{{- end }}
🤖 Prompt for AI Agents
In `@charts/ctrlc-sync/templates/cronjob.yaml` at line 68, The template currently
emits the literal flag --provider={{ .Values.ctrlc.provider }} even when
.Values.ctrlc.provider is empty; change the args entry that builds the cronjob
command to conditionally include the provider flag only when
.Values.ctrlc.provider is non-empty (use the same {{- if .Values.ctrlc.provider
}} ... {{- end }} pattern used elsewhere) so the args array contains either the
flag with a value or omits it entirely; update the args line referencing
.Values.ctrlc.provider and the --provider flag accordingly to preserve valid
YAML/array formatting.

env:
{{- include "ctrlc-sync.envs" . | nindent 16 }}
{{- with .Values.resources }}
Expand Down
1 change: 1 addition & 0 deletions charts/ctrlc-sync/values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ctrlc:
target: "kubernetes"
provider: ""
# All of following values under the ctrlc config from this point
# can be provided directly as strings or as valueFrom
# reference -> https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.35/#envvarsource-v1-core
Expand Down