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

Controller: Set CNI args on the delegate request #156

Merged
merged 1 commit into from
Sep 14, 2023

Conversation

LionelJouin
Copy link
Collaborator

What this PR does / why we need it:
The CNI args has to be set in the delegate request so the cni-args in the network attachment annotation are considered.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer (optional):

Copy link
Collaborator

@maiqueb maiqueb left a comment

Choose a reason for hiding this comment

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

Looks good, but can you add a unit test ?

@LionelJouin
Copy link
Collaborator Author

I just added a unit test

Copy link
Collaborator

@maiqueb maiqueb left a comment

Choose a reason for hiding this comment

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

You need to address the linting issues.

Code wise, looks good. I can provide some nits if you're interested, but I would go for a merge once this passes CI.

Thanks for the contribution.

pkg/controller/pod_test.go Outdated Show resolved Hide resolved
.github/workflows/check.yaml Show resolved Hide resolved
pkg/controller/pod.go Outdated Show resolved Hide resolved
Comment on lines 299 to 300
ifaceStatus(namespace, networkName, "net0", ""),
ifaceStatus(namespace, networkToAdd, "net1", macAddr)))
Copy link
Collaborator

Choose a reason for hiding this comment

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

given the linter's complaints, I would just define a const within the ifaceStatus func, and rename it to ifaceStatusForDefaultNamespace.

... not the most elegant solution but it would unlock your PR.

I would refactor the tests afterwards to address that.

The CNI args has to be set in the delegate request so the cni-args in
the network attachment annotation are considered.

Signed-off-by: Lionel Jouin <[email protected]>
Copy link
Collaborator

@maiqueb maiqueb left a comment

Choose a reason for hiding this comment

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

Thank you for this contribution.

@LionelJouin
Copy link
Collaborator Author

Thank you for the quick review and help!

@maiqueb maiqueb merged commit 0c9ee89 into k8snetworkplumbingwg:main Sep 14, 2023
2 checks passed
@maiqueb
Copy link
Collaborator

maiqueb commented Sep 14, 2023

Do you need a new release with this patch ?
@LionelJouin

@LionelJouin
Copy link
Collaborator Author

Not really, after #158 it would be nice yes, I might also update dependencies and the golang version if it's ok with you.

@maiqueb
Copy link
Collaborator

maiqueb commented Sep 14, 2023

Not really, after #158 it would be nice yes, I might also update dependencies and the golang version if it's ok with you.

Let's leave that out for now, since we have dependabot doing it for us.

... I've just not done a good job lately at paying attention to it.

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.

None yet

2 participants