api/types/system: move SecurityOpt and DecodeSecurityOptions to client mod#50825
Conversation
We should probably have a look at some of this; for the CLI, it looks like it's purely for presenting (no good answers here, just thinking out loud) |
+1, I wasn't sure about this one. So tried something out thinking others would give feedback for a better idea. From https://github.com/docker/buildx/blob/177b9809583d03ea4af637c170716c739f7e4762/driver/docker-container/driver.go#L198, it looks like buildx uses it to detect if a container needs to be created with host userns mode. |
|
@thaJeztah , some options that come to mind after some thought. Thoughts?
|
b205c49 to
4379e51
Compare
DecodeSecurityOptions to pkgDecodeSecurityOptions to client mod
8584c5c to
421990b
Compare
… to client This change moves the `system.SecurityOpt` type and `system.DecodeSecurityOptions` function to the client and adds a set of unit tests to capture current implementation. This change also create a set of daemon backend copies for usage. Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
421990b to
e2e9f36
Compare
DecodeSecurityOptions to client modSecurityOpt and DecodeSecurityOptions to client mod
|
Offline discussion with @thaJeztah and @corhere on this. The thought is to move the functionality into the client (and therefore also a copy into the backend) separating the shape of the data from the semantics of how it is used. As follow-up work, it would be nice to make secopts in the API return as unmarshalled type but that should be looked at seperately. |
|
Thanks! Overall, this LGTM; one quick comment before we continue;
The only thing I'm considering is if we want to use the existing @austinvazquez @corhere any thoughts? Perhaps it's fine to do "from scratch"; the current type isn't overly creative, so perhaps that's the best option, but just in case 😅 |
thaJeztah
left a comment
There was a problem hiding this comment.
actually; let me already LGTM
(good to merge, pending the comment above)
I think it's fine to merge as is and reconsider what we want to do with |
|
Thanks @akerouanton OK; let's bring this in 👍 |
Yep, aligned with this. |
- What I did
Partial of #50740
This change moves the
system.SecurityOptandsystem.KeyValuetypes into the client along with the reference implementation ofsystem.DecodeSecurityOptionsinto thepkg/securitypackage. This functionality is used by Docker clients like CLI and buildx along with the daemon backend for API 1.24 support of security options in system info responses.- How I did it
- How to verify it
- Human readable description for the release notes
- A picture of a cute animal (not mandatory but encouraged)