Skip to content

Commit

Permalink
update enum names to be clearer and simpler
Browse files Browse the repository at this point in the history
  • Loading branch information
nullfunc committed Jun 27, 2024
1 parent 2d9f4a3 commit 4701a2b
Show file tree
Hide file tree
Showing 5 changed files with 172 additions and 166 deletions.
7 changes: 6 additions & 1 deletion src/cmd/cli/command/deploymentinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ func printEndpoints(serviceInfos []*defangv1.ServiceInfo) {
andEndpoints = "and will be available at:"
}

term.Info("Service", serviceInfo.Service.Name, "is in state", serviceInfo.State, andEndpoints)
serviceConditionText := " status " + serviceInfo.Status
if serviceInfo.State != defangv1.ServiceState_UNKNOWN {
serviceConditionText = " state " + string(serviceInfo.State)
}

term.Info("Service ", serviceInfo.Service.Name, " is ", serviceConditionText, andEndpoints)
for i, endpoint := range serviceInfo.Endpoints {
if serviceInfo.Service.Ports[i].Mode == defangv1.Mode_INGRESS {
endpoint = "https://" + endpoint
Expand Down
2 changes: 2 additions & 0 deletions src/pkg/cli/client/byoc/aws/byoc.go
Original file line number Diff line number Diff line change
Expand Up @@ -569,8 +569,10 @@ func (b *ByocAws) update(ctx context.Context, service *defangv1.Service) (*defan

si.NatIps = b.publicNatIps // TODO: even internal services use NAT now
si.Status = "UPDATE_QUEUED"
si.State = defangv1.ServiceState_UPDATE_PENDING
if si.Service.Build != nil {
si.Status = "BUILD_QUEUED" // in SaaS, this gets overwritten by the ECS events for "kaniko"
si.State = defangv1.ServiceState_BUILD_PENDING
}
return si, nil
}
Expand Down
6 changes: 3 additions & 3 deletions src/pkg/cli/compose/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,10 +335,10 @@ func convertServiceState(state string) defangv1.ServiceState {
case "update_pending":
return defangv1.ServiceState_UPDATE_PENDING
case "service_deploying":
return defangv1.ServiceState_SERVICE_DEPLOYING
return defangv1.ServiceState_DEPLOYING
case "service_started":
return defangv1.ServiceState_SERVICE_STARTED
return defangv1.ServiceState_STARTED
case "service_failed":
return defangv1.ServiceState_SERVICE_FAILED
return defangv1.ServiceState_FAILED
}
}
Loading

0 comments on commit 4701a2b

Please sign in to comment.