mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +00:00
Remove leading/trailing newlines following whitespace linter recommendation
This commit is contained in:
@@ -138,7 +138,6 @@ func (r *ByteReader) Read() ([]*yaml.RNode, error) {
|
||||
len(values) == 1 && // Only unwrap if there is only 1 value
|
||||
(meta.Kind == ResourceListKind || meta.Kind == "List") &&
|
||||
node.Field("items") != nil {
|
||||
|
||||
r.WrappingKind = meta.Kind
|
||||
r.WrappingAPIVersion = meta.APIVersion
|
||||
|
||||
@@ -154,7 +153,6 @@ func (r *ByteReader) Read() ([]*yaml.RNode, error) {
|
||||
// add items
|
||||
output = append(output, yaml.NewRNode(items.Value.Content()[i]))
|
||||
}
|
||||
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -87,7 +87,6 @@ elems:
|
||||
|
||||
assert.Equal(t, ResourceListKind, r.WrappingKind)
|
||||
assert.Equal(t, ResourceListAPIVersion, r.WrappingAPIVersion)
|
||||
|
||||
}
|
||||
|
||||
func TestByteReader_Read_wrappedList(t *testing.T) {
|
||||
|
||||
@@ -54,7 +54,6 @@ func (w ByteWriter) Write(nodes []*yaml.RNode) error {
|
||||
encoder := yaml.NewEncoder(w.Writer)
|
||||
defer encoder.Close()
|
||||
for i := range nodes {
|
||||
|
||||
// clean resources by removing annotations set by the Reader
|
||||
if !w.KeepReaderAnnotations {
|
||||
_, err := nodes[i].Pipe(yaml.ClearAnnotation(kioutil.IndexAnnotation))
|
||||
|
||||
@@ -145,7 +145,6 @@ spec:
|
||||
|
||||
// TestFormatInput_service verifies a Service yaml is formatted correctly
|
||||
func TestFormatInput_service(t *testing.T) {
|
||||
|
||||
y := `
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
@@ -178,7 +177,6 @@ spec:
|
||||
|
||||
// TestFormatInput_service verifies a Service yaml is formatted correctly
|
||||
func TestFormatInput_validatingWebhookConfiguration(t *testing.T) {
|
||||
|
||||
y := `
|
||||
apiVersion: admissionregistration.k8s.io/v1beta1
|
||||
kind: ValidatingWebhookConfiguration
|
||||
|
||||
@@ -79,7 +79,6 @@ func TestLocalPackageReader_Read_empty(t *testing.T) {
|
||||
assert.Contains(t, err.Error(), "must specify package path")
|
||||
}
|
||||
assert.Nil(t, nodes)
|
||||
|
||||
}
|
||||
|
||||
func TestLocalPackageReader_Read_pkg(t *testing.T) {
|
||||
@@ -207,7 +206,6 @@ func TestLocalPackageReader_Read_pkgOmitAnnotations(t *testing.T) {
|
||||
{path: s.root},
|
||||
}
|
||||
for _, p := range paths {
|
||||
|
||||
// empty path
|
||||
rfr := LocalPackageReader{PackagePath: p.path, OmitReaderAnnotations: true}
|
||||
nodes, err := rfr.Read()
|
||||
|
||||
Reference in New Issue
Block a user