From 122e4595f426bd2d90b50278c93137e08fc5cc0a Mon Sep 17 00:00:00 2001 From: Reuben Miller Date: Thu, 25 Apr 2024 07:41:33 +0200 Subject: [PATCH] allow inserting/overriding remote config --- pkg/cmd/ui/extensions/install/install.manual.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/cmd/ui/extensions/install/install.manual.go b/pkg/cmd/ui/extensions/install/install.manual.go index 416772970..f44b97b59 100644 --- a/pkg/cmd/ui/extensions/install/install.manual.go +++ b/pkg/cmd/ui/extensions/install/install.manual.go @@ -128,6 +128,9 @@ func NewCmdInstall(f *cmdutil.Factory) *CmdInstall { $ c8y ui extensions install --application devicemanagement --update-versions Update to the latest versions for all of the existing UI extensions that are installed in the application + + $ c8y ui extensions install --application devicemanagement --extension myext --template "{config+:{remotes+:{'other@1.0.0':[]}}}" + Install myext via a lookup and add manual configuration using templates (for power users only!) `), PreRunE: func(cmd *cobra.Command, args []string) error { return f.UpdateModeEnabled() @@ -255,6 +258,9 @@ func (n *CmdInstall) RunE(cmd *cobra.Command, args []string) error { body = mapbuilder.NewMapBuilderWithInit([]byte(app.Get("config").Str)) } + // Allow the template values to override values provided by the --extension flags + body.SetAppendTemplatePreference(true) + body.Set("id", app.Get("id").String()) body.Set("config.remotes", formatApplicationRemotes(remotes))