Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export GOPROXY=https://proxy.golang.org
# this is necessary for running golangci-lint in a container
export GOLANGCI_LINT_CACHE=$(shell echo $${GOLANGCI_LINT_CACHE:-$$GOPATH/cache})

GOTAGS = "containers_image_openpgp exclude_graphdriver_devicemapper exclude_graphdriver_btrfs containers_image_ostree_stub"
GOTAGS = "$(TAGS)"

all: binaries

Expand All @@ -43,11 +43,11 @@ clean:
# Example:
# make _build-component-machine-config-operator
_build-component-%:
WHAT_PATH=cmd/$* WHAT=$(basename $*) hack/build-go.sh
WHAT_PATH=cmd/$* WHAT=$(basename $*) GOTAGS=$(GOTAGS) hack/build-go.sh

# Build the helpers under devex/cmd.
_build-helper-%:
WHAT_PATH=devex/cmd/$* WHAT=$(basename $*) hack/build-go.sh
WHAT_PATH=devex/cmd/$* WHAT=$(basename $*) GOTAGS=$(GOTAGS) hack/build-go.sh

# Verify that an e2e test is valid Golang by doing a trial compilation.
_verify-e2e-%:
Expand Down
6 changes: 1 addition & 5 deletions hack/build-go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -eu
REPO=github.com/openshift/machine-config-operator
WHAT=${WHAT:-machine-config-operator}
WHAT_PATH="${WHAT_PATH:-cmd/${WHAT}}"
GOTAGS="${GOTAGS:-} ${TAGS:-}"
GOTAGS="${GOTAGS:-}"
GLDFLAGS=${GLDFLAGS:-}

eval $(go env | grep -e "GOHOSTOS" -e "GOHOSTARCH")
Expand Down Expand Up @@ -37,9 +37,5 @@ fi

mkdir -p ${BIN_PATH}

if [[ $WHAT == "machine-config-controller" ]]; then
GOTAGS="containers_image_openpgp exclude_graphdriver_devicemapper exclude_graphdriver_btrfs containers_image_ostree_stub"
fi

echo "Building ${REPO}/${WHAT_PATH} (${VERSION_OVERRIDE}, ${HASH}) for $GOOS/$GOARCH"
GOOS=${GOOS} GOARCH=${GOARCH} go build -mod=vendor -tags="${GOTAGS}" -ldflags "${GLDFLAGS} -s -w" -o ${BIN_PATH}/${WHAT} ${REPO}/${WHAT_PATH}
5 changes: 0 additions & 5 deletions hack/golangci-lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ GOTAGS="${1:-""}"
ARTIFACT_DIR="${ARTIFACT_DIR:-""}"
TIMEOUT="${2:-"10m"}" # Default timeout to 10 minutes if not provided

if [ ! -n "$GOTAGS" ]; then
echo "No Go tags provided"
exit 1
fi

cd "$REPO_ROOT"

retval=0
Expand Down
7 changes: 1 addition & 6 deletions hack/test-unit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ COVERAGE_REPORT="mco-unit-test-coverage.out"

function run_tests() {
test_opts=("$@")
CGO_ENABLED=0 go test "${test_opts[@]}" -tags="$GOTAGS" './devex/...' './cmd/...' './pkg/...' './lib/...' './test/helpers/...' | ./hack/test-with-junit.sh "$MAKEFILE_TARGET"
go test "${test_opts[@]}" -tags="${GOTAGS}" './devex/...' './cmd/...' './pkg/...' './lib/...' './test/helpers/...' | ./hack/test-with-junit.sh "$MAKEFILE_TARGET"
}

function run_tests_with_coverage() {
Expand All @@ -41,11 +41,6 @@ if [ ! -n "$MAKEFILE_TARGET" ]; then
exit 1
fi

if [ ! -n "$GOTAGS" ]; then
echo "No GOTAGS provided"
exit 1
fi

# Common options to pass to go test
test_opts=( "-v" "-count=1" )

Expand Down