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

Fix deepsource: DOK-SC2002, DOK-W1001 Useless cat and Multiple consecutive RUN #1847

Merged
merged 4 commits into from
Nov 21, 2022

Conversation

hlts2
Copy link
Collaborator

@hlts2 hlts2 commented Nov 21, 2022

Description:

As titled

Related Issue:

Versions:

  • Go Version: 1.19.2
  • Docker Version: 20.10.8
  • Kubernetes Version: 1.22.0
  • NGT Version: 1.14.8

Checklist:

Special notes for your reviewer:

Signed-off-by: hlts2 <[email protected]>
@vdaas-ci
Copy link
Collaborator

[CHATOPS:HELP] ChatOps commands.

  • 🙆‍♀️ /approve - approve
  • 💌 /changelog - replace the PR body by changelog details
  • 🍱 /format - format codes and add licenses
  • /gen-test - generate test codes
  • 🏷️ /label - add labels
  • /rebase - rebase main
  • 🔚 2️⃣ 🔚 /label actions/e2e-deploy - run E2E deploy & integration test

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Nov 21, 2022

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 145e55d
Status: ✅  Deploy successful!
Preview URL: https://3546a971.vald.pages.dev
Branch Preview URL: https://refactor-dok-sc2002-delete-c.vald.pages.dev

View logs

@hlts2 hlts2 changed the title Fix deepsource: DOK-SC2002 Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead. Fix deepsource: DOK-SC2002, DOK-W1001 Useless cat and Multiple consecutive RUN Nov 21, 2022
@hlts2 hlts2 requested review from kevindiu and vankichi November 21, 2022 03:16
@hlts2 hlts2 self-assigned this Nov 21, 2022
@hlts2 hlts2 requested a review from vankichi November 21, 2022 04:13
@@ -67,7 +67,7 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN GO_VERSION="$(< GO_VERSION)" \
&& VALD_VERSION="$(< VALD_VERSION)" \
&& GIT_COMMIT="$(git rev-list -1 HEAD)" \
&& CPU_INFO_FLAGS="$(cat /proc/cpuinfo | grep flags | cut -d " " -f 2- | head -1)" \
&& CPU_INFO_FLAGS="$(< /proc/cpuinfo | grep flags | cut -d " " -f 2- | head -1 || true)" \
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need || true here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I fixed it because with set -o pipefail, if you run a head or grep command on the right side of the pipe, the pipe will be closed and a write to the closed pipe will occur, resulting in a SIGPIPE.

@vankichi vankichi merged commit 02a2210 into main Nov 21, 2022
@vankichi vankichi deleted the refactor/DOK-SC2002/delete-cat-command branch November 21, 2022 06:26
@kpango kpango mentioned this pull request Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants