Skip to content

Commit 8c3ed6f

Browse files
committed
hack/build-go.sh: Compress cluster-version-operator-tests binary
Compress the openshift-tests extension binary. Use `--force` to overwrite the output file if already present to speed up local development. Use `--keep` to keep the original binary after compressing it so that a developer may use it. Compressing because [1]: > Statically linked binaries are prohibited in FIPS and will > cause failures if detected by product pipeline scans. To > avoid this, extension binaries should be gzipped before > being committed to container images. Such a compressed binary can be then extracted as per [1]: > After discovering a test extension binary, the origin test framework will > extract the binary from the container image which carries it and store it > in /tmp storage of the pod in which it is running. > > If the binary-path ends in .gz, the binary will be decompressed. [1]: https://github.com/openshift/enhancements/blob/c2c0d43e3cd70cf79bc2b101ceb6a03c5e0114a8/enhancements/testing/openshift-tests-extension.md
1 parent 02ae693 commit 8c3ed6f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

hack/build-go.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ GO_COMPLIANCE_POLICY="exempt_all" CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH}
4747
-o "${BIN_PATH}/cluster-version-operator-tests" \
4848
"${REPO}/cmd/cluster-version-operator-tests/..."
4949

50+
echo "Compressing the cluster-version-operator-tests binary"
51+
gzip --keep --force "${BIN_PATH}/cluster-version-operator-tests"
52+
5053
# Build the cluster-version-operator binary
5154
GLDFLAGS+="-X ${REPO}/pkg/version.Raw=${VERSION_OVERRIDE}"
5255
echo "Building ${REPO} cluster-version-operator binary (${VERSION_OVERRIDE})"

0 commit comments

Comments
 (0)