diff --git a/cmd/influx/template.go b/cmd/influx/template.go index 55513f0f86f..2445ea317ba 100644 --- a/cmd/influx/template.go +++ b/cmd/influx/template.go @@ -895,9 +895,11 @@ func (b *cmdTemplateBuilder) stackUpdateRunEFn(cmd *cobra.Command, args []string TemplateURLs: b.urls, } + failedString := []string{} for _, res := range b.updateStackOpts.addResources { parts := strings.SplitN(res, "=", 2) if len(parts) < 2 { + failedString = append(failedString, res) continue } @@ -917,6 +919,10 @@ func (b *cmdTemplateBuilder) stackUpdateRunEFn(cmd *cobra.Command, args []string }) } + if len(failedString) > 0 { + return errors.New("invalid 'resourceType=resourceID' key value pair[s]: " + strings.Join(failedString, ";")) + } + stack, err := templateSVC.UpdateStack(context.Background(), update) if err != nil { return err