mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-17 18:25:26 +00:00
remove glob support from kustomization.yaml
This commit is contained in:
@@ -72,7 +72,7 @@ resources:
|
||||
namespace: namespace-b
|
||||
EOF
|
||||
|
||||
cat <<EOF >$NSA/namespace.yaml
|
||||
cat <<EOF >$NSB/namespace.yaml
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
|
||||
@@ -6,4 +6,6 @@ commonLabels:
|
||||
commonAnnotations:
|
||||
note: This is a test annotation
|
||||
resources:
|
||||
- resources/*.yaml
|
||||
- resources/deployment.yaml
|
||||
- resources/networkpolicy.yaml
|
||||
- resources/service.yaml
|
||||
|
||||
@@ -134,18 +134,15 @@ func NewResourceSliceFromPatches(
|
||||
loader loader.Loader, paths []string) ([]*resource.Resource, error) {
|
||||
var result []*resource.Resource
|
||||
for _, path := range paths {
|
||||
contents, err := loader.GlobLoad(path)
|
||||
content, err := loader.Load(path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for p, content := range contents {
|
||||
res, err := newResourceSliceFromBytes(content)
|
||||
if err != nil {
|
||||
return nil, internal.Handler(err, p)
|
||||
}
|
||||
result = append(result, res...)
|
||||
|
||||
res, err := newResourceSliceFromBytes(content)
|
||||
if err != nil {
|
||||
return nil, internal.Handler(err, path)
|
||||
}
|
||||
result = append(result, res...)
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
@@ -154,17 +151,15 @@ func NewResourceSliceFromPatches(
|
||||
func NewResMapFromFiles(loader loader.Loader, paths []string) (ResMap, error) {
|
||||
var result []ResMap
|
||||
for _, path := range paths {
|
||||
contents, err := loader.GlobLoad(path)
|
||||
content, err := loader.Load(path)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "Load from path "+path+" failed")
|
||||
}
|
||||
for p, content := range contents {
|
||||
res, err := newResMapFromBytes(content)
|
||||
if err != nil {
|
||||
return nil, internal.Handler(err, p)
|
||||
}
|
||||
result = append(result, res)
|
||||
res, err := newResMapFromBytes(content)
|
||||
if err != nil {
|
||||
return nil, internal.Handler(err, path)
|
||||
}
|
||||
result = append(result, res)
|
||||
}
|
||||
return MergeWithoutOverride(result...)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user