-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add support for BaselineAdminNetworkPolicy. #9464
Conversation
526d489
to
568c1c2
Compare
- Top level struct types are different but the "leaf" structs are the same in most cases. - Extract the "leaf" structs at the top level and then share the remaining logic.
9d94a19
to
4b2f1b1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I just left a few nits.
rules := []apiv3.Rule{} | ||
func unpackANPPorts(k8sPorts *[]adminpolicy.AdminNetworkPolicyPort) (map[string][]numorstring.Port, []string, error) { | ||
// If there are no ports, represent that as zero struct. | ||
ports := []adminpolicy.AdminNetworkPolicyPort{{}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably forgot to replace this section with the new unpackANPPorts
function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the new function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clearly I left this comment in a wrong place. I meant this change: #9568
/merge-when-ready squash-commits |
OK, I will merge the pull request when it's ready, squash the commits when I merge it, and leave the branch after I've merged it. |
* Initial pass at BaselineAdminNetworkPolicy. * Fix policy name prefixes. * Combine ANP and BANP conversion logic. - Top level struct types are different but the "leaf" structs are the same in most cases. - Extract the "leaf" structs at the top level and then share the remaining logic. * Fix felix syncer test. * Ignore pprofs in gitignore. * Add tests for BANP conversion. * Markups.
* Initial pass at BaselineAdminNetworkPolicy. * Fix policy name prefixes. * Combine ANP and BANP conversion logic. - Top level struct types are different but the "leaf" structs are the same in most cases. - Extract the "leaf" structs at the top level and then share the remaining logic. * Fix felix syncer test. * Ignore pprofs in gitignore. * Add tests for BANP conversion. * Markups.
Description
Add support for sig-network-policy-api's BaselineAdminNetworkPolicy.
Related issues/PRs
CORE-10800
Builds on ANP work:
Tier support: #9085
Default action in tiers: #9232
AdminNetworkPolicy: #9206
AdminNetworkPolicy egress networks: #9276
AdminNetworkPolicy named port: #9254
Operator: tigera/operator#3634
BANP validation: #9633
Todos
Release Note
Reminder for the reviewer
Make sure that this PR has the correct labels and milestone set.
Every PR needs one
docs-*
label.docs-pr-required
: This change requires a change to the documentation that has not been completed yet.docs-completed
: This change has all necessary documentation completed.docs-not-required
: This change has no user-facing impact and requires no docs.Every PR needs one
release-note-*
label.release-note-required
: This PR has user-facing changes. Most PRs should have this label.release-note-not-required
: This PR has no user-facing changes.Other optional labels:
cherry-pick-candidate
: This PR should be cherry-picked to an earlier release. For bug fixes only.needs-operator-pr
: This PR is related to install and requires a corresponding change to the operator.