diff --git a/pkg/commands/template.go b/pkg/commands/template.go index e51cbd9..71c5cb5 100644 --- a/pkg/commands/template.go +++ b/pkg/commands/template.go @@ -96,9 +96,6 @@ var templateCmd = &cobra.Command{ templateFunc := template if len(templateCmdFlags.configFiles) > 0 { templateFunc = templateWithFiles - if len(templateCmdFlags.configFiles) == 0 { - return fmt.Errorf("cannot use --in-place without --file") - } } if templateCmdFlags.offline { diff --git a/pkg/engine/engine.go b/pkg/engine/engine.go index 0a8be47..7238e73 100644 --- a/pkg/engine/engine.go +++ b/pkg/engine/engine.go @@ -241,6 +241,10 @@ func Render(ctx context.Context, c *client.Client, opts Options) ([]byte, error) return nil, err } + if len(opts.TemplateFiles) == 0 { + return nil, fmt.Errorf("templates are not set for the command: please use `--file` or `--template` flag") + } + configPatches := []string{} for _, templateFile := range opts.TemplateFiles { // Use path.Join (not filepath.Join) because helm engine keys always use forward slashes