Skip to content

Commit

Permalink
Fix missing data source id in update (#5115)
Browse files Browse the repository at this point in the history
This commit fixes a bug where the data source ID was not returned
when updating it via the service.

Signed-off-by: Adolfo García Veytia (Puerco) <puerco@stacklok.com>
  • Loading branch information
puerco authored Dec 3, 2024
1 parent 5dfc7d0 commit 943c999
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/datasources/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,10 @@ func (d *dataSourceService) Update(
return nil, fmt.Errorf("failed to commit transaction: %w", err)
}

if ds.Id == "" {
ds.Id = existing.ID.String()
}

return ds, nil
}

Expand Down

0 comments on commit 943c999

Please sign in to comment.