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

networkpolicy pkg: add new methods to multi network policy #792

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ajaggapa
Copy link
Contributor

No description provided.

Copy link
Contributor

@evgenLevin evgenLevin left a comment

Choose a reason for hiding this comment

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

lgtm

glog.V(100).Infof("Adding peer CIDR %s to Egress Rule", cidr)

if len(except) != 0 {
glog.V(100).Infof("Adding CIDR except %v to Egress Rule", except[0])
Copy link
Contributor

Choose a reason for hiding this comment

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

you can move it to the block:

	if len(except) > 0 {
		builder.definition.To[len(builder.definition.To)-1].IPBlock.Except = except[0]
	}

Copy link
Collaborator

@klaskosk klaskosk left a comment

Choose a reason for hiding this comment

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

some comments about validation, overall seems good

pkg/networkpolicy/multinetegressrule.go Outdated Show resolved Hide resolved
pkg/networkpolicy/multinetegressrule.go Show resolved Hide resolved
pkg/networkpolicy/multinetegressrule.go Outdated Show resolved Hide resolved
pkg/networkpolicy/multinetegressrule.go Show resolved Hide resolved
pkg/networkpolicy/multinetegressrule.go Outdated Show resolved Hide resolved
pkg/networkpolicy/multinetingressrule.go Outdated Show resolved Hide resolved
pkg/networkpolicy/multinetingressrule.go Show resolved Hide resolved
pkg/networkpolicy/multinetingressrule.go Outdated Show resolved Hide resolved
pkg/networkpolicy/multinetingressrule.go Outdated Show resolved Hide resolved
pkg/networkpolicy/multinetingressrule.go Show resolved Hide resolved
@ajaggapa
Copy link
Contributor Author

Thanks @klaskosk

Added validate before glog
Added validation for WithProtocol method

Please take a look

Copy link
Collaborator

@klaskosk klaskosk left a comment

Choose a reason for hiding this comment

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

thanks for adding in the validations, just a few more comments

pkg/networkpolicy/multinetegressrule.go Outdated Show resolved Hide resolved
pkg/networkpolicy/multinetegressrule.go Outdated Show resolved Hide resolved
pkg/networkpolicy/multinetegressrule_test.go Show resolved Hide resolved
pkg/networkpolicy/multinetingressrule.go Outdated Show resolved Hide resolved
pkg/networkpolicy/multinetingressrule_test.go Show resolved Hide resolved
Copy link
Collaborator

@klaskosk klaskosk left a comment

Choose a reason for hiding this comment

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

/lgtm

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.

3 participants