Skip to content

Commit

Permalink
Merge pull request quay#127 from josephschorr/joseph.schorr/QUAY-2111…
Browse files Browse the repository at this point in the history
…/created-datetime

The `created` key in V2_2 config is optional, so make sure to treat it as such
  • Loading branch information
josephschorr committed Jan 5, 2020
2 parents a467d80 + eeb8148 commit d8bd445
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion image/docker/schema2/config.py
Expand Up @@ -233,7 +233,8 @@ def has_empty_layer(self):
def history(self):
""" Returns the history of the image, started at the base layer. """
for history_entry in self._parsed[DOCKER_SCHEMA2_CONFIG_HISTORY_KEY]:
created_datetime = parse_date(history_entry[DOCKER_SCHEMA2_CONFIG_CREATED_KEY])
created_datetime_str = history_entry.get(DOCKER_SCHEMA2_CONFIG_CREATED_KEY)
created_datetime = parse_date(created_datetime_str) if created_datetime_str else None
yield LayerHistory(
created_datetime=created_datetime,
created=history_entry.get(DOCKER_SCHEMA2_CONFIG_CREATED_KEY),
Expand Down

0 comments on commit d8bd445

Please sign in to comment.