Skip to content

Commit

Permalink
fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
rbren committed Jan 2, 2020
1 parent d0e0009 commit fee55ba
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/config/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"k8s.io/apimachinery/pkg/api/resource"
)

// TargetKind represents the part of the config to be validated
type TargetKind string

const (
Expand All @@ -29,7 +30,7 @@ type SchemaCheck struct {
Target TargetKind `yaml:"target"`
SchemaTarget TargetKind `yaml:"schemaTarget"`
Schema jsonschema.RootSchema `yaml:"schema"`
JsonSchema string `yaml:"jsonSchema"`
JSONSchema string `yaml:"jsonSchema"`
}

type resourceMinimum string
Expand Down Expand Up @@ -114,8 +115,8 @@ func validateRange(path string, limit interface{}, data interface{}, isMinimum b
// Initialize sets up the schema
func (check *SchemaCheck) Initialize(id string) error {
check.ID = id
if check.JsonSchema != "" {
if err := json.Unmarshal([]byte(check.JsonSchema), &check.Schema); err != nil {
if check.JSONSchema != "" {
if err := json.Unmarshal([]byte(check.JSONSchema), &check.Schema); err != nil {
return err
}
}
Expand Down

0 comments on commit fee55ba

Please sign in to comment.