The --api-versions flag was undocumented in the template command's
help text. This adds usage documentation and examples showing both
comma-separated and multiple flag usage patterns.
Fixes#13198
Signed-off-by: majiayu000 <1835304752@qq.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: majiayu000 <1835304752@qq.com>
When running `helm upgrade --install` on a non-existent release, the
--server-side flag was not being passed to the install action. This
caused the install to always use server-side apply (the default),
ignoring --server-side=false.
Copy ServerSideApply and ForceConflicts from the upgrade client to the
install client when falling back to install.
Fixes#31627
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
The rangeint suggestion is faster.
The maps.Copy and slices.Contains are just syntatic sugar.
Signed-off-by: Mads Jensen <atombrella@users.noreply.github.com>
The kube client logging is based on the actionConfig logging. This
is setup to use slog.Default() before the logging flags are parsed
and logging is setup.
newRootCmdWithConfig changes the logging but it wasn't picked up
for actionConfig or the kube client. This change updates the logging
to include any changes.
Signed-off-by: Matt Farina <matt.farina@suse.com>
This ensures that when `helm uninstall` is run with `--keep-history`
any release in a `deployed` state other than the last release (e.g.
due to a failed upgrade) is being marked as `superseded`.
As a by-effect, running `helm upgrade` on a release which has been
uninstalled after an upgrade failure now no longer works. But instead
fails with a `"<name>" has no deployed releases` error. Which is the
(likely) intended behavior, and prevents other side-effects like
rolling back to a release version which happened before the uninstall
if `--atomic` (or `--rollback-on-failure`) was provided.
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
Added a new flag `--notes` to the `helm template`
command, with the default set to `false`.
If enabled, it will print the rendered `NOTES.txt`
at the end of the manifests.
If `--render-subchart-notes` (this flag already
exists on the `template` command, as it is
inherited from the `install` command) is also
enabled, the output will include the subcharts'
notes as well.
Updated the `install` command's
`--render-subchart-notes` flag description to
clarify that, in the case of the `template`
command, it is only valid when the `--notes` flag
is enabled.
Note: the `template` command uses most of the
`install` command's flags, including
`--render-subchart-notes`.
Updated `action.renderResources()` to format the
root chart's notes, and the subcharts' notes if
the `--render-subchart-notes` flag is enabled, and
return them as a string. The output depends on
whether it is:
- **Dry run**
- Notes are prefixed with the source filename
and separated with `---`.
- For `helm install` / `helm upgrade`, the
`--dry-run` flag enables this behavior.
- The `helm template` command is considered a
dry run by default.
- Example:
```
foo NOTES HERE
bar NOTES HERE
baz NOTES HERE
qux NOTES HERE
```
- **Not a dry run**
- Only the root chart's notes are rendered by
default.
- If the `--render-subchart-notes` flag is
enabled, the subcharts' notes are also
included.
- Each note is prefixed with the source filename
and separated with `---`.
- Example:
```
---
# Source: foo/templates/NOTES.txt
foo NOTES HERE
---
# Source: foo/charts/bar/templates/NOTES.txt
bar NOTES HERE
---
# Source: foo/charts/baz/templates/NOTES.txt
baz NOTES HERE
---
# Source: foo/charts/bar/charts/qux/templates/NOTES.txt
qux NOTES HERE
```
In both cases, the notes are sorted based on the
following conditions:
1. Depth
2. Alphabetical order (since the notes file name
is always the same, the sorting applies to the
chart/subchart name).
Added tests for the following scenarios:
- helm template:
1. On the chart without notes or subcharts
2. `--notes` on chart without notes or
subcharts
3. `--render-subchart-notes` on chart without
notes or subcharts
4. `--notes --render-subchart-notes` on chart
without notes or subcharts
5. On the chart with notes without subcharts
6. `--notes` on chart with notes without
subcharts
7. `--render-subchart-notes` on chart with
notes without subcharts
8. `--notes --render-subchart-notes` on chart
with notes without subcharts
9. On the chart with notes and subchart
10. `--notes` on chart with notes and subchart
11. `--render-subchart-notes` on the chart with
notes and subchart
12. `--notes --render-subchart-notes` on chart
with notes and subchart
13. `--help`
- helm install:
1. On the chart without notes or subcharts
2. `--dry-run` on chart without notes or
subcharts
3. `--render-subchart-notes` on chart without
notes or subcharts
4. `--dry-run --render-subchart-notes` on chart
without notes or subcharts
5. On the chart with notes without subcharts
6. `--dry-run` on chart with notes without
subcharts
7. `--render-subchart-notes` on chart with
notes without subcharts
8. `--dry-run --render-subchart-notes` on chart
with notes without subcharts
9. On a chart with notes and subcharts
10. `--dry-run` on chart with notes and
subcharts
11. `--render-subchart-notes` on chart with
notes and subcharts
12. `--dry-run --render-subchart-notes` on
chart with notes and subcharts
13. `--help`
- helm upgrade:
1. On the chart without notes or subcharts
2. `--dry-run` on chart without notes or
subcharts
3. `--render-subchart-notes` on chart without
notes or subcharts
4. `--dry-run --render-subchart-notes` on chart
without notes or subcharts
5. On the chart with notes without subcharts
6. `--dry-run` on chart with notes without
subcharts
7. `--render-subchart-notes` on chart with
notes without subcharts
8. `--dry-run --render-subchart-notes` on chart
with notes without subcharts
9. On the chart with notes and subcharts
10. `--dry-run` on chart with notes and
subcharts
11. `--render-subchart-notes` on chart with
notes and subcharts
12. `--dry-run --render-subchart-notes` on
chart with notes and subcharts
13. `--help`
Closes#6901
Signed-off-by: Bhargav Ravuri <bhargav.ravuri@infracloud.io>
This adds a --no-headers flag to the 'helm repo list' command,
allowing users to suppress table headers in the output.
Useful for scripting and automation.
Signed-off-by: Paul Van Laer <paul.van.laer1@gmail.com>
Building the same chart into an archive multiple times will have
the same sha256 hash.
Perviously, the time in the headers for a file was time.Now() which
changed each time. The time is now collected from the operating
system when the file is loaded and this time is used.
Fixes: #3612
Signed-off-by: Matt Farina <matt.farina@suse.com>