Skip to content

Conversation

@vakalapa
Copy link
Contributor

@vakalapa vakalapa commented Feb 8, 2021

This PR includes below changes:

  1. Adding Caching ability for updated Pods to help relieve pressure on update events
  2. optimizing named ports code path for uniformity
  3. Removing generic PodMap and maintaining a NameSpace specific podmap
  4. ResourceVersions checks for Namespaces, Pods and Network Policies

@codecov
Copy link

codecov bot commented Feb 8, 2021

Codecov Report

Merging #780 (833552f) into master (6586840) will increase coverage by 4.36%.
The diff coverage is 65.31%.

@@            Coverage Diff             @@
##           master     #780      +/-   ##
==========================================
+ Coverage   37.88%   42.24%   +4.36%     
==========================================
  Files         142      143       +1     
  Lines       15741    14024    -1717     
==========================================
- Hits         5963     5925      -38     
+ Misses       9043     7385    -1658     
+ Partials      735      714      -21     

@vakalapa vakalapa added enhancement npm Related to NPM. labels Feb 22, 2021
@vakalapa vakalapa marked this pull request as ready for review February 22, 2021 20:37
@vakalapa
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).


IpsetUDPFlag string = "udp:"
IpsetSCTPFlag string = "sctp:"
IpsetTCPFlag string = "tcp:"
Copy link
Member

Choose a reason for hiding this comment

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

yeah how was this even missing :D

@neaggarwMS
Copy link
Member

if oldNsNs != newNsNs {

Shouldnt we check resourceVersion before this?


Refers to: npm/namespace.go:182 in 62af54d. [](commit_id = 62af54d, deletion_comment = False)

var err error
oldNsNs, oldNsLabel := "ns-"+oldNsObj.ObjectMeta.Name, oldNsObj.ObjectMeta.Labels
newNsNs, newNsLabel := "ns-"+newNsObj.ObjectMeta.Name, newNsObj.ObjectMeta.Labels
oldNsNs, oldNsLabel := util.GetNSNameWithPrefix(oldNsObj.ObjectMeta.Name), oldNsObj.ObjectMeta.Labels
Copy link
Member

Choose a reason for hiding this comment

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

We should pick the oldNSObj from cache

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As discussed, we will creating a new Work item for these changes

@neaggarwMS
Copy link
Member

  if err = npMgr.DeleteNamespace(oldNsObj); err != nil {

Similarly delete all what we have in cache


Refers to: npm/namespace.go:183 in 62af54d. [](commit_id = 62af54d, deletion_comment = False)

@neaggarwMS
Copy link
Member

if oldNsNs != newNsNs {

Is this check possible? I thought Resource Names are immutable


Refers to: npm/namespace.go:182 in 62af54d. [](commit_id = 62af54d, deletion_comment = False)

Copy link
Member

@neaggarwMS neaggarwMS left a comment

Choose a reason for hiding this comment

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

🕐

@neaggarwMS
Copy link
Member

}

Shouldnt this check be done after IsHostNetwork?


Refers to: npm/pod.go:192 in 62af54d. [](commit_id = 62af54d, deletion_comment = False)

@neaggarwMS neaggarwMS dismissed their stale review February 24, 2021 17:59

revoking review

Copy link
Member

@neaggarwMS neaggarwMS left a comment

Choose a reason for hiding this comment

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

🕐

if rv == "" {
return 0
}
rvInt, err := strconv.ParseUint(rv, 10, 64)
Copy link
Member

Choose a reason for hiding this comment

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

should potentially store resource version as uint if we're comparing every time, can take that in a later change

Copy link
Member

@neaggarwMS neaggarwMS left a comment

Choose a reason for hiding this comment

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

:shipit:

@vakalapa vakalapa merged commit b93e4cc into master Mar 2, 2021
@vakalapa vakalapa deleted the vakr/podcache branch March 2, 2021 03:43
vakalapa pushed a commit that referenced this pull request Mar 2, 2021
neaggarwMS pushed a commit that referenced this pull request Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement npm Related to NPM.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants