Make warning messages more visible (#7097)

* Wrap warning messages to make them more visible

For example, instead of displaying:
```
⚠  You are using "default" project, odo may not work as expected in the default project.
```

We are now displaying:
```
========================================================================================
⚠  You are using "default" project, odo may not work as expected in the default project.
========================================================================================
```

* Display warning message about default project/namespace in a single block

* Add unit test

* Fix sample outputs for doc automation tests

* Revert "Fix sample outputs for doc automation tests"

This reverts commit 98a6554c34.

* Ignore '===' warning header and footer for doc automation tests
This commit is contained in:
Armel Soro
2023-09-26 08:53:45 +02:00
committed by GitHub
parent 134a0867b2
commit d34fbaed1a
4 changed files with 96 additions and 17 deletions

View File

@@ -67,6 +67,9 @@ func StripSpinner(docString string) (returnString string) {
if strings.HasPrefix(line, "⚠") && !strings.Contains(line, "Pod is Pending") {
continue
}
if strings.HasPrefix(line, "===") {
continue
}
// for some reason, splitting the docString by \n does not split the spinner frames,
// so we perform a side operation to remove the extra spinner frames that are not present in the final output