Improve --show-only flag

Signed-off-by: Mario Valderrama <woldy401@gmail.com>
pull/7816/head
Mario Valderrama 6 years ago
parent 193850a9e2
commit eb10e43592

@ -104,11 +104,20 @@ func newTemplateCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
// if the filepath provided matches a manifest path in the // if the filepath provided matches a manifest path in the
// chart, render that manifest // chart, render that manifest
if f == manifestPath { if strings.HasSuffix(f, "*") {
if matched, _ := filepath.Match(f, manifestPath); !matched {
continue
}
} else if strings.HasSuffix(f, "/") {
if dir, _ := filepath.Split(manifestPath); f != dir {
continue
}
} else if f != manifestPath {
continue
}
manifestsToRender = append(manifestsToRender, manifest) manifestsToRender = append(manifestsToRender, manifest)
missing = false missing = false
} }
}
if missing { if missing {
return fmt.Errorf("could not find template %s in chart", f) return fmt.Errorf("could not find template %s in chart", f)
} }

Loading…
Cancel
Save