Skip to content

Commit

Permalink
Merge pull request #580 from machi1990/OCM-4960
Browse files Browse the repository at this point in the history
OCM-4960: Do not print expiration timestamp if not set
  • Loading branch information
gdbranco authored Nov 28, 2023
2 parents c7fd667 + a3c1717 commit 81ed2ea
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pkg/cluster/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,7 @@ func PrintClusterDescription(connection *sdk.Connection, cluster *cmv1.Cluster)
"Creator: %s\n"+
"Email: %s\n"+
"AccountNumber: %s\n"+
"Created: %v\n"+
"Expiration: %v\n",
"Created: %v\n",
apiURL,
apiListening,
cluster.Console().URL(),
Expand All @@ -240,9 +239,13 @@ func PrintClusterDescription(connection *sdk.Connection, cluster *cmv1.Cluster)
email,
accountNumber,
cluster.CreationTimestamp().Round(time.Second).Format(time.RFC3339Nano),
cluster.ExpirationTimestamp().Round(time.Second).Format(time.RFC3339Nano),
)

expirationTime, hasExpirationTimestamp := cluster.GetExpirationTimestamp()
if hasExpirationTimestamp {
fmt.Printf("Expiration: %v\n", expirationTime.Round(time.Second).Format(time.RFC3339Nano))
}

// Hive
if shard != "" {
fmt.Printf("Shard: %v\n", shard)
Expand Down

0 comments on commit 81ed2ea

Please sign in to comment.