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

Support passing multiple ips via pod network annotation #204

Conversation

AlonaKaplan
Copy link
Contributor

This PR is a follow-up to #195
The PR changes the code to accept array of strings (and not a single string) for the "ips" on the pod network annotation, as the de-facto standard specifies.

The ips will be passed to the relevant cni plugin over CNI_ARGS with the following format - "IP=10.0.0.1,2001:db8::5"

@coveralls
Copy link

coveralls commented Dec 2, 2018

Pull Request Test Coverage Report for Build 576

  • 10 of 15 (66.67%) changed or added relevant lines in 2 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.04%) to 52.898%

Changes Missing Coverage Covered Lines Changed/Added Lines %
types/conf.go 0 1 0.0%
multus/multus.go 10 14 71.43%
Files with Coverage Reduction New Missed Lines %
multus/multus.go 1 54.61%
Totals Coverage Status
Change from base Build 569: 0.04%
Covered Lines: 648
Relevant Lines: 1225

💛 - Coveralls

Copy link
Contributor

@SchSeba SchSeba 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!

just a few comments

types/types.go Outdated Show resolved Hide resolved
multus/multus.go Outdated Show resolved Hide resolved
if err != nil {
return nil, logging.Errorf("failed to parse CIDR %q", ipRequest)
}
} else if net.ParseIP(ipRequest) == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please do something like this

if ! strings.Contains(ipRequest, "/") {
ipRequest += "/32"
}

_, _, err := net.ParseCIDR(ipRequest)
if err != nil {
	return nil, logging.Errorf("failed to parse CIDR %q", ipRequest)
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

According to Dan's comment #195 (comment) , there is a use case for an ip with no prefix.

Copy link
Member

Choose a reason for hiding this comment

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

@SchSeba yeah, some plugins (host-local) already have the prefix in other configuration info, so they don't require it in the IPRequest (because it would be redundant for them). We also need to update the NPWG spec to clarify behavior around the prefix.

So for now I think we need to keep the prefix optional in Multus, but a given sub-plugin could fail if it doesn't get one.

Copy link
Member

Choose a reason for hiding this comment

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

@dcbw Is this behaviour is clarified in the spec regarding the prefix ?

var ips string
for _, ipRequest := range delegate.IPsRequest {
// validate IP address
if strings.Contains(ipRequest, "/") {
Copy link
Contributor

Choose a reason for hiding this comment

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

see next comment

multus/multus.go Outdated Show resolved Hide resolved
Copy link
Contributor

@SchSeba SchSeba left a comment

Choose a reason for hiding this comment

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

LGTM!

@AlonaKaplan
Copy link
Contributor Author

@dcbw @s1061123 can you please review?

types/types.go Outdated Show resolved Hide resolved
types/types.go Outdated Show resolved Hide resolved
@dcbw
Copy link
Member

dcbw commented Dec 6, 2018

In general LGTM, just a few small comments.

@AlonaKaplan
Copy link
Contributor Author

@dcbw can you please re-review?

@SchSeba
Copy link
Contributor

SchSeba commented Jan 9, 2019

Hi @dcbw I think this PR is ready to be merge there is anything that is missing?

@SchSeba
Copy link
Contributor

SchSeba commented Feb 6, 2019

Hi @dcbw can we merge this PR?

@SchSeba
Copy link
Contributor

SchSeba commented Feb 17, 2019

Hi @s1061123 can you please review this PR and tell me if there is anything else that I need to add for this PR to be merge?

@SchSeba
Copy link
Contributor

SchSeba commented Feb 26, 2019

@s1061123 , @dcbw can we merge this PR?

@rkamudhan
Copy link
Member

@dcbw @s1061123 Can we merged this PR, LGTM ..

@s1061123 s1061123 force-pushed the master branch 2 times, most recently from 1b0b39d to c319f6b Compare March 22, 2019 03:14
@dougbtv
Copy link
Member

dougbtv commented Apr 30, 2020

We believe that recent improvements have added similar functionality.

@dougbtv dougbtv closed this Apr 30, 2020
dougbtv pushed a commit to dougbtv/multus-cni that referenced this pull request Sep 13, 2024
…nsistency-openshift-4.16-multus-cni

OCPBUGS-24863: Updating multus-cni-container image to be consistent with ART
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.

6 participants