Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error output when validation fails #333

Merged
merged 2 commits into from
May 25, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ghpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@ import (
"embed"
"hpc-toolkit/cmd"
"hpc-toolkit/pkg/sourcereader"
"log"
"os"
)

//go:embed modules community/modules
var moduleFS embed.FS

func main() {
log.SetFlags(0)
nick-stroud marked this conversation as resolved.
Show resolved Hide resolved

sourcereader.ModuleFS = moduleFS
if err := cmd.Execute(); err != nil {
os.Exit(1)
Expand Down
5 changes: 3 additions & 2 deletions pkg/config/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ func (dc DeploymentConfig) executeValidators() error {
}
log.Print(prefix, err)
log.Println()
break
nick-stroud marked this conversation as resolved.
Show resolved Hide resolved
}
} else {
errored = true
Expand All @@ -86,8 +87,9 @@ func (dc DeploymentConfig) executeValidators() error {

if warned || errored {
log.Println("validator failures can indicate a credentials problem.")
log.Println("cloud credentials associated with your Google Cloud account can be generated by the following command:")
log.Println(" $ gcloud auth application-default login")
log.Println("troubleshooting info appears at:")
log.Println()
log.Println("https://github.com/GoogleCloudPlatform/hpc-toolkit/blob/main/README.md#supplying-cloud-credentials-to-terraform")
log.Println()
log.Println("validation can be configured:")
Expand All @@ -97,7 +99,6 @@ func (dc DeploymentConfig) executeValidators() error {
log.Println(" with the flag \"--validation-level IGNORE\"")
log.Println("- a custom set of validators can be configured following")
log.Println(" instructions at:")
log.Println()
log.Println("https://github.com/GoogleCloudPlatform/hpc-toolkit/blob/main/README.md#blueprint-warnings-and-errors")
}

Expand Down