Skip to content

Conversation

wrdls
Copy link

@wrdls wrdls commented Sep 28, 2021

AWS EKS clusters report their Kubernetes minor version as "19+".

Fixes #5

AWS EKS clusters report their Kubernetes minor version as "19+".
@pghildiyal pghildiyal merged commit c7ac1e3 into devtron-labs:main Sep 28, 2021
@@ -64,7 +65,7 @@ func (c *Cluster) ServerVersion() (string, error) {
if err != nil {
return "", err
}
return fmt.Sprintf("%s.%s", info.Major, info.Minor), nil
return fmt.Sprintf("%s.%s", info.Major, strings.Trim(info.Minor, "+")), nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we use regex (\d+)([^\d]*) instead? this will make it agnostic to any other trailing characters also.

Copy link
Author

@wrdls wrdls Sep 29, 2021

Choose a reason for hiding this comment

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

What about parsing from info.GitVersion instead as I suggested in #5 (comment)?

Seems like it will be more stable.

I don't have a GKE cluster to test on but they seem to be following a similar format: https://cloud.google.com/kubernetes-engine/versioning#versioning_scheme

So something like this:

gitVersion := strings.Split(info.GitVersion, ".")
major := strings.Trim(gitVersion[0], "v")
minor := gitVersion[1]
return fmt.Sprintf("%s.%s", major, minor), nil

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, gitVersion appears to be better indicator, lets use this instead

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.

failed to unmarshal extension properties: invalid character ':' after top-level value (404: Not Found)
2 participants