Skip to content

Commit

Permalink
fixing how upgrade shoulw work (#894)
Browse files Browse the repository at this point in the history
Signed-off-by: jasmingacic <jasmin.gacic@gmail.com>

Signed-off-by: jasmingacic <jasmin.gacic@gmail.com>
  • Loading branch information
jasmingacic authored Oct 20, 2022
1 parent 8218919 commit 98056af
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmd/kusk/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const (
kusknamespace = "kusk-system"
kuskgatewayapi = "kusk-gateway-api"
kuskgatewaydashboard = "kusk-gateway-dashboard"
kuskgatewaymanager = "kusk-gateway-manager"
)

// rootCmd represents the base command when called without any subcommands
Expand Down
13 changes: 12 additions & 1 deletion cmd/kusk/cmd/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,21 @@ func getVersions(component, container string, deployment appsv1.Deployment) (lat
return "", ""
}

latest, err = githubClient.GetLatest(component)
var repoName string
switch component {
case kuskgatewaymanager:
repoName = "kusk-gateway"
case kuskgatewayapi:
repoName = "kuskgateway-api-server"
default:
repoName = component
}

latest, err = githubClient.GetLatest(repoName)
if err != nil {
return "", ""
}

for _, c := range deployment.Spec.Template.Spec.Containers {
if c.Name == container {
current = strings.Split(c.Image, ":")[1]
Expand Down

0 comments on commit 98056af

Please sign in to comment.