mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-15 17:51:20 +00:00
4bdd45c0cc
* refactor: introduce cmd internal package Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * fix Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * changelog Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * informer Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * tracing Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * fix flag Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
22 lines
339 B
Go
22 lines
339 B
Go
package internal
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/go-logr/logr"
|
|
)
|
|
|
|
func checkErr(err error, msg string) {
|
|
if err != nil {
|
|
fmt.Println(msg, err)
|
|
os.Exit(1)
|
|
}
|
|
}
|
|
|
|
func checkError(logger logr.Logger, err error, msg string, keysAndValues ...interface{}) {
|
|
if err != nil {
|
|
logger.Error(err, msg, keysAndValues...)
|
|
os.Exit(1)
|
|
}
|
|
}
|