Skip to content

Commit

Permalink
Added new feature
Browse files Browse the repository at this point in the history
Added a notification to the kubernetes cmd if the cluster version is old
Update the civogo lib to v0.2.9
  • Loading branch information
alejandrojnm committed Jun 19, 2020
1 parent 83fe22c commit f172675
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ dist/
.local.yml
temporal*
.DS*
get.sh
get.sh
.chglog
15 changes: 14 additions & 1 deletion cmd/kubernetes_show.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,14 @@ If you wish to use a custom format, the available fields are:
ow.AppendData("Nodes", strconv.Itoa(kubernetesCluster.NumTargetNode))
ow.AppendData("Size", kubernetesCluster.TargetNodeSize)
ow.AppendData("Status", kubernetesCluster.Status)
ow.AppendDataWithLabel("KubernetesVersion", kubernetesCluster.KubernetesVersion, "Version")

if kubernetesCluster.UpgradeAvailableTo != "" {
ow.AppendDataWithLabel("KubernetesVersion", utility.Red(kubernetesCluster.KubernetesVersion+" *"), "Version")
} else {
ow.AppendDataWithLabel("KubernetesVersion", kubernetesCluster.KubernetesVersion, "Version")
}

ow.AppendDataWithLabel("UpgradeAvailableTo", kubernetesCluster.UpgradeAvailableTo, "Upgrade")
ow.AppendDataWithLabel("APIEndPoint", kubernetesCluster.APIEndPoint, "API Endpoint")
ow.AppendDataWithLabel("DNSEntry", kubernetesCluster.DNSEntry, "DNS A record")

Expand All @@ -63,6 +70,12 @@ If you wish to use a custom format, the available fields are:
} else {
ow.WriteKeyValues()

if kubernetesCluster.UpgradeAvailableTo != "" {
fmt.Println()
fmt.Printf(utility.Red("* An upgrade to v%s is available. To upgrade use: civo k3s upgrade %s --version %s"), kubernetesCluster.UpgradeAvailableTo, kubernetesCluster.Name, kubernetesCluster.UpgradeAvailableTo)
fmt.Println()
}

if len(kubernetesCluster.Instances) > 0 {
fmt.Println()
ow.WriteHeader("Nodes")
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module github.com/civo/cli

require (
github.com/briandowns/spinner v1.9.0
github.com/civo/civogo v0.2.8
github.com/civo/civogo v0.2.9
github.com/fatih/color v1.9.0
github.com/google/go-github v17.0.0+incompatible // indirect
github.com/google/go-querystring v1.0.0 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ github.com/briandowns/spinner v1.9.0/go.mod h1://Zf9tMcxfRUA36V23M6YGEAv+kECGfvp
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/civo/civogo v0.2.8 h1:eKh1UchZagznUc5WibnzMrVfjXG2db8TqFqWUnGruvI=
github.com/civo/civogo v0.2.8/go.mod h1:SR0ZOhABfQHjgNQE3UyfX4gaYsrfslkPFRFMx5P29rg=
github.com/civo/civogo v0.2.9 h1:1BNp/SS8WZnxY6nUkZpbY4zeaOE393TCZ0PKKIq5fxQ=
github.com/civo/civogo v0.2.9/go.mod h1:SR0ZOhABfQHjgNQE3UyfX4gaYsrfslkPFRFMx5P29rg=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
Expand Down

0 comments on commit f172675

Please sign in to comment.