fix validate options

Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
yxxhero
2025-11-09 12:10:51 +08:00
parent c506caa33f
commit a38b07bd4a
8 changed files with 19 additions and 15 deletions
+6 -2
View File
@@ -576,7 +576,7 @@ func (st *HelmState) ApplyOverrides(spec *ReleaseSpec) {
}
type RepoUpdater interface {
IsHelm3() bool
IsOverHelm3() bool
AddRepo(name, repository, cafile, certfile, keyfile, username, password string, managed string, passCredentials, skipTLSVerify bool) error
UpdateRepo() error
RegistryLogin(name, username, password, caFile, certFile, keyFile string, skipTLSVerify bool) error
@@ -1640,7 +1640,11 @@ func (st *HelmState) TemplateReleases(helm helmexec.Interface, outputDir string,
}
if validate {
flags = append(flags, "--validate")
if helm.IsVersionAtLeast("4.0.0") {
flags = append(flags, "--dry-run=server")
} else {
flags = append(flags, "--validate")
}
}
if opts.IncludeCRDs {