Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
lionello committed Dec 13, 2024
1 parent 51de160 commit 041869e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/pkg/cli/client/byoc/do/byoc.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,9 +415,18 @@ func (b *ByocDo) Follow(ctx context.Context, req *defangv1.TailRequest) (client.

term.Debugf("Deployment phase: %s", deploymentInfo.GetPhase())
switch deploymentInfo.GetPhase() {
case godo.DeploymentPhase_PendingBuild, godo.DeploymentPhase_PendingDeploy, godo.DeploymentPhase_Deploying:
case godo.DeploymentPhase_PendingBuild, godo.DeploymentPhase_PendingDeploy:
// Do nothing; check again in 10 seconds

case godo.DeploymentPhase_Deploying:
if logType.Has(logs.LogTypeBuild) {
logs, _, err := b.client.Apps.GetLogs(ctx, appID, deploymentID, appPlatform.CdName, godo.AppLogTypeDeploy, true, 50)
if err != nil {
return nil, err
}
return newByocServerStream(ctx, logs.LiveURL, req.Etag)
}

case godo.DeploymentPhase_Error, godo.DeploymentPhase_Canceled:
if logType.Has(logs.LogTypeBuild) {
// TODO: provide component name
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/cli/client/byoc/do/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type byocServerStream struct {
}

func newByocServerStream(ctx context.Context, liveUrl string, etag types.ETag) (*byocServerStream, error) {
if liveUrl == "none" {
if liveUrl == "" {
return &byocServerStream{}, nil
}

Expand Down

0 comments on commit 041869e

Please sign in to comment.