Skip to content

Conversation

FalcoSuessgott
Copy link
Contributor

@FalcoSuessgott FalcoSuessgott commented Aug 25, 2025

kagent install would construct an invalid helm upgrade command due to a missing --set parameter.

When invoking kagent install (with no specified config params or other kagent env vars) & running a ps aux in parallel I can see that kagent runs the following command

helm upgrade --install kagent oci://ghcr.io/kagent-dev/kagent/helm/kagent --version 0.6.3 --namespace kagent --create-namespace --wait --history-max 2 --timeout 5m --set providers.default=openAI --set providers.openAI.apiKey=<REDACTED> --set `

This command is invalid and errors with Error: flag needs an argument: --set.

The reason that we pass []{""} to installChart() is because we obtain the values from here:

helmExtraArgs := GetEnvVarWithDefault(KAGENT_HELM_EXTRA_ARGS, "")

where if KAGENT_HELM_EXTRA_ARGS is not present we return "".

This PR simply checks if the value is != "" before appending to helm upgrade

@Copilot Copilot AI review requested due to automatic review settings August 25, 2025 04:34
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an issue where the kagent install command would generate an invalid Helm upgrade command when the KAGENT_HELM_EXTRA_ARGS environment variable is empty or unset. The bug caused a malformed command with a trailing --set flag without any arguments.

  • Added validation to skip empty string values before appending --set flags to the Helm command
  • Removed an unnecessary blank line for code cleanup

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Signed-off-by: Tom Morelly <tom.morelly@clearroute.io>
@EItanya EItanya merged commit 9a7ddb9 into kagent-dev:main Aug 25, 2025
17 of 18 checks passed
inFocus7 pushed a commit to inFocus7/kagent that referenced this pull request Aug 25, 2025
`kagent install` would construct an invalid `helm upgrade` command due
to a missing `--set` parameter.

When invoking `kagent install` (with no specified config params or other
`kagent` env vars) & running a `ps aux` in parallel I can see that
`kagent` runs the following command
```go
helm upgrade --install kagent oci://ghcr.io/kagent-dev/kagent/helm/kagent --version 0.6.3 --namespace kagent --create-namespace --wait --history-max 2 --timeout 5m --set providers.default=openAI --set providers.openAI.apiKey=<REDACTED> --set `
```

This command is invalid and errors with `Error: flag needs an argument:
--set`.

The reason that we pass `[]{""}` to `installChart()` is because we
obtain the values from
[here](https://github.com/kagent-dev/kagent/blob/main/go/cli/internal/cli/install.go#L78):

```go
helmExtraArgs := GetEnvVarWithDefault(KAGENT_HELM_EXTRA_ARGS, "")
```

where if `KAGENT_HELM_EXTRA_ARGS` is not present we return `""`.

This PR simply checks if the value is `!= ""` before appending to `helm
upgrade`

Signed-off-by: Tom Morelly <tom.morelly@clearroute.io>
yanivmn pushed a commit to yanivmn/kagent that referenced this pull request Aug 28, 2025
`kagent install` would construct an invalid `helm upgrade` command due
to a missing `--set` parameter.

When invoking `kagent install` (with no specified config params or other
`kagent` env vars) & running a `ps aux` in parallel I can see that
`kagent` runs the following command
```go
helm upgrade --install kagent oci://ghcr.io/kagent-dev/kagent/helm/kagent --version 0.6.3 --namespace kagent --create-namespace --wait --history-max 2 --timeout 5m --set providers.default=openAI --set providers.openAI.apiKey=<REDACTED> --set `
```

This command is invalid and errors with `Error: flag needs an argument:
--set`.

The reason that we pass `[]{""}` to `installChart()` is because we
obtain the values from
[here](https://github.com/kagent-dev/kagent/blob/main/go/cli/internal/cli/install.go#L78):

```go
helmExtraArgs := GetEnvVarWithDefault(KAGENT_HELM_EXTRA_ARGS, "")
```

where if `KAGENT_HELM_EXTRA_ARGS` is not present we return `""`.

This PR simply checks if the value is `!= ""` before appending to `helm
upgrade`

Signed-off-by: Tom Morelly <tom.morelly@clearroute.io>
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