From 973ae80aca3351e98262c76f79e89366146fa99b Mon Sep 17 00:00:00 2001 From: David Collom Date: Thu, 2 Nov 2023 17:29:46 +0000 Subject: [PATCH] Fix docker hub images if they have no timestamp (#130) --- pkg/client/docker/docker.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkg/client/docker/docker.go b/pkg/client/docker/docker.go index 2563e5b4..27b2dbb6 100644 --- a/pkg/client/docker/docker.go +++ b/pkg/client/docker/docker.go @@ -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 {