Apply review markups

Signed-off-by: Andy Caldwell <andycaldwell@microsoft.com>
pull/12553/head
Andy Caldwell 1 year ago
parent 2834f5b1d2
commit 12521f32fe
No known key found for this signature in database
GPG Key ID: D4204541AC1D228D

@ -77,12 +77,15 @@ func ValidateAgainstSingleSchema(values Values, schemaJSON []byte, extraSchemas
extraSchemasLoader := gojsonschema.NewSchemaLoader()
for _, extraSchema := range extraSchemas {
extraLoader := gojsonschema.NewBytesLoader(extraSchema)
extraSchemasLoader.AddSchemas(extraLoader)
err = extraSchemasLoader.AddSchemas(extraLoader)
if err != nil {
return fmt.Errorf("unable to load extra schema: %s", err)
}
}
rootSchemaLoader := gojsonschema.NewBytesLoader(schemaJSON)
rootSchema, err := extraSchemasLoader.Compile(rootSchemaLoader)
if err != nil {
return fmt.Errorf("enable to compile schema: %s", err)
return fmt.Errorf("unable to compile schema: %s", err)
}
valuesLoader := gojsonschema.NewBytesLoader(valuesJSON)

@ -103,12 +103,12 @@ func validateValuesFile(valuesPath string, overrides map[string]interface{}) err
}
if !dentry.IsDir() {
schema, err = os.ReadFile(path)
extraSchema, err := os.ReadFile(path)
if err != nil {
return err
}
extraSchemas = append(extraSchemas, schema)
extraSchemas = append(extraSchemas, extraSchema)
}
return nil

Loading…
Cancel
Save