This repository has been archived by the owner on Nov 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
errors.go
87 lines (63 loc) · 2.06 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
package daemon
import (
"fmt"
"sync"
fluxerr "github.com/weaveworks/flux/errors"
"github.com/weaveworks/flux/job"
"github.com/weaveworks/flux/resource"
)
type SyncErrors struct {
errs map[resource.ID]error
mu sync.Mutex
}
func manifestLoadError(reason error) error {
return &fluxerr.Error{
Type: fluxerr.User,
Err: reason,
Help: `Unable to parse files as manifests
Flux was unable to parse the files in the git repo as manifests,
giving this error:
` + reason.Error() + `
Check that any files mentioned are well-formed, and resources are not
defined more than once. It's also worth reviewing
https://docs.fluxcd.io/en/latest/requirements.html
to make sure you're not running into any corner cases.
If you think your files are all OK and you are still getting this
message, please log an issue at
https://github.com/fluxcd/flux/issues
and include the problematic file, if possible.
`,
}
}
func unknownJobError(id job.ID) error {
return &fluxerr.Error{
Type: fluxerr.Missing,
Err: fmt.Errorf("unknown job %q", string(id)),
Help: `Job not found
This is often because the job did not result in committing changes,
and therefore had no lasting effect. A release dry-run is an example
of a job that does not result in a commit.
If you were expecting changes to be committed, this may mean that the
job failed, but its status was lost.
In both of the above cases it is OK to retry the operation that
resulted in this error.
If you get this error repeatedly, it's probably a bug. Please log an
issue describing what you were attempting, and posting logs from the
daemon if possible:
https://github.com/weaveworks/flux/issues
`,
}
}
func unsignedHeadRevisionError(latestValidRevision, headRevision string) error {
return &fluxerr.Error{
Type: fluxerr.User,
Err: fmt.Errorf("HEAD revision is unsigned"),
Help: `HEAD is not a verified commit.
The branch HEAD in the git repo is not verified, and fluxd is unable to
make a change on top of it. The last verified commit was
` + latestValidRevision + `
HEAD is
` + headRevision + `.
`,
}
}