Skip to content

Commit b25af60

Browse files
committed
argocd_application: fix NPE during resource import
1 parent 0d84db7 commit b25af60

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

argocd/structure_application.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -351,15 +351,17 @@ func flattenApplicationSpec(s application.ApplicationSpec) (
351351
"destination": flattenApplicationDestinations(
352352
[]application.ApplicationDestination{s.Destination},
353353
),
354-
"ignore_difference": flattenApplicationIgnoreDifferences(s.IgnoreDifferences),
355-
"info": flattenApplicationInfo(s.Info),
356-
"project": s.Project,
357-
"revision_history_limit": *s.RevisionHistoryLimit,
354+
"ignore_difference": flattenApplicationIgnoreDifferences(s.IgnoreDifferences),
355+
"info": flattenApplicationInfo(s.Info),
356+
"project": s.Project,
358357
"source": flattenApplicationSource(
359358
[]application.ApplicationSource{s.Source},
360359
),
361360
"sync_policy": flattenApplicationSyncPolicy(s.SyncPolicy),
362361
}
362+
if s.RevisionHistoryLimit != nil {
363+
spec["revision_history_limit"] = int(*s.RevisionHistoryLimit)
364+
}
363365
return []map[string]interface{}{spec}, nil
364366
}
365367

0 commit comments

Comments
 (0)