forked from kubevirt/kubevirt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request kubevirt#4192 from xpivarc/gosec
Add gosec to project
- Loading branch information
Showing
8 changed files
with
41 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,6 +62,7 @@ RUN set -x && \ | |
go get -v github.com/golang/protobuf/protoc-gen-go@1643683 && \ | ||
go get -v k8s.io/code-generator/cmd/[email protected] && \ | ||
go get -v sigs.k8s.io/controller-tools/cmd/[email protected] && \ | ||
go get -v github.com/securego/gosec/v2/cmd/gosec@0ce48a5 && \ | ||
go clean -cache -modcache | ||
|
||
RUN set -x && \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
VERSION=30-8.0.2 | ||
VERSION=30-8.0.33 | ||
# TODO: reenable ppc64le when new builds are available | ||
ARCHITECTURES="amd64" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ if [ -z ${KUBEVIRT_CRI} ]; then | |
fi | ||
fi | ||
|
||
KUBEVIRT_BUILDER_IMAGE="kubevirt/builder@sha256:6c40c31d8537a3a48dd95d997d0775f480ea6976368cdf9c9720febf9c7b3e60" | ||
KUBEVIRT_BUILDER_IMAGE="kubevirt/builder@sha256:3390fe22e515d653e8c2d5fb50b761f75990a9b67394120ff613cb01f15def93" | ||
|
||
SYNC_OUT=${SYNC_OUT:-true} | ||
|
||
|
@@ -135,7 +135,13 @@ fi | |
|
||
# Run the command | ||
test -t 1 && USE_TTY="-it" | ||
$KUBEVIRT_CRI exec ${USE_TTY} ${BUILDER}-bazel-server /entrypoint.sh "$@" | ||
if ! $KUBEVIRT_CRI exec ${USE_TTY} ${BUILDER}-bazel-server /entrypoint.sh "$@"; then | ||
# Copy the build output out of the container, make sure that _out exactly matches the build result | ||
if [ "$SYNC_OUT" = "true" ]; then | ||
_rsync --delete "rsync://[email protected]:${RSYNCD_PORT}/out" ${OUT_DIR} | ||
fi | ||
exit 1 | ||
fi | ||
|
||
# Copy the whole kubevirt data out to get generated sources and formatting changes | ||
_rsync \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
source hack/common.sh | ||
export ARTIFACTS=${ARTIFACTS:-$KUBEVIRT_DIR/_out/artifacts} | ||
|
||
mkdir -p $ARTIFACTS | ||
|
||
echo "Run go sec in pkg" | ||
cd $KUBEVIRT_DIR/pkg | ||
|
||
gosec -sort -quiet -out=${ARTIFACTS}/junit-gosec.xml -exclude-dir=testutils -fmt=junit-xml ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# [GOSEC](https://github.com/securego/gosec) | ||
|
||
Junit contains all issues in the project. | ||
Use `// #nosec` on top of reported line to mark issue as false positive. | ||
|
||
|