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

Return correct CNI version string #106

Merged
merged 1 commit into from
Jan 11, 2025

Conversation

sondavidb
Copy link
Contributor

Issue #, if available:
Related to #98

Description of changes:

Prior to this commit, we were using the output of a result to return a CNI version. This would always be the latest supported version returned by the CNI library. This meant that, regardless of the CNI version used in a user's conflist, it would always report back that the latest version was being used, which is both incorrect behavior and breaks workflows where the latest version was not recognized as a valid version.

This change fixes this behavior and returns the same CNI version specified in the conflist, which mirrors the behavior of other CNI plugins (e.g. ptp, bridge)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@sondavidb sondavidb requested a review from a team as a code owner January 10, 2025 23:04
@@ -216,7 +216,7 @@ func TestGetCurrentResult(t *testing.T) {
StdinData: rawPrevResultBytes,
}

actualResult, err := getCurrentResult(cmdArgs)
actualResult, _, err := getCurrentResult(cmdArgs)
Copy link
Contributor

Choose a reason for hiding this comment

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

We can validate here the the returned result matches the cni version in the conf.

Prior to this commit, we were using the output of a result to return a
CNI version. This would always be the latest supported version returned
by the CNI library. This meant that, regardless of the CNI version used
in a user's conflist, it would always report back that the latest
version was being used, which is both incorrect behavior and breaks
workflows where the latest version was not recognized as a valid
version.

This change fixes this behavior and returns the same CNI version
specified in the conflist, which mirrors the behavior of other CNI
plugins.

Signed-off-by: David Son <[email protected]>
@sondavidb sondavidb force-pushed the report-correct-version branch from 1827bc2 to 5f807a8 Compare January 10, 2025 23:26
@sondavidb sondavidb merged commit fb2c2b5 into awslabs:master Jan 11, 2025
4 checks passed
@sondavidb sondavidb deleted the report-correct-version branch January 11, 2025 00:02
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.

2 participants