Check for nil pointer before setting createNamespace in helmrelease

Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
pull/1846/head
Somtochi Onyekwere 3 years ago
parent 64f39e160b
commit 68a89d3cd4

@ -187,9 +187,11 @@ func createHelmReleaseCmdRun(cmd *cobra.Command, args []string) error {
} }
if helmReleaseArgs.createNamespace { if helmReleaseArgs.createNamespace {
helmRelease.Spec.Install = &helmv2.Install{ if helmRelease.Spec.Install == nil {
CreateNamespace: helmReleaseArgs.createNamespace, helmRelease.Spec.Install = &helmv2.Install{}
} }
helmRelease.Spec.Install.CreateNamespace = helmReleaseArgs.createNamespace
} }
if helmReleaseArgs.saName != "" { if helmReleaseArgs.saName != "" {

Loading…
Cancel
Save