feat(helm): add helmfile support

This commit is contained in:
Jeffrey Labonski 2024-05-21 17:56:21 -04:00 committed by Jan De Dobbeleer
parent 9058a9778e
commit 11606ead7a
3 changed files with 18 additions and 2 deletions

View file

@ -19,7 +19,7 @@ func (h *Helm) Enabled() bool {
}
inChart := false
files := []string{"Chart.yml", "Chart.yaml"}
files := []string{"Chart.yml", "Chart.yaml", "helmfile.yaml", "helmfile.yml"}
for _, file := range files {
if _, err := h.env.HasParentFilePath(file); err == nil {
inChart = true

View file

@ -57,6 +57,22 @@ func TestHelmSegment(t *testing.T) {
DisplayMode: "files",
ChartFile: "Chart.yaml",
},
{
Case: "DisplayMode always inside chart. Chart file helmfile.yaml",
HelmExists: true,
ExpectedEnabled: true,
ExpectedString: "Helm 3.12.3",
DisplayMode: "files",
ChartFile: "helmfile.yaml",
},
{
Case: "DisplayMode always inside chart. Chart file helmfile.yml",
HelmExists: true,
ExpectedEnabled: true,
ExpectedString: "Helm 3.12.3",
DisplayMode: "files",
ChartFile: "helmfile.yml",
},
{
Case: "DisplayMode always outside chart",
HelmExists: true,

View file

@ -25,7 +25,7 @@ import Config from '@site/src/components/Config.js';
| Name | Type | Default | Description |
| -------------- | :------: | :------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `display_mode` | `string` | `always` | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is only displayed when a `Chart.yaml` (or `Chart.yml`) file is present </li></ul> |
| `display_mode` | `string` | `always` | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is only displayed when a chart source file `Chart.yaml` (or `Chart.yml`) or helmfile `helmfile.yaml` (or `helmfile.yml`) is present </li></ul> |
## Template ([info][templates])