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

fix(compliance): print a more user friendly message in the status command when no compliance is found #2481

Merged
merged 2 commits into from Dec 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion pkg/jx/cmd/compliance_status.go
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/heptio/sonobuoy/pkg/plugin/aggregation"
"github.com/jenkins-x/jx/pkg/jx/cmd/templates"
"github.com/jenkins-x/jx/pkg/log"
"github.com/jenkins-x/jx/pkg/util"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"gopkg.in/AlecAivazis/survey.v1/terminal"
Expand Down Expand Up @@ -64,7 +65,9 @@ func (o *ComplianceStatusOptions) Run() error {
}
status, err := cc.GetStatus(complianceNamespace)
if err != nil {
return errors.Wrap(err, "failed to retrieve the status")
log.Infof("No compliance status found. Use %s command to start the compliance tests.\n", util.ColorInfo("jx compliance run"))
log.Infof("You can watch the logs with %s command.\n", util.ColorInfo("jx compliance logs -f"))
return nil
}
log.Infoln(hummanReadableStatus(status.Status))
return nil
Expand Down