docs: api: use separate definition for Image.Config (api v1.39 - v1.45)#47942
Merged
thaJeztah merged 2 commits intomoby:masterfrom Jun 10, 2024
Merged
docs: api: use separate definition for Image.Config (api v1.39 - v1.45)#47942thaJeztah merged 2 commits intomoby:masterfrom
thaJeztah merged 2 commits intomoby:masterfrom
Conversation
1 task
7fcaddd to
052cc3d
Compare
vvoland
approved these changes
Jun 10, 2024
dvdksn
reviewed
Jun 10, 2024
Member
Author
The Image.Config field currently reuses the ContainerConfig definition, matching the Go implementation, which also uses that type. However, the ContainerConfig type contains various fields that are not part of the image config, and would never be set. The Image.Config is used as template / default values for containers started from the image, but will only use the fields that are part of the [Docker image spec]. This patch updates the swagger files used in the documentation to use a separate `ImageConfig` definition for the Image.Config field. The new definition is a copy of the existing `ContainerConfig` type, but with updated descriptions for fields, and with an example response that omits the fields that should not be used. The following fields are currently included in the `Config` field of the API response, but are not part of the underlying image's config: - `Hostname` - `Domainname` - `AttachStdin` - `AttachStdout` - `AttachStderr` - `Tty` - `OpenStdin` - `StdinOnce` - `Image` - `NetworkDisabled` (already omitted unless set) - `MacAddress` (already omitted unless set) - `StopTimeout` (already omitted unless set) [Docker image spec]: https://github.com/moby/docker-image-spec/blob/v1.3.1/specs-go/v1/image.go#L19-L32 Signed-off-by: Sebastiaan van Stijn <[email protected]>
The Image.Config field currently reuses the ContainerConfig definition, matching the Go implementation, which also uses that type. However, the ContainerConfig type contains various fields that are not part of the image config, and would never be set. The Image.Config is used as template / default values for containers started from the image, but will only use the fields that are part of the [Docker image spec]. This patch updates the swagger files used in the documentation to use a separate `ImageConfig` definition for the Image.Config field. The new definition is a copy of the existing `ContainerConfig` type, but with updated descriptions for fields, and with an example response that omits the fields that should not be used. The following fields are currently included in the `Config` field of the API response, but are not part of the underlying image's config: - `Hostname` - `Domainname` - `AttachStdin` - `AttachStdout` - `AttachStderr` - `Tty` - `OpenStdin` - `StdinOnce` - `Image` - `NetworkDisabled` (already omitted unless set) - `MacAddress` (already omitted unless set) - `StopTimeout` (already omitted unless set) [Docker image spec]: https://github.com/moby/docker-image-spec/blob/v1.3.1/specs-go/v1/image.go#L19-L32 Signed-off-by: Sebastiaan van Stijn <[email protected]>
052cc3d to
58641c7
Compare
Member
Author
|
@dvdksn updated; applied your suggestions, but I kept the |
dvdksn
approved these changes
Jun 10, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



GET /images/{name}/jsonresponse #47941The Image.Config field currently reuses the ContainerConfig definition, matching the Go implementation, which also uses that type.
However, the ContainerConfig type contains various fields that are not part of the image config, and would never be set. The Image.Config is used as template / default values for containers started from the image, but will only use the fields that are part of the Docker image spec.
This patch updates the swagger files used in the documentation to use a separate
ImageConfigdefinition for the Image.Config field. The new definition is a copy of the existingContainerConfigtype, but with updated descriptions for fields, and with an example response that omits the fields that should not be used.The following fields are currently included in the
Configfield of the API response, but are not part of the underlying image's config:HostnameDomainnameAttachStdinAttachStdoutAttachStderrTtyOpenStdinStdinOnceImageNetworkDisabled(already omitted unless set)MacAddress(already omitted unless set)StopTimeout(already omitted unless set)- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)