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

fix: improve migration from label to annotation tracking #7899

Merged
merged 1 commit into from Dec 11, 2021

Conversation

alexmt
Copy link
Collaborator

@alexmt alexmt commented Dec 9, 2021

Signed-off-by: Alexander Matyushentsev AMatyushentsev@gmail.com

PR resolves two issues related to migration from label to annotation tracking method:

  • changing the annotation method should automatically invalidate manifests cache
  • first sync operation, after switching to annotation method, should drop old label: the resource tracking Normalize method should not touch "target" resource since it is re-used during the syncing process.

Copy link
Contributor

@mayzhang2000 mayzhang2000 left a comment

Choose a reason for hiding this comment

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

Reviewed code, looking good. Please fix the compile issue in repository_test.go.

err = argokube.SetAppInstanceLabel(config, labelKey, label)
if err != nil {
return err
labels := live.GetLabels()
Copy link
Member

Choose a reason for hiding this comment

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

I think it will be better move this part to argokube module

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

@pasha-codefresh
Copy link
Member

Thank you for helping solve an issue with the tracking method. I just added a minor comment.

@alexmt alexmt force-pushed the tracking-method-migration branch 2 times, most recently from 745f9f2 to bb82e43 Compare December 10, 2021 21:58
@alexmt
Copy link
Collaborator Author

alexmt commented Dec 10, 2021

Thank you for review @mayzhang2000 and @pasha-codefresh ! PTAL

Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
Copy link
Contributor

@mayzhang2000 mayzhang2000 left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov
Copy link

codecov bot commented Dec 10, 2021

Codecov Report

Merging #7899 (b9dda1c) into master (bea379b) will increase coverage by 0.02%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7899      +/-   ##
==========================================
+ Coverage   41.44%   41.47%   +0.02%     
==========================================
  Files         169      169              
  Lines       22310    22328      +18     
==========================================
+ Hits         9247     9260      +13     
- Misses      11741    11744       +3     
- Partials     1322     1324       +2     
Impacted Files Coverage Δ
util/webhook/webhook.go 61.57% <14.28%> (-0.79%) ⬇️
util/kube/kube.go 71.87% <71.42%> (-0.06%) ⬇️
reposerver/cache/cache.go 64.28% <75.00%> (-0.98%) ⬇️
reposerver/repository/repository.go 58.40% <100.00%> (ø)
util/argo/resource_tracking.go 71.42% <100.00%> (+1.80%) ⬆️
util/settings/settings.go 47.60% <0.00%> (ø)
server/cluster/cluster.go 24.87% <0.00%> (+2.36%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bea379b...b9dda1c. Read the comment docs.

@alexmt alexmt merged commit 6d8ff61 into argoproj:master Dec 11, 2021
alexmt pushed a commit that referenced this pull request Dec 11, 2021
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
@alexmt alexmt deleted the tracking-method-migration branch December 11, 2021 19:43
@alexmt alexmt restored the tracking-method-migration branch December 13, 2021 03:34
@alexmt alexmt deleted the tracking-method-migration branch December 15, 2021 03:04
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.

None yet

3 participants