mirror of https://github.com/kubernetes/kops.git
Disallow unknown fields in create cluster integration tests
This commit is contained in:
parent
543bd04850
commit
ce4257d0ce
|
|
@ -21,6 +21,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"k8s.io/kops/upup/pkg/fi/utils"
|
"k8s.io/kops/upup/pkg/fi/utils"
|
||||||
|
"sigs.k8s.io/yaml"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ParseInstanceGroupRole converts a string to an InstanceGroupRole.
|
// ParseInstanceGroupRole converts a string to an InstanceGroupRole.
|
||||||
|
|
@ -60,7 +61,7 @@ func ParseRawYaml(data []byte, dest interface{}) error {
|
||||||
configString = strings.TrimSpace(configString)
|
configString = strings.TrimSpace(configString)
|
||||||
|
|
||||||
if configString != "" {
|
if configString != "" {
|
||||||
err := utils.YamlUnmarshal([]byte(configString), dest)
|
err := yaml.Unmarshal([]byte(configString), dest, yaml.DisallowUnknownFields)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error parsing configuration: %v", err)
|
return fmt.Errorf("error parsing configuration: %v", err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue