forked from metal3-io/baremetal-operator
/
errors.go
49 lines (40 loc) · 1.1 KB
/
errors.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package controllers
import (
"fmt"
)
// EmptyBMCAddressError is returned when the BMC address field
// for a host is empty
type EmptyBMCAddressError struct {
message string
}
func (e EmptyBMCAddressError) Error() string {
return fmt.Sprintf("Empty BMC address %s",
e.message)
}
// EmptyBMCSecretError is returned when the BMC secret
// for a host is empty
type EmptyBMCSecretError struct {
message string
}
func (e EmptyBMCSecretError) Error() string {
return fmt.Sprintf("No BMC CredentialsName defined %s",
e.message)
}
// ResolveBMCSecretRefError is returned when the BMC secret
// for a host is defined but cannot be found
type ResolveBMCSecretRefError struct {
message string
}
func (e ResolveBMCSecretRefError) Error() string {
return fmt.Sprintf("BMC CredentialsName secret doesn't exist %s",
e.message)
}
// NoDataInSecretError is returned when host configuration
// data were not found in referenced secret
type NoDataInSecretError struct {
secret string
key string
}
func (e NoDataInSecretError) Error() string {
return fmt.Sprintf("Secret %s does not contain key %s", e.secret, e.key)
}