Skip to content

Commit

Permalink
Overwrite errors with nil on success
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyhb committed Sep 19, 2024
1 parent 47c7ff5 commit bf1797e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/replicator/pgreplicator/pgsetup/pgsetup.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ func (s *setup) Setup(ctx context.Context) (TestConnResult, error) {
return s.res, err
}
}

return s.res, nil
}

Expand Down Expand Up @@ -197,6 +198,7 @@ func (s *setup) createUser(ctx context.Context) error {
s.res.UserCreated.Error = fmt.Errorf("Error creating user '%s': %w", pgconsts.Username, err)
return s.res.UserCreated.Error
}
s.res.UserCreated.Error = nil
return nil
}

Expand All @@ -218,6 +220,7 @@ func (s *setup) createRoles(ctx context.Context) error {
return s.res.RolesGranted.Error
}
s.res.RolesGranted.Complete = true
s.res.RolesGranted.Error = nil
return nil
}

Expand All @@ -235,6 +238,7 @@ func (s *setup) checkReplicationSlot(ctx context.Context) error {
}

s.res.SlotCreated.Complete = true
s.res.SlotCreated.Error = nil
return nil
}

Expand All @@ -253,6 +257,7 @@ func (s *setup) createReplicationSlot(ctx context.Context) error {
return s.res.SlotCreated.Error
}
s.res.SlotCreated.Complete = true
s.res.SlotCreated.Error = nil
return nil
}

Expand All @@ -270,6 +275,7 @@ func (s *setup) checkPublication(ctx context.Context) error {
}

s.res.PublicationCreated.Complete = true
s.res.PublicationCreated.Error = nil
return nil
}

Expand All @@ -285,5 +291,6 @@ func (s *setup) createPublication(ctx context.Context) error {
return s.res.PublicationCreated.Error
}
s.res.PublicationCreated.Complete = true
s.res.PublicationCreated.Error = nil
return nil
}

0 comments on commit bf1797e

Please sign in to comment.