Skip to content

Commit

Permalink
Don't push state if there is no state to push (#327)
Browse files Browse the repository at this point in the history
This might happen when all the resources failed to import with "--continue".
  • Loading branch information
magodo authored Jan 5, 2023
1 parent 21bfeba commit 9323d4f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/meta/base_meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,11 @@ func (meta *baseMeta) ParallelImport(items []*ImportItem) {
func (meta baseMeta) PushState() error {
ctx := context.TODO()

// Don't push state if there is no state to push. This might happen when all the resources failed to import with "--continue".
if len(meta.baseState) == 0 {
return nil
}

// Ensure there is no out of band change on the base state
baseState, err := meta.tf.StatePull(ctx)
if err != nil {
Expand Down

0 comments on commit 9323d4f

Please sign in to comment.