Skip to content

Commit

Permalink
Fix docker hub images if they have no timestamp (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcollom authored Nov 2, 2023
1 parent ef0eb18 commit 973ae80
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pkg/client/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,12 @@ func (c *Client) Tags(ctx context.Context, _, repo, image string) ([]api.ImageTa
continue
}

timestamp, err := time.Parse(time.RFC3339Nano, result.Timestamp)
if err != nil {
return nil, fmt.Errorf("failed to parse image timestamp: %s", err)
var timestamp time.Time
if len(result.Timestamp) > 0 {
timestamp, err = time.Parse(time.RFC3339Nano, result.Timestamp)
if err != nil {
return nil, fmt.Errorf("failed to parse image timestamp: %s", err)
}
}

for _, image := range result.Images {
Expand Down

0 comments on commit 973ae80

Please sign in to comment.