gitops-engine icon indicating copy to clipboard operation
gitops-engine copied to clipboard

fix: cache gvk responses when checking sync task permissions

Open crenshaw-dev opened this issue 1 year ago • 4 comments

It's likely that syncs contain multiple tasks with the same gvk. This will make sure we only hit the k8s API once per gvk per sync operation.

crenshaw-dev avatar Aug 18 '22 13:08 crenshaw-dev

Codecov Report

Merging #448 (061ac32) into master (a56a803) will decrease coverage by 0.01%. The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master     #448      +/-   ##
==========================================
- Coverage   55.27%   55.26%   -0.02%     
==========================================
  Files          41       41              
  Lines        4452     4453       +1     
==========================================
  Hits         2461     2461              
- Misses       1802     1803       +1     
  Partials      189      189              
Impacted Files Coverage Δ
pkg/sync/sync_context.go 72.11% <0.00%> (-0.09%) :arrow_down:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov[bot] avatar Aug 18 '22 14:08 codecov[bot]

As part of this change, should we remove caching introduced here: https://github.com/argoproj/gitops-engine/pull/449/files#diff-74e77a4722803a7d3f87b956ec81b82d3c5a0dd50de299922aa2208fec57e6e9R693-R720

jessesuen avatar Aug 19 '22 19:08 jessesuen

@jessesuen we should. I'll do that when https://github.com/argoproj/gitops-engine/pull/452 is merged

crenshaw-dev avatar Aug 19 '22 19:08 crenshaw-dev

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarcloud[bot] avatar Aug 19 '22 19:08 sonarcloud[bot]