mirror of https://github.com/knative/client.git
Prettify printing of webhook warnings (#1353)
This commit is contained in:
parent
46297a770e
commit
95dc71c631
|
|
@ -12,6 +12,14 @@
|
||||||
| https://github.com/knative/client/pull/[#]
|
| https://github.com/knative/client/pull/[#]
|
||||||
////
|
////
|
||||||
|
|
||||||
|
## Unreleased
|
||||||
|
[cols="1,10,3", options="header", width="100%"]
|
||||||
|
| | Description | PR
|
||||||
|
|
||||||
|
| 🎁
|
||||||
|
| Prettify printing of webhook warnings
|
||||||
|
| https://github.com/knative/client/pull/1353[#1353]
|
||||||
|
|
||||||
## v0.23.0 (2021-05-18)
|
## v0.23.0 (2021-05-18)
|
||||||
[cols="1,10,3", options="header", width="100%"]
|
[cols="1,10,3", options="header", width="100%"]
|
||||||
|===
|
|===
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
"k8s.io/client-go/rest"
|
||||||
|
|
||||||
"knative.dev/client/pkg/kn/config"
|
"knative.dev/client/pkg/kn/config"
|
||||||
"knative.dev/client/pkg/kn/plugin"
|
"knative.dev/client/pkg/kn/plugin"
|
||||||
|
|
@ -35,6 +36,14 @@ func init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
// Override client-go's warning handler to give us nicely printed warnings.
|
||||||
|
rest.SetDefaultWarningHandler(
|
||||||
|
rest.NewWarningWriter(os.Stderr, rest.WarningWriterOptions{
|
||||||
|
// only print a given warning the first time we receive it
|
||||||
|
Deduplicate: true,
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
|
||||||
err := run(os.Args[1:])
|
err := run(os.Args[1:])
|
||||||
if err != nil && len(os.Args) > 1 {
|
if err != nil && len(os.Args) > 1 {
|
||||||
printError(err)
|
printError(err)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue