build: add ginkgo aliases for WHAT

The alias for vendor/github.com/onsi/ginkgo/ginkgo ensures that code like
30e99cb2a9/experiment/kind-conformance-image-e2e.sh (L110)
continues to work. The one without "vendor/" is there just in case that it
was used because it also worked.

Long term, "ginkgo" is a nicer, version independent alias. It gets used
internally to avoid future churn and gets documented also publicly in the
Makefile help.

The caveat is that there's no guarantee that a future v3 CLI will be compatible
with current invocations. But the most common usage is through
hack/ginkgo-e2e.sh, which can deal with such differences.
This commit is contained in:
Patrick Ohly 2022-06-08 08:37:45 +02:00 committed by Dave Chen
parent 05c513d5bf
commit f7427d07e0
2 changed files with 13 additions and 4 deletions

View File

@ -70,6 +70,8 @@ define ALL_HELP_INFO
# WHAT: Directory names to build. If any of these directories has a 'main'
# package, the build will produce executable files under $(OUT_DIR)/bin.
# If not specified, "everything" will be built.
# "vendor/<module>/<path>" is accepted as alias for "<module>/<path>".
# "ginkgo" is an alias for the ginkgo CLI.
# GOFLAGS: Extra flags to pass to 'go' when building.
# GOLDFLAGS: Extra linking flags passed to 'go' when building.
# GOGCFLAGS: Additional go compile flags passed to 'go' when building.

View File

@ -111,7 +111,7 @@ readonly KUBE_SERVER_IMAGE_BINARIES=("${KUBE_SERVER_IMAGE_TARGETS[@]##*/}")
kube::golang::conformance_image_targets() {
# NOTE: this contains cmd targets for kube::release::build_conformance_image
local targets=(
github.com/onsi/ginkgo/v2/ginkgo
ginkgo
test/e2e/e2e.test
test/conformance/image/go-runner
cmd/kubectl
@ -274,7 +274,7 @@ kube::golang::test_targets() {
cmd/genyaml
cmd/genswaggertypedocs
cmd/linkcheck
github.com/onsi/ginkgo/v2/ginkgo
ginkgo
test/e2e/e2e.test
test/conformance/image/go-runner
)
@ -301,7 +301,7 @@ readonly KUBE_TEST_PORTABLE=(
kube::golang::server_test_targets() {
local targets=(
cmd/kubemark
github.com/onsi/ginkgo/v2/ginkgo
ginkgo
)
if [[ "${OSTYPE:-}" == "linux"* ]]; then
@ -382,7 +382,14 @@ kube::golang::is_statically_linked_library() {
kube::golang::binaries_from_targets() {
local target
for target; do
if [[ "${target}" =~ ^([[:alnum:]]+".")+[[:alnum:]]+"/" ]]; then
if [ "${target}" = "ginkgo" ] ||
[ "${target}" = "github.com/onsi/ginkgo/ginkgo" ] ||
[ "${target}" = "vendor/github.com/onsi/ginkgo/ginkgo" ]; then
# Aliases that build the ginkgo CLI for hack/ginkgo-e2e.sh.
# "ginkgo" is the one that is documented in the Makefile. The others
# are for backwards compatibility.
echo "github.com/onsi/ginkgo/v2/ginkgo"
elif [[ "${target}" =~ ^([[:alnum:]]+".")+[[:alnum:]]+"/" ]]; then
# If the target starts with what looks like a domain name, assume it has a
# fully-qualified package name rather than one that needs the Kubernetes
# package prepended.