-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not print empty podman/openshift version
- Loading branch information
1 parent
836bc86
commit 76d6035
Showing
1 changed file
with
18 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,19 +92,29 @@ func (s *status) prettyPrintTo(writer io.Writer) error { | |
} | ||
w := tabwriter.NewWriter(writer, 0, 0, 1, ' ', 0) | ||
|
||
lines := []struct { | ||
// todo: replace this with Pair when switching to [email protected] | ||
type line struct { | ||
left, right string | ||
}{ | ||
} | ||
lines := []line{ | ||
{"CRC VM", s.CrcStatus}, | ||
{"OpenShift", openshiftStatus(s)}, | ||
{"Podman", s.PodmanVersion}, | ||
{"Disk Usage", fmt.Sprintf( | ||
} | ||
|
||
if s.OpenShiftVersion != "" { | ||
lines = append(lines, line{"OpenShift", openshiftStatus(s)}) | ||
} | ||
if s.PodmanVersion != "" { | ||
lines = append(lines, line{"Podman", s.PodmanVersion}) | ||
} | ||
|
||
lines = append(lines, | ||
line{"Disk Usage", fmt.Sprintf( | ||
"%s of %s (Inside the CRC VM)", | ||
units.HumanSize(float64(s.DiskUsage)), | ||
units.HumanSize(float64(s.DiskSize)))}, | ||
{"Cache Usage", units.HumanSize(float64(s.CacheUsage))}, | ||
{"Cache Directory", s.CacheDir}, | ||
} | ||
line{"Cache Usage", units.HumanSize(float64(s.CacheUsage))}, | ||
line{"Cache Directory", s.CacheDir}) | ||
|
||
for _, line := range lines { | ||
if err := printLine(w, line.left, line.right); err != nil { | ||
return err | ||
|