1
0
mirror of https://github.com/aquasecurity/kube-bench.git synced 2024-12-23 15:18:07 +00:00

Refactor testitem-set (#668)

* set: default true

Refactor testitem-set to be default true

* fix typo

Co-authored-by: Liz Rice <liz@lizrice.com>

Co-authored-by: Liz Rice <liz@lizrice.com>
This commit is contained in:
yoavrotems 2020-08-10 17:12:41 +03:00 committed by GitHub
parent 68c8764ea8
commit 10f4e6c691
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -398,3 +398,16 @@ func toNumeric(a, b string) (c, d int, err error) {
return c, d, nil return c, d, nil
} }
func (t *testItem) UnmarshalYAML(unmarshal func(interface{}) error) error {
type buildTest testItem
// Make Set parameter to be true by default.
newTestItem := buildTest{Set: true}
err := unmarshal(&newTestItem)
if err != nil {
return err
}
*t = testItem(newTestItem)
return nil
}