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

🐛 Report command path without arguments and stdout/stderr on error. #46

Merged
merged 1 commit into from
Nov 22, 2023

Conversation

jortel
Copy link
Contributor

@jortel jortel commented Nov 21, 2023

Update RunSilent() to not fail silently. Currently the returned error is reported as "exit code: 1" which isn't useful for troubleshooting.

The primary goal for RunSilent() is to quietly run the command. One purpose is to prevent reporting arguments that contain credentials. This approach assumes that command don't output passwords to stderr.

Example:

errors:
    - severity: Error
      description: exit status 1
    - severity: Error
      description: 'Pod failed: Error'
activity:
    - Fetching application.
    - '[CMD] Running: /usr/bin/ssh-agent -a /tmp/agent.736692'
    - '[CMD] succeeded.'
    - '[SSH] Agent started.'
    - '[MVN] Using settings file(path=/home/jortel/tmp/addon/settings.xml).'
    - '[SVN] Cloning: http://3.19.255.219/repos/trunk'
    - '[SVN] Using credentials (id=3) SVN.'
    - '[CMD] /usr/bin/svn failed: exit status 1.'
    - '> svn: warning: W170000: URL ''http://3.19.255.219/repos/trunk'' non-existent in revision 3'
    - '> '
    - '> svn: E200009: Could not display info for all targets because some targets don''t exist'
    - '> '

Signed-off-by: Jeff Ortel <jortel@redhat.com>
Copy link
Contributor

@dymurray dymurray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worked great for me, thanks Jeff!

@dymurray dymurray merged commit 31d1afa into konveyor:main Nov 22, 2023
6 checks passed
dymurray pushed a commit to dymurray/tackle2-addon that referenced this pull request Nov 22, 2023
…onveyor#46)

Update RunSilent() to not fail silently. Currently the returned error is
reported as "exit code: 1" which isn't useful for troubleshooting.

The primary goal for RunSilent() is to quietly run the command. One
purpose is to prevent reporting arguments that contain credentials. This
approach assumes that command don't output passwords to _stderr_.

Example:
```
errors:
    - severity: Error
      description: exit status 1
    - severity: Error
      description: 'Pod failed: Error'
activity:
    - Fetching application.
    - '[CMD] Running: /usr/bin/ssh-agent -a /tmp/agent.736692'
    - '[CMD] succeeded.'
    - '[SSH] Agent started.'
    - '[MVN] Using settings file(path=/home/jortel/tmp/addon/settings.xml).'
    - '[SVN] Cloning: http://3.19.255.219/repos/trunk'
    - '[SVN] Using credentials (id=3) SVN.'
    - '[CMD] /usr/bin/svn failed: exit status 1.'
    - '> svn: warning: W170000: URL ''http://3.19.255.219/repos/trunk'' non-existent in revision 3'
    - '> '
    - '> svn: E200009: Could not display info for all targets because some targets don''t exist'
    - '> '
```

Signed-off-by: Jeff Ortel <jortel@redhat.com>
(cherry picked from commit 31d1afa)
dymurray pushed a commit to dymurray/tackle2-addon that referenced this pull request Nov 22, 2023
…onveyor#46)

Update RunSilent() to not fail silently. Currently the returned error is
reported as "exit code: 1" which isn't useful for troubleshooting.

The primary goal for RunSilent() is to quietly run the command. One
purpose is to prevent reporting arguments that contain credentials. This
approach assumes that command don't output passwords to _stderr_.

Example:
```
errors:
    - severity: Error
      description: exit status 1
    - severity: Error
      description: 'Pod failed: Error'
activity:
    - Fetching application.
    - '[CMD] Running: /usr/bin/ssh-agent -a /tmp/agent.736692'
    - '[CMD] succeeded.'
    - '[SSH] Agent started.'
    - '[MVN] Using settings file(path=/home/jortel/tmp/addon/settings.xml).'
    - '[SVN] Cloning: http://3.19.255.219/repos/trunk'
    - '[SVN] Using credentials (id=3) SVN.'
    - '[CMD] /usr/bin/svn failed: exit status 1.'
    - '> svn: warning: W170000: URL ''http://3.19.255.219/repos/trunk'' non-existent in revision 3'
    - '> '
    - '> svn: E200009: Could not display info for all targets because some targets don''t exist'
    - '> '
```

Signed-off-by: Jeff Ortel <jortel@redhat.com>
(cherry picked from commit 31d1afa)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants