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
MAISTRA-2155 Fix shellcheck errors in Must Gather #13
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a prow pre-submit test that runs shellcheck against this file?
In this repo, you'd need to add a lint
target in Makefile that runs shellcheck like this: https://github.com/maistra/test-infra/blob/main/Makefile#L39
Then, open a PR in test-infra adding the job.
gather_istio
Outdated
@@ -133,11 +140,11 @@ function getEnvoyConfigForPodsInNamespace() { | |||
local logPath=${BASE_COLLECTION_PATH}/namespaces/${podNamespace}/pods/${podName} | |||
mkdir -p ${logPath} | |||
|
|||
echo "Pilot config for pod ${podName}.${podNamespace} from istiod ${pilotName}.${controlPlaneNamespace}" 2>&1 1>${logPath}/pilotConfiguration | |||
oc exec ${pilotName} -n ${controlPlaneNamespace} -c discovery -- bash -c "/usr/local/bin/pilot-discovery request GET /debug/config_dump?proxyID=${podName}.${podNamespace}" 2>&1 1>${logPath}/pilotConfiguration | |||
echo "Pilot config for pod ${podName}.${podNamespace} from istiod ${pilotName}.${controlPlaneNamespace}" > ${logPath}/pilotConfiguration 2>&1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Strictly speaking 2>&1
is not necessary, I believe echo
will never fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lol. At least if it does, there are likely bigger issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to sync this change on product side - copy the script without the .sh extension or adjust the Dockerfile there
In response to a cherrypick label: #13 failed to apply on top of branch "maistra-2.1":
|
* Correct use of arrays (SC2178) * Avoid masking return values (SC2155) * Prevent whitespace problems (SC2048) * Ensure errors are written to the file instead of stdout (SC2069) * Double quote to prevent globbing and word splitting (SC2086) * Run ShellCheck on make lint
No description provided.