From 68a89d3cd4f3d1d78518ea08e0a4ae5d25de3865 Mon Sep 17 00:00:00 2001 From: Somtochi Onyekwere Date: Tue, 21 Sep 2021 14:37:20 +0100 Subject: [PATCH] Check for nil pointer before setting createNamespace in helmrelease Signed-off-by: Somtochi Onyekwere --- cmd/flux/create_helmrelease.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/flux/create_helmrelease.go b/cmd/flux/create_helmrelease.go index 4695ed1c..6a035858 100644 --- a/cmd/flux/create_helmrelease.go +++ b/cmd/flux/create_helmrelease.go @@ -187,9 +187,11 @@ func createHelmReleaseCmdRun(cmd *cobra.Command, args []string) error { } if helmReleaseArgs.createNamespace { - helmRelease.Spec.Install = &helmv2.Install{ - CreateNamespace: helmReleaseArgs.createNamespace, + if helmRelease.Spec.Install == nil { + helmRelease.Spec.Install = &helmv2.Install{} } + + helmRelease.Spec.Install.CreateNamespace = helmReleaseArgs.createNamespace } if helmReleaseArgs.saName != "" {