-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Introduces Address type to be used in secondary IPv4 and IPv6 inspect data structure #12174
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
Introduces Address type to be used in secondary IPv4 and IPv6 inspect data structure #12174
Conversation
|
@fgimenez How do you create such a container? |
|
I think we might want to fix this only for the compat API and not regular inspect, @mheon WDYT? |
I'm finding this issue on CI doing something similar to: Will try to find a simpler example |
|
Tend to agree with @Luap99 that this should be compat API only - this looks like a breaking change to me, and while we are in a breaking-change mode for 4.0, I don't see a good reason we should change inspect now, instead of just fixing the Docker-compat endpoint. |
|
podman/pkg/api/handlers/compat/containers.go Lines 350 to 357 in c0351a7
This is where the error happens. We cannot use json.marshal/unmarshal because the types do not match apparently so you would need to manually assign the value to the new struct. |
e3398fd to
4457a62
Compare
|
@fgimenez Tests are failing. |
4457a62 to
41b8892
Compare
@rhatdan thanks for the heads up! ok that error should be fixed now, I see now this test failing https://github.com/containers/podman/pull/12174/checks?check_run_id=4149334267 not sure if it is related to the changes in the PR? |
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 think you also have to set the PrefixLen field in this struct, although I am not sure how we could get this value here if we do not change the type in libpod inspect as well.
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.
Indeed, I assumed that the strings in the current SecondaryIPv6Addresses's []string in libpod inspect represent actual addresses, not CIDRs, so the default value of PrefixLen of 0 should be ok, is this correct?
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.
If the strings in libpod's inspect output can contain CIDRs then maybe we could try to parse them, split by / if present or something like that, 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.
Indeed, I assumed that the strings in the current SecondaryIPv6Addresses's
[]stringin libpod inspect represent actual addresses, not CIDRs, so the default value of PrefixLen of 0 should be ok, is this correct?
Sorry, this was wrong, if SecondaryIPv6Addresses's []string in libpod inspect represent actual addresses then PrefixLen should be 64, not 0 (32 for IPv4). I've pushed changes to fix it, PTAL.
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 think this is not correct. You should have the actual ip/prefix for this container, hard coding it to 64 or 32 is wrong.
TBH looking at this I think your original patch works better. We are on 4.0 so breaking changes are possible. I do not think there many users of the secondary ip field anyway.
@mheon 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.
Changing the secondary IP field in podman inspect itself?
You're probably right that there are almost no users. I'm not strongly opposed to making a breaking change here.
41b8892 to
bb147e5
Compare
|
Changes LGTM |
bb147e5 to
32e89d3
Compare
|
@fgimenez Needs a small test for inspect. :) or you could test CI via adding |
78a3200 to
ed7e46b
Compare
ed7e46b to
a3e9dee
Compare
|
@containers/podman-maintainers Could there be any issues with CI I think some unrelated tests are failing. |
|
#12343 will fix CI once it merges, after that this will need to be rebased |
a3e9dee to
c910cbe
Compare
cool thx, I see it is already merged, rebased this one |
|
@fgimenez Could you squash your commits into one please, otherwise LGTM. |
…data structure. Resolves a discrepancy between the types used in inspect for docker and podman. This causes a panic when using the docker client against podman when the secondary IP fields in the `NetworkSettings` inspect field are populated. Fixes containers#12165 Signed-off-by: Federico Gimenez <[email protected]>
c910cbe to
2e5d3e8
Compare
sure, done |
Luap99
left a comment
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.
LGTM
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fgimenez, Luap99 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/lgtm |
|
/hold cancel |
What this PR does / why we need it:
Fixes discrepancy between the types used in inspect for docker and podman. This causes a panic when using the docker client against podman when the secondary IP fields in the
NetworkSettingsinspect field are populated.How to verify it
SecondaryIPV6Addresspopulated in inspect'sNetworkSettingsWhich issue(s) this PR fixes:
Fixes #12165
Signed-off-by: Federico Gimenez [email protected]