Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

cli/status: fix broken output when no generated time is set #2047

Merged
merged 2 commits into from
Aug 13, 2021

Conversation

catsby
Copy link
Contributor

@catsby catsby commented Aug 13, 2021

If a status report is returned without GeneratedTime set, the CLI will fail to parse it:

$ waypoint status -app=nginx-example
Current status for application "nginx-example" in project "example-nginx-ami" in server context "waypoint-server-nlb-774e79e21a01ca87.elb.us-west-2.amazonaws.com:9701".
! CLI failed to format app status:timestamp: nil Timestamp

In this PR we check for a valid time. If it's not valid, we insert (unknown) as a placeholder

@catsby catsby requested a review from briancain August 13, 2021 21:56
@github-actions github-actions bot added the core label Aug 13, 2021
@@ -947,12 +947,12 @@ func (c *StatusCommand) FormatStatusReportComplete(
statusReportComplete = "? UNKNOWN"
}

t, err := ptypes.Timestamp(statusReport.GeneratedTime)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@briancain briancain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! I'd backport this and I think it's worth a changelog entry

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants