Skip to content
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

invoke: if Result CNIVersion is empty use netconf CNIVersion #896

Merged

Conversation

dcbw
Copy link
Member

@dcbw dcbw commented May 11, 2022

The CNI Spec requires plugins to return a CNIVersion in the Result
that is the same as the CNIVersion of the incoming CNI config.

Empty CNIVersions are specified to map to 0.1.0 (since the first
CNI spec didn't have versioning) and libcni handles that automatically.

Unfortunately some versions of Weave don't do that and depend on
a libcni <= 0.8 quirk that used the netconf version if the result
version was empty. This is technically a libcni regression, though
the plugin itself is violating the specification.

Thus for backwards compatibility assume that if the Result
CNIVersion is empty, the netconf CNIVersion should be used as
the Result version.

Fixes: #895

@dcbw dcbw force-pushed the empty-result-version-regression branch from 6d9b35e to 40fb57b Compare May 11, 2022 16:30
@coveralls
Copy link

coveralls commented May 11, 2022

Coverage Status

Coverage decreased (-0.05%) to 72.269% when pulling 55fe94e on dcbw:empty-result-version-regression into 940e662 on containernetworking:main.

@dcbw dcbw changed the title invoke: if Result CNIVersion is empty use netconf CNIVersion [wip] invoke: if Result CNIVersion is empty use netconf CNIVersion May 11, 2022
@dcbw
Copy link
Member Author

dcbw commented May 11, 2022

This needs testcases still...

@dcbw dcbw force-pushed the empty-result-version-regression branch from 40fb57b to 605e654 Compare May 18, 2022 16:19
@dcbw dcbw changed the title [wip] invoke: if Result CNIVersion is empty use netconf CNIVersion invoke: if Result CNIVersion is empty use netconf CNIVersion May 18, 2022
@dcbw dcbw force-pushed the empty-result-version-regression branch from 605e654 to 5670150 Compare May 18, 2022 16:19
@dcbw
Copy link
Member Author

dcbw commented May 18, 2022

Now with testcases (which exposed a bug, which I then fixed).

@dcbw dcbw force-pushed the empty-result-version-regression branch 2 times, most recently from 3b1a18a to d6ee597 Compare May 18, 2022 16:27
Copy link

@fuweid fuweid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM(nb)

Thanks!

@fuweid
Copy link

fuweid commented May 24, 2022

ping @squeed @MikeZappa87 ~

@MikeZappa87
Copy link
Contributor

@dcbw I won’t be able to join the meeting today. What is the work remaining for this? Lmk if you need help, I’m sure someone on the containerd might be able to help to get this to completion :-)

The CNI Spec requires plugins to return a CNIVersion in the Result
that is the same as the CNIVersion of the incoming CNI config.

Empty CNIVersions are specified to map to 0.1.0 (since the first
CNI spec didn't have versioning) and libcni handles that automatically.

Unfortunately some versions of Weave don't do that and depend on
a libcni <= 0.8 quirk that used the netconf version if the result
version was empty. This is technically a libcni regression, though
the plugin itself is violating the specification.

Thus for backwards compatibility assume that if the Result
CNIVersion is empty, the netconf CNIVersion should be used as
the Result version.

Fixes: containernetworking#895

Signed-off-by: Dan Williams <[email protected]>
@dcbw dcbw force-pushed the empty-result-version-regression branch from d6ee597 to 55fe94e Compare May 25, 2022 15:58
@squeed
Copy link
Member

squeed commented May 25, 2022

lgtm, feel free to merge on green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

converting plugin result to wrong config version results in regression
6 participants