fix: nil issue

Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
yxxhero 2025-04-09 08:28:30 +08:00
parent 286a99cd10
commit f7838ba4a5
1 changed files with 5 additions and 1 deletions

View File

@ -2974,7 +2974,11 @@ func (st *HelmState) flagsForDiff(helm helmexec.Interface, release *ReleaseSpec,
flags = st.appendSuppressOutputLineRegexFlags(flags, release, suppressOutputLineRegex)
}
if opt.TakeOwnership || st.HelmDefaults.TakeOwnership || release.TakeOwnership {
takeOwnership := false
if opt != nil {
takeOwnership = opt.TakeOwnership
}
if takeOwnership || st.HelmDefaults.TakeOwnership || release.TakeOwnership {
diffVersion, err := helmexec.GetPluginVersion("diff", settings.PluginsDirectory)
if err != nil {
return nil, nil, err