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 {
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 != "" {

Loading…
Cancel
Save