From b25af60f055ecab59490b21607b10faac18114c8 Mon Sep 17 00:00:00 2001 From: Olivier Boukili Date: Thu, 16 Jul 2020 14:04:37 +0200 Subject: [PATCH] argocd_application: fix NPE during resource import --- argocd/structure_application.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/argocd/structure_application.go b/argocd/structure_application.go index 6077c42c..125f0a0f 100644 --- a/argocd/structure_application.go +++ b/argocd/structure_application.go @@ -351,15 +351,17 @@ func flattenApplicationSpec(s application.ApplicationSpec) ( "destination": flattenApplicationDestinations( []application.ApplicationDestination{s.Destination}, ), - "ignore_difference": flattenApplicationIgnoreDifferences(s.IgnoreDifferences), - "info": flattenApplicationInfo(s.Info), - "project": s.Project, - "revision_history_limit": *s.RevisionHistoryLimit, + "ignore_difference": flattenApplicationIgnoreDifferences(s.IgnoreDifferences), + "info": flattenApplicationInfo(s.Info), + "project": s.Project, "source": flattenApplicationSource( []application.ApplicationSource{s.Source}, ), "sync_policy": flattenApplicationSyncPolicy(s.SyncPolicy), } + if s.RevisionHistoryLimit != nil { + spec["revision_history_limit"] = int(*s.RevisionHistoryLimit) + } return []map[string]interface{}{spec}, nil }