Introduced new CLI flag `-d`/`--values-directory`
for loading values from YAML files from a
specified directory. Following are the key
details:
- This will be used by the following commands:
1. `install`
2. `lint`
3. `package`
4. `template`
5. `upgrade`
Updated the help text of these commands with the
same.
- Made this flag the lowest in precedence i.e.,
values from values directory can be overridden
by inputs from any other input flags
(`-f`/`--values`, `--set-json`, `--set`,
`--set-string`, `--set-file`, `--set-literal`).
Note: The default values from the chart's
`values.yaml` file will have the lowest
precedence than all the input flags including
`-d`/`--values-directory` by design. In order
the values from `values.yaml` to override the
values from `-d`/`--values-directory`, users can
explicitly provide the chart's `values.yaml`
file path using the `-f`/`--values` flag.
- This flag reads all `.yaml` files from the
specified directory and its subdirectories
recursively, in lexicographical order. For eg.
for the following directory structure:
foo/
├── bar/
│ └── bar.yaml
├── baz/
│ ├── baz.yaml
│ └── qux.yaml
├── baz.txt
└── foo.yaml
The files will be read in the order:
`bar/bar.yaml`, `baz/baz.yaml`, `baz/qux.yaml`,
`foo.yaml`.
- If the specified directory does not exist, an
error is returned.
- Non-YAML files in the directory are ignored.
i.e., if the specified directory exists but
contains no YAML files, an empty map is returned
without errors.
- If multiple YAML files contain overlapping keys,
the values are overridden in lexicographical
order. For eg. in the above example, if both
`baz/baz.yaml` and `foo.yaml` contain a key
`replicaCount`, the value from `foo.yaml` will
take precedence as it is read last.
Fixes helm#10416
Signed-off-by: Bhargav Ravuri <bhargav.ravuri@infracloud.io>
This change is about handling the interfaces to public functions for
different chart apiVersions. The internals are still focused on v2.
This enables v3 to be layered in layer.
Signed-off-by: Matt Farina <matt.farina@suse.com>
A few things are added here:
1. The cache is made to be more generic as a content based cache.
It could be used for other things such as plugins
2. Flags were added to specify the content cache locaiton rather
than rely on the repository cache. Keeping the 2 the same
hid bugs and errors.
3. Tests were added and updated to ensure the cache is used and
tested
Signed-off-by: Matt Farina <matt.farina@suse.com>