Isolate scalar quoting oddities to one test set.

The apimachinery code path, in its final marshalling
for output, calls Marshall

  https://github.com/go-yaml/yaml/blob/v2/yaml.go#L199

This code path (via apimachinery Unstructured types)
has no JSON schema tags

  https://yaml.org/spec/1.2/spec.html#id2803311

so it adds quotes to values that smell like
booleans and ints (e.g. `false` becomes `"false"`).

The kyaml code path, OTOH, uses such tags,
so generally does not quote ints and booleans.

This PR isolates this difference in behavior to
one set of tests (using data fields in configmaps
in api/krusty/configmaps_test.go) so that
they don't confuse other tests that cover
completely different behaviors.
This commit is contained in:
jregan
2020-12-23 16:23:45 -08:00
parent 1ffd790cfb
commit 1426137883
8 changed files with 172 additions and 76 deletions

View File

@@ -70,12 +70,6 @@ func (th Harness) MakeDefaultOptions() krusty.Options {
return th.MakeOptionsPluginsDisabled()
}
func (th Harness) MakeDefaultOptionsWithProperEnableKyaml() krusty.Options {
o := th.MakeOptionsPluginsDisabled()
o.UseKyaml = konfig.FlagEnableKyamlDefaultValue
return o
}
// This has no impact on Builtin plugins, as they are always enabled.
func (th Harness) MakeOptionsPluginsDisabled() krusty.Options {
return *krusty.MakeDefaultOptions()