Skip to content

Conversation

@huntergregory
Copy link
Contributor

The following updates with UTs:

  • Adds ACL rule metrics to v2
    • for windows: add the number of ingress and egress rules
    • for Linux: same but add 1 if any ACLs are ingress and 1 if any are egress (for the jumps to the policy ingress/egress chains)
  • Moves v2 metric updates in ResetIPSets() from OS to the generic ipsetmanager (and also clears all caches in this function)
  • in v1 and v2, moves ipset/acl rule exec times to be the exact time of the OS call (and no other code before/after)
  • Updates a tiny flaw in ipsm.go if there were a flush success and destroy failure while resetting ipsets

@huntergregory huntergregory added the npm Related to NPM. label Feb 4, 2022
return "nil NPMNetworkPolicy"
}
itemStrings := make([]string, 0, len(netPol.ACLs))
for _, item := range netPol.ACLs {
Copy link
Member

Choose a reason for hiding this comment

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

I get that we already had this but not sure how I feel about using string, overriding the String() method can lead to lost or misinterpreted information since it's rarely pointed to during an investigation

for example if we add a new property to NPMNetwork and try to print write to stdout, the dev would need to make sure to update this method to write the new property, string() can be a lot of maintenance

Copy link
Collaborator

Choose a reason for hiding this comment

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

agree, implementing String() does feel a little Java to me 🙂

Copy link
Contributor

Choose a reason for hiding this comment

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

Discussed this internally and team decided to change this func to PrettyPrint() and will be tackled in a separate PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

resolved in #1235

@huntergregory huntergregory merged commit 1ea2f5a into master Feb 10, 2022
@huntergregory huntergregory deleted the npm-current-prom-metrics branch February 10, 2022 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

npm Related to NPM.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants