mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-30 01:46:23 +00:00
add check that kustomization is empty
This commit is contained in:
@@ -73,6 +73,11 @@ func (kt *KustTarget) Load() error {
|
||||
|
||||
k.FixKustomization()
|
||||
|
||||
// check that Kustomization is empty
|
||||
if err := k.CheckEmpty(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
errs := k.EnforceFields()
|
||||
if len(errs) > 0 {
|
||||
return fmt.Errorf(
|
||||
|
||||
@@ -79,6 +79,7 @@ func TestLoad(t *testing.T) {
|
||||
k: types.Kustomization{
|
||||
TypeMeta: expectedTypeMeta,
|
||||
},
|
||||
errContains: "kustomization.yaml is empty",
|
||||
},
|
||||
"nonsenseLatin": {
|
||||
errContains: "found a tab character that violates indentation",
|
||||
|
||||
Reference in New Issue
Block a user