From 5c5467225d38bf87a9dfec754495b5c07fd63728 Mon Sep 17 00:00:00 2001 From: nightfury1204 Date: Thu, 8 Aug 2024 20:07:41 +0100 Subject: [PATCH] [#3736] Removed app specific unique params when importing/exporting to avoid error ### What is the feature/fix? Encountered error where some app parameters which are unique to every app, were being copied while doing app import, this caused failure in copying app parameters while using `convox apps import` . To resolve this before importing app parameters, we are removing the unique parameters. --- pkg/cli/apps.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pkg/cli/apps.go b/pkg/cli/apps.go index 3ab9105124..c1a8cc6fd4 100644 --- a/pkg/cli/apps.go +++ b/pkg/cli/apps.go @@ -411,10 +411,11 @@ func appExport(rack sdk.Interface, c *stdcli.Context, app string, w io.Writer) e return err } - for k, v := range a.Parameters { - if v == "****" { - delete(a.Parameters, k) - } + // Remove app unique parameters before exporting app + uniqueParams := []string{"Rack","LogBucket","ResourcePassword","ParamPassword"} + + for _,param := range uniqueParams{ + delete(a.Parameters, param); } data, err := json.Marshal(a) @@ -576,6 +577,13 @@ func appImport(rack sdk.Interface, c *stdcli.Context, app string, r io.Reader) e change := false + // Remove app unique parameters from being copied over + uniqueParams := []string{"Rack","LogBucket","ResourcePassword"} + + for _,param := range uniqueParams{ + delete(a.Parameters, param); + } + for k, v := range a.Parameters { if v != ae.Parameters[k] { change = true