From 669dbe11e1f408453dc574145feb8e86da3dfa06 Mon Sep 17 00:00:00 2001 From: ChendongSun Date: Fri, 1 Nov 2024 06:55:33 +0000 Subject: [PATCH] omit missing Created field from ImageInspect response Signed-off-by: ChendongSun --- ...-Created-field-from-ImageInspect-res.patch | 87 +++++++++++++++++++ moby.spec | 7 +- 2 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 0008-api-omit-missing-Created-field-from-ImageInspect-res.patch diff --git a/0008-api-omit-missing-Created-field-from-ImageInspect-res.patch b/0008-api-omit-missing-Created-field-from-ImageInspect-res.patch new file mode 100644 index 0000000..05551c2 --- /dev/null +++ b/0008-api-omit-missing-Created-field-from-ImageInspect-res.patch @@ -0,0 +1,87 @@ +From 5d9e13bc8453c856f055769008dac9311f43c265 Mon Sep 17 00:00:00 2001 +From: Bjorn Neergaard +Date: Mon, 26 Feb 2024 10:25:08 -0700 +Subject: [PATCH] api: omit missing Created field from ImageInspect response + +Signed-off-by: Bjorn Neergaard +--- + api/swagger.yaml | 8 ++++++-- + api/types/types.go | 5 ++++- + docs/api/v1.44.yaml | 8 ++++++-- + docs/api/version-history.md | 5 ++--- + 4 files changed, 18 insertions(+), 8 deletions(-) + +diff --git a/api/swagger.yaml b/api/swagger.yaml +index 5e448edad6..350d37a96c 100644 +--- a/api/swagger.yaml ++++ b/api/swagger.yaml +@@ -1742,9 +1742,13 @@ definitions: + Created: + description: | + Date and time at which the image was created, formatted in +- [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds, or empty if the field was not set in the image config. ++ [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. ++ ++ This information is only available if present in the image, ++ and omitted otherwise. + type: "string" +- x-nullable: false ++ format: "dateTime" ++ x-nullable: true + example: "2022-02-04T21:20:12.497794809Z" + Container: + description: | +diff --git a/api/types/types.go b/api/types/types.go +index 5c56a0cafe..56a8b77d45 100644 +--- a/api/types/types.go ++++ b/api/types/types.go +@@ -72,7 +72,10 @@ type ImageInspect struct { + + // Created is the date and time at which the image was created, formatted in + // RFC 3339 nano-seconds (time.RFC3339Nano). +- Created string ++ // ++ // This information is only available if present in the image, ++ // and omitted otherwise. ++ Created string `json:",omitempty"` + + // Container is the ID of the container that was used to create the image. + // +diff --git a/docs/api/v1.44.yaml b/docs/api/v1.44.yaml +index 5e448edad6..350d37a96c 100644 +--- a/docs/api/v1.44.yaml ++++ b/docs/api/v1.44.yaml +@@ -1742,9 +1742,13 @@ definitions: + Created: + description: | + Date and time at which the image was created, formatted in +- [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds, or empty if the field was not set in the image config. ++ [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. ++ ++ This information is only available if present in the image, ++ and omitted otherwise. + type: "string" +- x-nullable: false ++ format: "dateTime" ++ x-nullable: true + example: "2022-02-04T21:20:12.497794809Z" + Container: + description: | +diff --git a/docs/api/version-history.md b/docs/api/version-history.md +index fe04753249..b2d086e61e 100644 +--- a/docs/api/version-history.md ++++ b/docs/api/version-history.md +@@ -79,9 +79,8 @@ keywords: "API, Docker, rcli, REST, documentation" + `SecondaryIPv6Addresses` available in `NetworkSettings` when calling `GET /containers/{id}/json` are + deprecated and will be removed in a future release. You should instead look for the default network in + `NetworkSettings.Networks`. +-* `GET /images/{id}/json` now responds with an empty `Created` field +- (previously it was `0001-01-01T00:00:00Z`) if the `Created` field is missing +- from the image config. ++* `GET /images/{id}/json` omits the `Created` field (previously it was `0001-01-01T00:00:00Z`) ++ if the `Created` field is missing from the image config. + + ## v1.43 API changes + +-- +2.33.0 \ No newline at end of file diff --git a/moby.spec b/moby.spec index 7e8231c..f8767c9 100644 --- a/moby.spec +++ b/moby.spec @@ -7,7 +7,7 @@ Name: docker Version: 25.0.3 -Release: 14 +Release: 15 Summary: The open-source application container engine License: ASL 2.0 URL: https://www.docker.com @@ -27,6 +27,7 @@ Patch0004: 0004-fix-docker-swarm-run-failed-for-loongarch64.patch Patch0005: 0005-CVE-2024-41110.patch Patch0006: 0006-tini.c-a-function-declaration-without-a-prototype-is.patch Patch0007: 0007-fix-libnetwork-osl-test-TestAddRemoveInterface.patch +Patch0008: 0008-api-omit-missing-Created-field-from-ImageInspect-res.patch Requires: %{name}-engine = %{version}-%{release} Requires: %{name}-client = %{version}-%{release} @@ -97,6 +98,7 @@ Docker client binary and related utilities %patch 0004 -p1 %patch 0005 -p1 %patch 0007 -p1 +%patch 0008 -p1 %setup -q -T -n %{_source_docker_init} -b 2 %patch 0006 -p1 @@ -199,6 +201,9 @@ fi %systemd_postun_with_restart docker.service %changelog +* Fri Nov 1 2024 sunchendong - 25.0.3-15 +- DESC:omit missing Created field from ImageInspect response + * Thu Oct 31 2024 yaoguangzhong - 25.0.3-14 - DESC:backport upstream patch to fix libnetwork/osl test TestAddRemoveInterface -- Gitee