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
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1141 from weaveworks/issue/1123-better-badyaml
Return a friendly message when flux can't parse YAMLs
- Loading branch information
Showing
11 changed files
with
99 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package daemon | ||
|
||
import ( | ||
"fmt" | ||
|
||
fluxerr "github.com/weaveworks/flux/errors" | ||
"github.com/weaveworks/flux/job" | ||
) | ||
|
||
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://github.com/weaveworks/flux/blob/master/site/requirements.md | ||
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/weaveworks/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 | ||
`, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters