mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 01:14:22 +00:00
kyaml: rename annotations and fix linting
This commit is contained in:
@@ -24,10 +24,7 @@ func (l *Walker) walkAssociativeSequence() (*yaml.RNode, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
values, err := l.elementValues(key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
values := l.elementValues(key)
|
||||
|
||||
// recursively set the elements in the list
|
||||
for _, value := range values {
|
||||
@@ -90,7 +87,7 @@ func (l Walker) elementKey() (string, error) {
|
||||
// from all sources.
|
||||
// Return value slice is ordered using the original ordering from the elements, where
|
||||
// elements missing from earlier sources appear later.
|
||||
func (l Walker) elementValues(key string) ([]string, error) {
|
||||
func (l Walker) elementValues(key string) []string {
|
||||
// use slice to to keep elements in the original order
|
||||
// dest node must be first
|
||||
var returnValues []string
|
||||
@@ -111,7 +108,7 @@ func (l Walker) elementValues(key string) ([]string, error) {
|
||||
seen.Insert(s)
|
||||
}
|
||||
}
|
||||
return returnValues, nil
|
||||
return returnValues
|
||||
}
|
||||
|
||||
// fieldValue returns a slice containing each source's value for fieldName
|
||||
|
||||
@@ -1,16 +1,5 @@
|
||||
// Copyright 2019 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Copyright 2019 The Kubernetes Authors.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package walk
|
||||
|
||||
@@ -34,5 +23,5 @@ type Visitor interface {
|
||||
VisitList(nodes Sources, kind ListKind) (*yaml.RNode, error)
|
||||
}
|
||||
|
||||
// NoOp is returned if GrepFilter should do nothing after calling Set
|
||||
var ClearNode *yaml.RNode = nil
|
||||
// ClearNode is returned if GrepFilter should do nothing after calling Set
|
||||
var ClearNode *yaml.RNode
|
||||
|
||||
@@ -48,9 +48,9 @@ func (l Walker) Walk() (*yaml.RNode, error) {
|
||||
}
|
||||
if yaml.IsAssociative(l.Sources) {
|
||||
return l.walkAssociativeSequence()
|
||||
} else {
|
||||
return l.walkNonAssociativeSequence()
|
||||
}
|
||||
return l.walkNonAssociativeSequence()
|
||||
|
||||
case yaml.ScalarNode:
|
||||
if err := yaml.ErrorIfAnyInvalidAndNonNull(yaml.ScalarNode, l.Sources...); err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user