Skip to content

Commit

Permalink
[#3736] Removed app specific unique params when importing/exporting t…
Browse files Browse the repository at this point in the history
…o 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.
  • Loading branch information
nightfury1204 committed Aug 9, 2024
1 parent 584ad69 commit 5c54672
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions pkg/cli/apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5c54672

Please sign in to comment.