remove glob support from kustomization.yaml

This commit is contained in:
Jingfang Liu
2018-07-30 16:28:34 -07:00
parent 7f97108686
commit de4d8b7dfa
3 changed files with 14 additions and 17 deletions

View File

@@ -72,7 +72,7 @@ resources:
namespace: namespace-b
EOF
cat <<EOF >$NSA/namespace.yaml
cat <<EOF >$NSB/namespace.yaml
apiVersion: v1
kind: Namespace
metadata:

View File

@@ -6,4 +6,6 @@ commonLabels:
commonAnnotations:
note: This is a test annotation
resources:
- resources/*.yaml
- resources/deployment.yaml
- resources/networkpolicy.yaml
- resources/service.yaml

View File

@@ -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...)
}