Skip to content

Commit

Permalink
Remove vendor dir (#1962)
Browse files Browse the repository at this point in the history
  • Loading branch information
cardil authored Aug 29, 2024
1 parent de30b7b commit bb1f899
Show file tree
Hide file tree
Showing 5,973 changed files with 69 additions and 1,699,302 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 0 additions & 1 deletion .codecov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@ ignore:
- "pkg/client"
- "test"
- "third_party"
- "vendor"
21 changes: 11 additions & 10 deletions hack/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ source_lint() {
go_build() {
echo "🚧 Compile"
# Env var exported by hack/build-flags.sh
go build -mod=vendor -ldflags "${KN_BUILD_LD_FLAGS:-}" -o kn ./cmd/...
go build -ldflags "${KN_BUILD_LD_FLAGS:-}" -o kn ./cmd/...

if file kn | grep -q -i "Windows"; then
mv kn kn.exe
Expand Down Expand Up @@ -179,7 +179,7 @@ check_license() {
local check_output
check_output="$(mktemp /tmp/kn-client-licence-check.XXXXXX)"
for ext in "${extensions_to_check[@]}"; do
find . -name "*.$ext" -a \! -path "./vendor/*" -a \! -path "./.*" -a \! -path "./third_party/*" -print0 |
find . -name "*.$ext" -a \! -path "./.*" -a \! -path "./third_party/*" -print0 |
while IFS= read -r -d '' path; do
for rword in "${required_keywords[@]}"; do
if ! grep -q "$rword" "$path"; then
Expand Down Expand Up @@ -287,19 +287,19 @@ cross_build() {

export CGO_ENABLED=0
echo " 🐧 kn-linux-amd64"
GOOS=linux GOARCH=amd64 go build -mod=vendor -ldflags "${ld_flags}" -o ./kn-linux-amd64 ./cmd/... || failed=1
GOOS=linux GOARCH=amd64 go build -ldflags "${ld_flags}" -o ./kn-linux-amd64 ./cmd/... || failed=1
echo " 💪 kn-linux-arm64"
GOOS=linux GOARCH=arm64 go build -mod=vendor -ldflags "${ld_flags}" -o ./kn-linux-arm64 ./cmd/... || failed=1
GOOS=linux GOARCH=arm64 go build -ldflags "${ld_flags}" -o ./kn-linux-arm64 ./cmd/... || failed=1
echo " 🍏 kn-darwin-amd64"
GOOS=darwin GOARCH=amd64 go build -mod=vendor -ldflags "${ld_flags}" -o ./kn-darwin-amd64 ./cmd/... || failed=1
GOOS=darwin GOARCH=amd64 go build -ldflags "${ld_flags}" -o ./kn-darwin-amd64 ./cmd/... || failed=1
echo " 🍎 kn-darwin-arm64"
GOOS=darwin GOARCH=arm64 go build -mod=vendor -ldflags "${ld_flags}" -o ./kn-darwin-arm64 ./cmd/... || failed=1
GOOS=darwin GOARCH=arm64 go build -ldflags "${ld_flags}" -o ./kn-darwin-arm64 ./cmd/... || failed=1
echo " 🎠 kn-windows-amd64.exe"
GOOS=windows GOARCH=amd64 go build -mod=vendor -ldflags "${ld_flags}" -o ./kn-windows-amd64.exe ./cmd/... || failed=1
GOOS=windows GOARCH=amd64 go build -ldflags "${ld_flags}" -o ./kn-windows-amd64.exe ./cmd/... || failed=1
echo " Z kn-linux-s390x"
GOOS=linux GOARCH=s390x go build -mod=vendor -ldflags "${ld_flags}" -o ./kn-linux-s390x ./cmd/... || failed=1
GOOS=linux GOARCH=s390x go build -ldflags "${ld_flags}" -o ./kn-linux-s390x ./cmd/... || failed=1
echo " P kn-linux-ppc64le"
GOOS=linux GOARCH=ppc64le go build -mod=vendor -ldflags "${ld_flags}" -o ./kn-linux-ppc64le ./cmd/... || failed=1
GOOS=linux GOARCH=ppc64le go build -ldflags "${ld_flags}" -o ./kn-linux-ppc64le ./cmd/... || failed=1

return ${failed}
}
Expand Down Expand Up @@ -368,7 +368,8 @@ if has_flag --debug; then
fi

# Shared funcs from hack repo
source "$(basedir)"/vendor/knative.dev/hack/library.sh
# shellcheck disable=SC1090
source "$(go run knative.dev/hack/cmd/script library.sh)"

# Shared funcs with CI
while IFS= read -r -d '' file; do
Expand Down
19 changes: 10 additions & 9 deletions hack/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,29 @@
# Documentation about this script and how to use it can be found
# at https://github.com/knative/hack

source $(dirname $0)/../vendor/knative.dev/hack/release.sh
# shellcheck disable=SC1090
source "$(go run knative.dev/hack/cmd/script release.sh)"

function build_release() {
# Env var exported by hack/build-flags.sh
source $(dirname $0)/build-flags.sh
source "$(dirname "$0")/build-flags.sh"
local ld_flags="${KN_BUILD_LD_FLAGS:-}"

export CGO_ENABLED=0
echo "🚧 🐧 Building for Linux (amd64)"
GOOS=linux GOARCH=amd64 go build -mod=vendor -ldflags "${ld_flags}" -o ./kn-linux-amd64 ./cmd/...
GOOS=linux GOARCH=amd64 go build -ldflags "${ld_flags}" -o ./kn-linux-amd64 ./cmd/...
echo "🚧 💪 Building for Linux (arm64)"
GOOS=linux GOARCH=arm64 go build -mod=vendor -ldflags "${ld_flags}" -o ./kn-linux-arm64 ./cmd/...
GOOS=linux GOARCH=arm64 go build -ldflags "${ld_flags}" -o ./kn-linux-arm64 ./cmd/...
echo "🚧 🍏 Building for macOS"
GOOS=darwin GOARCH=amd64 go build -mod=vendor -ldflags "${ld_flags}" -o ./kn-darwin-amd64 ./cmd/...
GOOS=darwin GOARCH=amd64 go build -ldflags "${ld_flags}" -o ./kn-darwin-amd64 ./cmd/...
echo "🚧 🍎 Building for macOS (arm64)"
GOOS=darwin GOARCH=arm64 go build -mod=vendor -ldflags "${ld_flags}" -o ./kn-darwin-arm64 ./cmd/...
GOOS=darwin GOARCH=arm64 go build -ldflags "${ld_flags}" -o ./kn-darwin-arm64 ./cmd/...
echo "🚧 🎠 Building for Windows"
GOOS=windows GOARCH=amd64 go build -mod=vendor -ldflags "${ld_flags}" -o ./kn-windows-amd64.exe ./cmd/...
GOOS=windows GOARCH=amd64 go build -ldflags "${ld_flags}" -o ./kn-windows-amd64.exe ./cmd/...
echo "🚧 Z Building for Linux(s390x)"
GOOS=linux GOARCH=s390x go build -mod=vendor -ldflags "${ld_flags}" -o ./kn-linux-s390x ./cmd/...
GOOS=linux GOARCH=s390x go build -ldflags "${ld_flags}" -o ./kn-linux-s390x ./cmd/...
echo "🚧 P Building for Linux (ppc64le)"
GOOS=linux GOARCH=ppc64le go build -mod=vendor -ldflags "${ld_flags}" -o ./kn-linux-ppc64le ./cmd/...
GOOS=linux GOARCH=ppc64le go build -ldflags "${ld_flags}" -o ./kn-linux-ppc64le ./cmd/...
echo "🚧 🐳 Building the container image"

# Handle latest default tag in `ko` to be present only for latest releases.
Expand Down
2 changes: 1 addition & 1 deletion hack/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package tools

// This package imports things required by this repository, to force `go mod` to see them as dependencies
import (
_ "knative.dev/hack"
_ "knative.dev/hack/cmd/script" // Allow calling embedded scripts from hack
_ "knative.dev/pkg/hack"

_ "k8s.io/code-generator"
Expand Down
19 changes: 6 additions & 13 deletions hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.

set -o errexit
set -o nounset
set -o pipefail
set -Eeuo pipefail

source $(dirname $0)/../vendor/knative.dev/hack/codegen-library.sh
# shellcheck disable=SC1090
source "$(go run knative.dev/hack/cmd/script codegen-library.sh)"

# If we run with -mod=vendor here, then generate-groups.sh looks for vendor files in the wrong place.
export GOFLAGS=-mod=

echo "=== Update Codegen for $MODULE_NAME"

group "Kubernetes Codegen"

# generate the code with:
# --output-base because this script should also be able to run inside the vendor dir of
# k8s.io/kubernetes. The output-base is needed for the generators to output into the vendor dir
# instead of the $GOPATH directly. For normal projects this can be dropped.
"${CODEGEN_PKG}"/generate-groups.sh "deepcopy" \
generate-groups "deepcopy" \
knative.dev/client/pkg/apis/client/v1alpha1/generated knative.dev/client/pkg/apis \
client:v1alpha1 \
--go-header-file "${REPO_ROOT_DIR}"/hack/boilerplate.go.txt
client:v1alpha1 "$@"

group "Update deps post-codegen"

# Make sure our dependencies are up-to-date
${REPO_ROOT_DIR}/hack/update-deps.sh
"${REPO_ROOT_DIR}/hack/update-deps.sh"
3 changes: 2 additions & 1 deletion hack/update-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ set -o errexit
set -o nounset
set -o pipefail

source $(dirname $0)/../vendor/knative.dev/hack/library.sh
# shellcheck disable=SC1090
source "$(go run knative.dev/hack/cmd/script library.sh)"

go_update_deps "$@"
22 changes: 12 additions & 10 deletions hack/verify-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,18 @@ set -o errexit
set -o nounset
set -o pipefail

source $(dirname $0)/../vendor/knative.dev/hack/library.sh
# shellcheck disable=SC1090
source "$(go run knative.dev/hack/cmd/script library.sh)"

"${REPO_ROOT_DIR}"/hack/build.sh --codegen
if output="$(git status --porcelain)" && [ -z "$output" ]; then
echo "${REPO_ROOT_DIR} is up to date."
else
echo "ERROR: Modified files found:"
git status --porcelain
echo "ERROR: Diff"
git diff
echo "ERROR: ${REPO_ROOT_DIR} is out of date. Please run ./hack/build.sh -c and commit."
exit 1

if ! git diff --exit-code --name-only > /dev/null; then
error 'Modified files found:'
git diff --name-only
error 'Difference:'
git --no-pager diff
abort "${MODULE_NAME} is out of date!" "" \
"Please, run ./hack/build.sh -c and commit."
fi

header "${MODULE_NAME} is up to date."
5 changes: 3 additions & 2 deletions test/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

source $(dirname $0)/../vendor/knative.dev/hack/e2e-tests.sh
# shellcheck disable=SC1090
source "$(go run knative.dev/hack/cmd/script e2e-tests.sh)"

export INGRESS_CLASS=${INGRESS_CLASS:-istio.ingress.networking.knative.dev}

Expand Down Expand Up @@ -57,7 +58,7 @@ function install_istio() {
echo ">> Installing Istio"
echo "Istio version: ${ISTIO_VERSION}"
echo "Istio profile: ${ISTIO_PROFILE}"
kubectl apply -f ${NET_ISTIO_DIR}/third_party/istio-${ISTIO_VERSION}/${ISTIO_PROFILE%%.*}/istio.yaml
kubectl apply -f "${NET_ISTIO_DIR}/third_party/istio-${ISTIO_VERSION}/${ISTIO_PROFILE%%.*}/istio.yaml"

}

Expand Down
2 changes: 1 addition & 1 deletion test/local-e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ base=$(cd "$dir/.." && pwd)
export KN_E2E_NAMESPACE=kne2etests

echo "🧪 Testing"
go test -mod=vendor ${base}/test/e2e/ -test.v -tags "e2e ${E2E_TAGS}" "$@"
go test "${base}/test/e2e/" -test.v -tags "e2e ${E2E_TAGS}" "$@"
12 changes: 6 additions & 6 deletions test/presubmit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ export PRESUBMIT_TEST_FAIL_FAST=1
export GO111MODULE=on
export KNATIVE_SERVING_VERSION=${KNATIVE_SERVING_VERSION:-latest}
export KNATIVE_EVENTING_VERSION=${KNATIVE_EVENTING_VERSION:-latest}
source $(dirname $0)/../vendor/knative.dev/hack/presubmit-tests.sh
source $(dirname $0)/common.sh
# shellcheck disable=SC1090
source "$(go run knative.dev/hack/cmd/script presubmit-tests.sh)"
source "$(dirname "$0")/common.sh"

# Run cross platform build to ensure kn compiles for Linux, macOS and Windows
function post_build_tests() {
Expand All @@ -50,11 +51,10 @@ function post_build_tests() {
fi
}

# Run the unit tests with an additional flag '-mod=vendor' to avoid
# downloading the deps in unit tests CI job
# Run the unit tests
function unit_tests() {
report_go_test -race -mod=vendor ./... || failed=1
report_go_test -race ./... || failed=1
}

# We use the default build and integration test runners.
main $@
main "$@"
33 changes: 17 additions & 16 deletions test/upload-test-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,38 +14,39 @@
# See the License for the specific language governing permissions and
# limitations under the License.

set -o errexit
set -Eeuo pipefail

function upload_test_images() {
echo ">> Publishing test images"
# Script needs to be executed from the root directory
# to pickup .ko.yaml
cd "$( dirname "$0")/.."
local image_dir="test/test_images"
local vendor_image_dir="vendor/knative.dev/serving/test/test_images"
local docker_tag=$1
local tag_option=""
cd "$(dirname "${BASH_SOURCE[0]}")/.."
local image_dir='test/test_images'
local docker_tag="${1:-}"
local tag_option=()
if [ -n "${docker_tag}" ]; then
tag_option="--tags $docker_tag,latest"
tag_option+=(--tags "$docker_tag,latest")
fi

# If PLATFORM environment variable is specified, then images will be built for
# specific hardware architecture.
# Example of the variable values - "linux/arm64", "linux/s390x".
local platform=""
if [ -n "${PLATFORM}" ]; then
platform="--platform ${PLATFORM}"
local platform=()
if [ -n "${PLATFORM:-}" ]; then
platform+=(--platform "${PLATFORM}")
fi

# ko resolve is being used for the side-effect of publishing images,
# so the resulting yaml produced is ignored.
# We limit the number of concurrent builds (jobs) to avoid OOMs.
ko resolve --jobs=4 ${platform} ${tag_option} -RBf "${image_dir}" > /dev/null

#build and publish images from vendor directory
ko resolve --jobs=4 ${platform} ${tag_option} -RBf "${vendor_image_dir}" > /dev/null
ko \
resolve \
--jobs=4 \
"${platform[@]}" \
"${tag_option[@]}" \
-RBf "${image_dir}" > /dev/null
}

: ${KO_DOCKER_REPO:?"You must set 'KO_DOCKER_REPO'"}
: "${KO_DOCKER_REPO:?You must set 'KO_DOCKER_REPO'}"

upload_test_images $@
upload_test_images "$@"
17 changes: 0 additions & 17 deletions vendor/contrib.go.opencensus.io/exporter/ocagent/.gitignore

This file was deleted.

20 changes: 0 additions & 20 deletions vendor/contrib.go.opencensus.io/exporter/ocagent/.travis.yml

This file was deleted.

24 changes: 0 additions & 24 deletions vendor/contrib.go.opencensus.io/exporter/ocagent/CONTRIBUTING.md

This file was deleted.

Loading

0 comments on commit bb1f899

Please sign in to comment.