Skip to content

Conversation

yeya24
Copy link
Contributor

@yeya24 yeya24 commented Oct 22, 2021

Signed-off-by: Ben Ye ben.ye@bytedance.com

This mostly copy-paste the getClusterSecret method and uses it in GetCluster. This reduces the unnecessary unmarshalling for the last secretToCluster call.

Also when getting the cluster by dest server address, no need to marshal the secret to cluster and we can just compare the server address directly.

Note on DCO:

If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • Optional. My organization is added to USERS.md.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).

@yeya24 yeya24 changed the title Reduce one unnecessary unmarshalling when get cluster feat: Reduce one unnecessary unmarshalling when get cluster Oct 22, 2021
@yeya24 yeya24 force-pushed the add-getclusterFromSecret branch from 90e01bc to 2a96732 Compare October 22, 2021 22:17
@codecov
Copy link

codecov bot commented Oct 22, 2021

Codecov Report

Merging #7530 (f8187d4) into master (b8510f3) will increase coverage by 0.01%.
The diff coverage is 81.81%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7530      +/-   ##
==========================================
+ Coverage   41.38%   41.39%   +0.01%     
==========================================
  Files         161      161              
  Lines       21618    21626       +8     
==========================================
+ Hits         8947     8953       +6     
- Misses      11408    11409       +1     
- Partials     1263     1264       +1     
Impacted Files Coverage Δ
util/db/cluster.go 64.58% <81.81%> (+0.45%) ⬆️
util/settings/settings.go 46.77% <0.00%> (ø)

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 b8510f3...f8187d4. Read the comment docs.

@yeya24 yeya24 force-pushed the add-getclusterFromSecret branch from 2a96732 to f48b2b0 Compare October 23, 2021 00:09
@yeya24 yeya24 changed the title feat: Reduce one unnecessary unmarshalling when get cluster feat: Reduce unnecessary unmarshalling when fetching cluster from secrets Oct 23, 2021
…unmarshalling

Signed-off-by: Ben Ye <ben.ye@bytedance.com>
@yeya24 yeya24 force-pushed the add-getclusterFromSecret branch from f48b2b0 to f8187d4 Compare October 23, 2021 02:55
Copy link
Collaborator

@alexmt alexmt left a comment

Choose a reason for hiding this comment

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

LGTM

@alexmt alexmt merged commit 5f4ecf1 into argoproj:master Oct 28, 2021
@yeya24 yeya24 deleted the add-getclusterFromSecret branch October 29, 2021 00:42
behoof4mind pushed a commit to iits-consulting/argo-cd that referenced this pull request Oct 29, 2021
…unmarshalling (argoproj#7530)

Signed-off-by: Ben Ye <ben.ye@bytedance.com>
Signed-off-by: Denis Lavrushko <denis.lavrushko@iits-consulting.de>
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.

2 participants