mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 01:14:22 +00:00
Rename variable, constants and struct fields following stylecheck linter recommendation
This commit is contained in:
@@ -78,7 +78,7 @@ func (c *ContainerFilter) Filter(input []*yaml.RNode) ([]*yaml.RNode, error) {
|
||||
|
||||
// write the input
|
||||
err = kio.ByteWriter{
|
||||
WrappingApiVersion: kio.ResourceListApiVersion,
|
||||
WrappingAPIVersion: kio.ResourceListAPIVersion,
|
||||
WrappingKind: kio.ResourceListKind,
|
||||
Writer: in, KeepReaderAnnotations: true, FunctionConfig: c.Config}.Write(input)
|
||||
if err != nil {
|
||||
|
||||
@@ -459,7 +459,7 @@ func TestFormatFileOrDirectory_YamlExtFileWithJson(t *testing.T) {
|
||||
f, err := ioutil.TempFile("", "yamlfmt*.yaml")
|
||||
assert.NoError(t, err)
|
||||
defer os.Remove(f.Name())
|
||||
err = ioutil.WriteFile(f.Name(), testyaml.UnformattedJson1, 0600)
|
||||
err = ioutil.WriteFile(f.Name(), testyaml.UnformattedJSON1, 0600)
|
||||
assert.NoError(t, err)
|
||||
|
||||
// format the file
|
||||
|
||||
@@ -44,7 +44,7 @@ func (c MergeFilter) Filter(input []*yaml.RNode) ([]*yaml.RNode, error) {
|
||||
return nil, err
|
||||
}
|
||||
key := mergeKey{
|
||||
apiVersion: meta.ApiVersion,
|
||||
apiVersion: meta.APIVersion,
|
||||
kind: meta.Kind,
|
||||
namespace: meta.Namespace,
|
||||
name: meta.Name,
|
||||
|
||||
@@ -113,7 +113,7 @@ func (ts *tuples) add(node *yaml.RNode) error {
|
||||
for i := range ts.list {
|
||||
t := ts.list[i]
|
||||
if t.meta.Name == nodeMeta.Name && t.meta.Namespace == nodeMeta.Namespace &&
|
||||
t.meta.ApiVersion == nodeMeta.ApiVersion && t.meta.Kind == nodeMeta.Kind {
|
||||
t.meta.APIVersion == nodeMeta.APIVersion && t.meta.Kind == nodeMeta.Kind {
|
||||
return t.add(node)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ apiVersion: example.com/v1beta1
|
||||
kind: MyType2
|
||||
`)
|
||||
|
||||
var UnformattedJson1 = []byte(`
|
||||
var UnformattedJSON1 = []byte(`
|
||||
{
|
||||
"spec": "a",
|
||||
"status": {"conditions": [3, 1, 2]},
|
||||
|
||||
Reference in New Issue
Block a user