Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

Add Kubernetes version details #594

Merged
merged 15 commits into from
Oct 13, 2020
Merged

Add Kubernetes version details #594

merged 15 commits into from
Oct 13, 2020

Conversation

axbarsan
Copy link
Contributor

@axbarsan axbarsan commented Oct 5, 2020

Towards https://github.com/giantswarm/giantswarm/issues/13439

This PR adds support for displaying if the Kubernetes version is EOL or will be EOL soon in various commands. This data comes from the GS API /v4/info/ response.

The common functionality is handled in all commands by a helper structure called ReleaseInfo. This fetches all the releases from the GS API and is able to compute the different K8s version properties for each given release version.

Preview

list releases command

image

show release (EOL k8s release)

image

show release (soon to be EOL k8s release)

image

show cluster (EOL k8s release)

image

show cluster (soon to be EOL k8s release)

image

@axbarsan axbarsan self-assigned this Oct 5, 2020
@coveralls
Copy link

coveralls commented Oct 6, 2020

Coverage Status

Coverage decreased (-0.1%) to 51.358% when pulling a65c72c on add-k8s-version-info into 4970574 on master.

@axbarsan axbarsan marked this pull request as ready for review October 8, 2020 10:13
@axbarsan axbarsan requested a review from a team October 8, 2020 10:13
Copy link
Contributor

@pipo02mix pipo02mix left a comment

Choose a reason for hiding this comment

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

nice work

Comment on lines +117 to +134
clientWrapper, err := client.NewWithConfig(arguments.apiEndpoint, arguments.userProvidedToken)
if err != nil {
handleError(microerror.Mask(err))
os.Exit(1)
}

releases, err := listReleases(clientWrapper, arguments)
if err != nil {
client.HandleErrors(err)
errors.HandleCommonErrors(err)
handleError(microerror.Mask(err))
os.Exit(1)
}

if clientErr, ok := err.(*clienterror.APIError); ok {
fmt.Println(color.RedString(clientErr.ErrorMessage))
if clientErr.ErrorDetails != "" {
fmt.Println(clientErr.ErrorDetails)
}
} else {
fmt.Println(color.RedString("Error: %s", err.Error()))
}
releaseInfoConfig := releaseinfo.Config{
ClientWrapper: clientWrapper,
}
releaseInfo, err := releaseinfo.New(releaseInfoConfig)
if err != nil {
handleError(microerror.Mask(err))
Copy link
Member

Choose a reason for hiding this comment

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

Should all this happen inside the printResult function?

Copy link
Member

@marians marians left a comment

Choose a reason for hiding this comment

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

I'm not in the way here. Thanks!

@axbarsan axbarsan merged commit 88c55b8 into master Oct 13, 2020
@axbarsan axbarsan deleted the add-k8s-version-info branch October 13, 2020 12:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants