Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Brendan Ryan committed Jul 28, 2019
1 parent dabc0c4 commit 22db812
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 10 deletions.
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ require (
github.com/hashicorp/go-multierror v0.0.0-20180717150148-3d5d8f294aa0
github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/logrusorgru/aurora v0.0.0-20190428105938-cea283e61946
github.com/magiconair/properties v1.8.0 // indirect
github.com/mattn/go-colorable v0.1.0 // indirect
github.com/mattn/go-isatty v0.0.4 // indirect
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce h1:xdsDDbiBDQTKASoGE
github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w=
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/logrusorgru/aurora v0.0.0-20190428105938-cea283e61946 h1:z+WaKrgu3kCpcdnbK9YG+JThpOCd1nU5jO5ToVmSlR4=
github.com/logrusorgru/aurora v0.0.0-20190428105938-cea283e61946/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY=
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/mattn/go-colorable v0.1.0 h1:v2XXALHHh6zHfYTJ+cSkwtyffnaOyR1MXaA91mTrb8o=
Expand Down
8 changes: 3 additions & 5 deletions kubeval/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,23 @@ import (
// TODO (brendanryan) move these structs to `/log` once we have removed the potential
// circular dependancy between this package and `/log`

// OutputManager controls how results of the `ccheck` evaluation will be recorded
// OutputManager controls how results of the `kubeval` evaluation will be recorded
// and reported to the end user.
type OutputManager interface {
Put(r ValidationResult) error
Flush() error
}

// STDOutputManager reports `ccheck` results to stdout.
// STDOutputManager reports `kubeval` results to stdout.
type STDOutputManager struct {
}

// NewDefaultStdOutputManager instantiates a new instance of STDOutputManager using
// the default logger.
// NewSTDOutputManager instantiates a new instance of STDOutputManager.
func NewSTDOutputManager() *STDOutputManager {
return &STDOutputManager{}
}

func (s *STDOutputManager) Put(result ValidationResult) error {

if len(result.Errors) > 0 {
log.Warn("The file", result.FileName, "contains an invalid", result.Kind)
for _, desc := range result.Errors {
Expand Down
1 change: 0 additions & 1 deletion log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@ func Error(message ...interface{}) {
red := color.New(color.FgRed)
red.Println(message...)
}

2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ func logResults(results []kubeval.ValidationResult, success bool) (bool, error)
//// fetch output logger based on enviroments params -- for now we only support
//// the stdout logger
out := kubeval.NewSTDOutputManager()
fmt.Println(out)

for _, result := range results {
if len(result.Errors) > 0 {
Expand All @@ -130,6 +129,7 @@ func logResults(results []kubeval.ValidationResult, success bool) (bool, error)
return success, err
}
}

return success, nil
}

Expand Down

0 comments on commit 22db812

Please sign in to comment.