Introduce release/v2 that mirrors pkg/release/v1 but uses *v3.Chart
from internal/chart/v3. The code is structurally identical to v1 with
only import paths changed to reference internal/chart/v3 instead of
pkg/chart/v2.
- Add internal/release/v2 with Release, Info, Hook types
- Add internal/release/v2/util with filter, sorter, manifest utilities
- Update pkg/release/common.go with v2Accessor and v2HookAccessor
- Copy all test files from pkg/release/v1 and add a v2 test in common_test.go
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
When multiple processes try to download the same chart version
concurrently (e.g., via Terraform), they can race to write the
destination file. On Windows, this results in 'Access Denied'
errors because the file cannot be renamed while another process
has a handle to the destination.
This commit introduces 'PlatformAtomicWriteFile' to the fileutil
package. On Unix-like systems, it simply delegates to AtomicWriteFile,
maintaining existing behavior. On Windows, it coordinates writes using
a lock file (.lock). It acquires the lock, then performs the atomic
write.
Crucially, this implementation ensures that existing files are
overwritten (rather than skipped). This ensures that if a chart is
republished with the same version, the local cache is correctly updated,
preventing stale data issues.
Fixes#31633
Signed-off-by: Orgad Shaneh <orgad.shaneh@audiocodes.com>
* feat(create): add hidden --chart-api-version flag
Add --chart-api-version flag to helm create command to allow selecting
chart API version (v2 or v3) when creating a new chart.
- Default is v2 (existing behavior unchanged)
- v3 uses internal/chart/v3 scaffold generator
- Invalid versions return clear error message
- Works with --starter flag
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
* Add HELM_EXPERIMENTAL_CHART_V3 feature gate to create command
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
* make chartv3 private and use loader to load the chart
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
* Hide chart-api-version flag until chart v3 is officially released
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
* Conditionally hide the --chart-api-version flag if chart v3 is not enabled
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
* Add internal gates package for internal feature gates
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
* Add doc for internal/gates package
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
---------
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
Improve the description to explain the three usage scenarios:
- --wait alone defaults to 'watcher' strategy
- --wait=<value> uses the specified strategy
- flag omitted defaults to 'hookOnly'
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
Signed-off-by: Manuel Alonso Gonzalez <434575+manute@users.noreply.github.com>
Signed-off-by: Manuel Alonso Gonzalez <m.alonso@Manuels-MacBook-Pro.local>