mirror of
https://github.com/replicatedhq/troubleshoot.git
synced 2026-04-15 07:16:34 +00:00
* feat: add velero analyzer (#806) * updated schema * analyzer without collector * tests * covers deprecated Restic repository type * velero version from deployment image to check deprecated type * read for both velero pod kinds (velero*, node-agent*) --------- Signed-off-by: Archit Sharma <archit@pm.me>
52 lines
814 B
Go
52 lines
814 B
Go
package types
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
type NotFoundError struct {
|
|
Name string
|
|
}
|
|
|
|
func (e *NotFoundError) Error() string {
|
|
return e.Name + ": not found"
|
|
}
|
|
|
|
type ExitError interface {
|
|
Error() string
|
|
ExitStatus() int
|
|
}
|
|
|
|
type ExitCodeError struct {
|
|
Msg string
|
|
Code int
|
|
}
|
|
|
|
type ExitCodeWarning struct {
|
|
Msg string
|
|
}
|
|
|
|
func (e *ExitCodeError) Error() string {
|
|
return e.Msg
|
|
}
|
|
|
|
func (e *ExitCodeError) ExitStatus() int {
|
|
return e.Code
|
|
}
|
|
|
|
func NewExitCodeError(exitCode int, theErr error) *ExitCodeError {
|
|
useErr := ""
|
|
if theErr != nil {
|
|
useErr = theErr.Error()
|
|
}
|
|
return &ExitCodeError{Msg: useErr, Code: exitCode}
|
|
}
|
|
|
|
func NewExitCodeWarning(theErrMsg string) *ExitCodeWarning {
|
|
return &ExitCodeWarning{Msg: theErrMsg}
|
|
}
|
|
|
|
func (e *ExitCodeWarning) Warning() string {
|
|
return fmt.Sprintf("Warning: %s", e.Msg)
|
|
}
|