mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +00:00
allow apiVersion and Kind to be empty or specific values
This commit is contained in:
@@ -21,7 +21,6 @@ import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"log"
|
||||
"strings"
|
||||
|
||||
"github.com/ghodss/yaml"
|
||||
@@ -64,12 +63,9 @@ func NewKustTarget(
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
msgs, errs := k.EnforceFields()
|
||||
errs := k.EnforceFields()
|
||||
if len(errs) > 0 {
|
||||
return nil, fmt.Errorf(strings.Join(errs, "\n"))
|
||||
}
|
||||
if len(msgs) > 0 {
|
||||
log.Printf(strings.Join(msgs, "\n"))
|
||||
return nil, fmt.Errorf("Failed to read kustomization file under %s:\n"+strings.Join(errs, "\n"), ldr.Root())
|
||||
}
|
||||
return &KustTarget{
|
||||
kustomization: &k,
|
||||
|
||||
Reference in New Issue
Block a user