Skip to content

Commit

Permalink
fix(cloud): Fetch status when also running
Browse files Browse the repository at this point in the history
This ensures that the correct status is shown, vs. 'stopped'.

GitHub-Fixes: #1779
Signed-off-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.io>
  • Loading branch information
craciunoiuc committed Aug 9, 2024
1 parent 1480624 commit 42521ba
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion internal/cli/kraft/cloud/compose/up/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"kraftkit.sh/config"
"kraftkit.sh/internal/cli/kraft/cloud/compose/build"
"kraftkit.sh/internal/cli/kraft/cloud/instance/create"
"kraftkit.sh/internal/cli/kraft/cloud/instance/get"
"kraftkit.sh/internal/cli/kraft/cloud/instance/logs"
"kraftkit.sh/internal/cli/kraft/cloud/instance/start"
"kraftkit.sh/internal/cli/kraft/cloud/utils"
Expand Down Expand Up @@ -360,7 +361,17 @@ func Up(ctx context.Context, opts *UpOptions, args ...string) error {
}

if opts.Detach {
return utils.PrintInstances(ctx, "table", instResps)
if !opts.NoStart {
return get.Get(ctx, &get.GetOptions{
Auth: opts.Auth,
Client: opts.Client,
Metro: opts.Metro,
Token: opts.Token,
Output: "table",
}, instances...)
} else {
return utils.PrintInstances(ctx, "table", instResps)
}
}

return logs.Logs(ctx, &logs.LogOptions{
Expand Down

0 comments on commit 42521ba

Please sign in to comment.