Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specifying --debug during installation or upgrade sticks in future invocations #3240

Closed
kichristensen opened this issue Oct 31, 2024 · 0 comments · Fixed by #3241
Closed
Assignees
Labels
bug Oops, sorry!

Comments

@kichristensen
Copy link
Contributor

Describe the bug

When running porter upgrade --debug debug output is correctly written, but when running porter upgrade once more also writes debug output. This was not the case in Porter v1.0.0.

To Reproduce

Steps to reproduce the behavior:

  1. Run porter install hello --reference ghcr.io/getporter/examples/porter-hello:v0.2.0
  2. Run this porter command porter upgrade hello --debug
  3. See that debug logs are written
  4. Run this porter command porter upgrade hello
  5. See that debug logs still are written

Expected behavior

Debug logs should not be written on the second porter upgrade.

Porter Command and Output

$ porter install hello --reference ghcr.io/getporter/examples/porter-hello:v0.2.0
Just-in-time resolving credentials...
Just-in-time resolving parameters...
Unable to find image 'ghcr.io/getporter/examples/porter-hello@sha256:81f0843759508d5f53cb1ba0def7f8569029790c7ec591a50276fde2697d7696' locally
ghcr.io/getporter/examples/porter-hello@sha256:81f0843759508d5f53cb1ba0def7f8569029790c7ec591a50276fde2697d7696: Pulling from getporter/examples/porter-hello
21fb02cbac85: Pulling fs layer
....
Digest: sha256:81f0843759508d5f53cb1ba0def7f8569029790c7ec591a50276fde2697d7696
Status: Downloaded newer image for ghcr.io/getporter/examples/porter-hello@sha256:81f0843759508d5f53cb1ba0def7f8569029790c7ec591a50276fde2697d7696
executing install action from examples/porter-hello (installation: /hello)
Install Hello World
Hello, porter
execution completed successfully!

$ porter upgrade hello --debug
Just-in-time resolving credentials...
Just-in-time resolving parameters...
DEBUG: defaulting action to CNAB_ACTION (upgrade)
executing upgrade action from examples/porter-hello (installation: /hello)
No existing bundle state to unpack
=== Step Data ===
map[bundle:map[credentials:map[] custom:map[] dependencies:map[] description:An example Porter configuration images:map[] invocationImage:ghcr.io/getporter/examples/porter-hello:3cb284ae76addb8d56b52bb7d6838351 name:examples/porter-hello outputs:map[] parameters:map[name:/cnab/app/foo/name.txt] version:0.2.0] env:map[CNAB_ACTION:upgrade CNAB_BUNDLE_NAME:examples/porter-hello CNAB_BUNDLE_VERSION:0.2.0 CNAB_CLAIMS_VERSION:1.0.0-DRAFT+b5ed2f3 CNAB_INSTALLATION_NAME:/hello CNAB_REVISION:01JBGSYSY3Y2CRSN7K2BWDQJ8S HOME:/home/nonroot HOSTNAME:d43cf87ccc84 PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PORTER_DEBUG:true PORTER_HOME:/cnab/app PORTER_INSTALLATION_NAME:hello PORTER_INSTALLATION_NAMESPACE: PORTER_VERBOSITY:debug PWD:/cnab/app SHLVL:0] installation:map[name:hello namespace:]]
=== Step Template ===
exec:
  arguments:
    - upgrade
  command: ./helpers.sh
  description: World 2.0

=== Rendered Step ===
exec:
  arguments:
    - upgrade
  command: ./helpers.sh
  description: World 2.0

World 2.0
DEBUG name:    exec
DEBUG pkgDir: /cnab/app/mixins/exec
DEBUG file:
DEBUG stdin:
upgrade:
  - exec:
      arguments:
        - upgrade
      command: ./helpers.sh
      description: World 2.0

/cnab/app/cnab/app/mixins/exec/runtimes/exec-runtime upgrade --debug
DEBUG Parsed Input:
&exec.Action{Name:"upgrade", Steps:[]exec.Step{exec.Step{Instruction:exec.Instruction{Description:"World 2.0", Command:"./helpers.sh", WorkingDir:"", Arguments:[]string{"upgrade"}, SuffixArguments:[]string(nil), Flags:builder.Flags(nil), Outputs:[]exec.Output(nil), SuppressOutput:false}}}}
/cnab/app ./helpers.sh upgrade
Hello, porter
Collecting bundle outputs...
  - name
Packing bundle state...
Closing plugins
execution completed successfully!

$ porter upgrade hello
Just-in-time resolving credentials...
Just-in-time resolving parameters...
DEBUG: defaulting action to CNAB_ACTION (upgrade)
executing upgrade action from examples/porter-hello (installation: /hello)
No existing bundle state to unpack
=== Step Data ===
map[bundle:map[credentials:map[] custom:map[] dependencies:map[] description:An example Porter configuration images:map[] invocationImage:ghcr.io/getporter/examples/porter-hello:3cb284ae76addb8d56b52bb7d6838351 name:examples/porter-hello outputs:map[] parameters:map[name:/cnab/app/foo/name.txt] version:0.2.0] env:map[CNAB_ACTION:upgrade CNAB_BUNDLE_NAME:examples/porter-hello CNAB_BUNDLE_VERSION:0.2.0 CNAB_CLAIMS_VERSION:1.0.0-DRAFT+b5ed2f3 CNAB_INSTALLATION_NAME:/hello CNAB_REVISION:01JBGT0R54ERKJJA9RBNEYJ1MF HOME:/home/nonroot HOSTNAME:bba3b5d47d13 PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PORTER_DEBUG:true PORTER_HOME:/cnab/app PORTER_INSTALLATION_NAME:hello PORTER_INSTALLATION_NAMESPACE: PORTER_VERBOSITY:debug PWD:/cnab/app SHLVL:0] installation:map[name:hello namespace:]]
=== Step Template ===
exec:
  arguments:
    - upgrade
  command: ./helpers.sh
  description: World 2.0

=== Rendered Step ===
exec:
  arguments:
    - upgrade
  command: ./helpers.sh
  description: World 2.0

DEBUG name:    exec
DEBUG pkgDir: /cnab/app/mixins/exec
DEBUG file:
DEBUG stdin:
upgrade:
  - exec:
      arguments:
        - upgrade
      command: ./helpers.sh
      description: World 2.0

World 2.0
/cnab/app/cnab/app/mixins/exec/runtimes/exec-runtime upgrade --debug
DEBUG Parsed Input:
&exec.Action{Name:"upgrade", Steps:[]exec.Step{exec.Step{Instruction:exec.Instruction{Description:"World 2.0", Command:"./helpers.sh", WorkingDir:"", Arguments:[]string{"upgrade"}, SuffixArguments:[]string(nil), Flags:builder.Flags(nil), Outputs:[]exec.Output(nil), SuppressOutput:false}}}}
/cnab/app ./helpers.sh upgrade
Hello, porter
Collecting bundle outputs...
  - name
Packing bundle state...
execution completed successfully!
Closing plugins

Version

porter v1.1.0 (b50c189)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Oops, sorry!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant