-
Notifications
You must be signed in to change notification settings - Fork 18.9k
Remove job from container_inspect #12406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
api/client/logs.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll move this struct outside the function if it's ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably okay here.
|
Look okay, but tests failing and need rebase. |
|
Sure I didn't finished because I was not sure about the approach with local struct |
b7996e2 to
cbb5e60
Compare
cbb5e60 to
00db6e6
Compare
|
The code looks good. We can probably live with those structs in the code, but we can also move them later if they start to bother us. Waiting for the new test in integration-cli before giving my 👍 |
|
@calavera yup I don't really like them but wanted not to couple daemon code with api |
api/client/attach.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the best solution for now, but maybe the refactoring problem comes from the fact that runconfig is a mess too. So maybe we could add a little TODO with a question like: Should we reconsider having a type in api/types with a refactored runconfig?
@LK4D4 wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for the other structs below in other files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't put the struct in types because runconfig depends on opts that depends on api again to validate host, I have a pull request "fixing" this but the support to the old raw struct still remains and I can't put it in types because it depends on daemon (and daemon has dependency on api/types) (hope you understand what I wrote lol)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, comment won't hurt.
00db6e6 to
372b374
Compare
372b374 to
da59ff9
Compare
da59ff9 to
836d3ef
Compare
|
@LK4D4 @tiborvass @calavera TODO comments added, I noticed test case I was going to move to integration-cli is already covered in https://github.com/docker/docker/blob/master/integration-cli/docker_api_inspect_test.go#L10 (what's tested is about < 1.12 json response format) so everything should be good now |
|
LGTM |
836d3ef to
9790909
Compare
daemon/inspect.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So would it make sense to move these info api/types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can't as of now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as we discussion via irc - we can if we just have the stuff that appears on the wire in the api/type struct.
|
@runcom how about adding a comment in runconfig to make sure the structs in api/client get updated if ever runconfig were to get updated? Not a perfect solution, but at least it will force us to refactor runconfig too at some point. PS: I can't help to think: runcomfig :P |
9790909 to
2459f98
Compare
|
rebase madness after @LK4D4 merge lol |
2459f98 to
d87ce7f
Compare
api/types/types.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LK4D4 @crosbymichael is this what we want?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks okay for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As long as it matches what is sent on the wire. As I mentioned in irc though, I'd want the full json represented, not just the bits the CLI uses.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok with that @duglin, working on it even if I don't like it because it's far better thinking about refactoring runconfig/opts so it can be included in api/types instead of rewriting each field in that really big struct, I don't really think it makes sense to do similar struct again..
@tiborvass Also this way there will be many new struct of those in api/types.. like ContainerConfigEntrypoint, ContainerNetworkSettings , ContainerConfigCommand and many more (me don't like)
We already have these structs elsewhere..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure anymore :( Ping @crosbymichael
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
me neither, I'm waiting before finishing then, @tiborvass can't we just merge with those structs for now and move on to main runconfig refactor to fit in api/types? wdyt? also @duglin @LK4D4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want us to decide which way to go or else we'll forget about it and start building cruft again :(
d87ce7f to
3b51092
Compare
3b51092 to
cd326da
Compare
cd326da to
a45bbf7
Compare
a45bbf7 to
4a9ea95
Compare
4a9ea95 to
95672e9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤘
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
95672e9 to
4b9fe9c
Compare
|
Looks nice |
|
LGTM |
Remove job from container_inspect
/cc @LK4D4 @cpuguy83 @duglin @icecrime
I'm opening this to get suggestions to finalize this work. Basically I'd like suggestions about
ContainerJSONstruct indaemonIt can't be put into
api/typesbecause it depends onrunconfigwhich in turn depends onapiClients that could use this struct are for instance
api/client/logsand I wouldn't importdaemoncode here so I just created a type struct to extract the info I needed from the json response, is this that bad? Basically I like the idea to non couple client/server/daemon and just extract infos needed with a custom struct just to have a type to decode into (yes you have to maintain two things then but clients always adjust in response to server/api changes isn't it?).Tests will probably fail because this isn't yet finished. but logs tests run ok with this modifications! I'll fix everything later.
Signed-off-by: Antonio Murdaca me@runcom.ninja