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

Use K8s version with .GitVersion

Open zvlb opened this issue 3 years ago • 11 comments

Hello. Everywhere in Kubernetes used GitVersion for demonstrated K8s version. (For example kubectl get nodes returned exactly GitVersion of kubernetes)

It's important for me, bc i use ArgoCD for all Kubernetes Clusters and i want see Major.Minor.Patch version of kubernetes. But now i see only Major.Minor version.

zvlb avatar Jul 12 '22 13:07 zvlb

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

sonarqubecloud[bot] avatar Jul 12 '22 13:07 sonarqubecloud[bot]

Codecov Report

Merging #429 (0fcaf87) into master (ed31317) will increase coverage by 1.12%. The diff coverage is 69.23%.

@@            Coverage Diff             @@
##           master     #429      +/-   ##
==========================================
+ Coverage   54.37%   55.49%   +1.12%     
==========================================
  Files          41       41              
  Lines        3110     4485    +1375     
==========================================
+ Hits         1691     2489     +798     
- Misses       1252     1805     +553     
- Partials      167      191      +24     
Impacted Files Coverage Δ
pkg/utils/kube/ctl.go 7.17% <0.00%> (+0.46%) :arrow_up:
pkg/cache/cluster.go 55.34% <100.00%> (+0.98%) :arrow_up:
pkg/cache/settings.go 45.67% <100.00%> (+5.20%) :arrow_up:
pkg/diff/diff_options.go 52.94% <0.00%> (-30.40%) :arrow_down:
pkg/health/health.go 55.42% <0.00%> (-5.15%) :arrow_down:
pkg/sync/common/types.go 54.16% <0.00%> (-4.66%) :arrow_down:
pkg/utils/kube/convert.go 60.00% <0.00%> (-3.64%) :arrow_down:
pkg/diff/diff.go 60.75% <0.00%> (-2.86%) :arrow_down:
pkg/sync/sync_tasks.go 90.62% <0.00%> (-1.44%) :arrow_down:
pkg/health/health_argo.go 57.14% <0.00%> (-1.20%) :arrow_down:
... and 34 more

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 Jul 12 '22 13:07 codecov[bot]

If this method used in many project, or need backward compatibility, i can add new method like GetFullServerVersion and don't change GetServerVersion

zvlb avatar Jul 14 '22 06:07 zvlb

@alexmt @jannfis @jessesuen Guys?

zvlb avatar Sep 01 '22 12:09 zvlb

Hey, sorry @vzemtsov for coming back so late to this PR!

I would suggest making this parameterizeable, e.g. add a new boolean field fullServerVersion here: https://github.com/argoproj/gitops-engine/blob/517c1fff4e2d5c70f0af05a98b43ead92742fba5/pkg/cache/cluster.go#L167

Then add an option to toggle it in https://github.com/argoproj/gitops-engine/blob/master/pkg/cache/settings.go

Then, modify https://github.com/argoproj/gitops-engine/blob/517c1fff4e2d5c70f0af05a98b43ead92742fba5/pkg/utils/kube/ctl.go#L299 to return the *version.Info instead of a string and finally modify https://github.com/argoproj/gitops-engine/blob/517c1fff4e2d5c70f0af05a98b43ead92742fba5/pkg/cache/cluster.go#L283 to return the value appropriate to the state of the fullServerVersion toggle.

This would give people an option and is backwards compatible in the API.

WDYT?

jannfis avatar Sep 01 '22 18:09 jannfis

I add changes what you say. It's looks good, but ArgoCD for get Kubernetes Version use only this function

Can you tag this changes? I want add changes to ArgoCD, to make work correctly

zvlb avatar Sep 03 '22 08:09 zvlb

Oh. Need some time for testing. I'm back later

zvlb avatar Sep 03 '22 08:09 zvlb

@jannfis Do you can check?

zvlb avatar Sep 03 '22 08:09 zvlb

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

sonarqubecloud[bot] avatar Sep 03 '22 11:09 sonarqubecloud[bot]

@jannfis Hi. Can we finish this?

zvlb avatar Sep 22 '22 11:09 zvlb

anyone?

zvlb avatar Mar 04 '23 19:03 zvlb