Skip to content

Commit 25f68bd

Browse files
authored
vendor: goodbye vendor (#149)
Signed-off-by: Jason Liu <jasonliu747@gmail.com>
1 parent b0f7dbe commit 25f68bd

File tree

5,959 files changed

+160
-1810484
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

5,959 files changed

+160
-1810484
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
# Ignore build and test binaries.
33
bin/
44
testbin/
5+
vendor/

.github/workflows/ci.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ jobs:
2727
- uses: golangci/golangci-lint-action@v3
2828
with:
2929
args: --verbose
30-
skip-pkg-cache: true
31-
skip-build-cache: true
3230

3331
staticcheck:
3432
runs-on: ubuntu-latest
@@ -77,7 +75,7 @@ jobs:
7775
git diff --cached --exit-code || (echo 'Please run "make manifests" to generate manifests' && exit 1);
7876
- name: Check auto-generated codes
7977
run: |
80-
make generate && git add apis &&
78+
make generate && git add pkg apis &&
8179
git diff --cached --exit-code || (echo 'Please run "make generate" to generate Go codes' && exit 1);
8280
- name: Verify gofmt
8381
run: |

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
bin
88
testbin/*
99

10+
# Go dependencies folder
11+
vendor
12+
1013
# Test binary, build with `go test -c`
1114
*.test
1215

Makefile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ KOORD_SCHEDULER_IMG ?= "${REG}/${REG_NS}/koord-scheduler:${GIT_BRANCH}-${GIT_COM
1717
ENVTEST_K8S_VERSION = 1.23
1818

1919
# Set license header files.
20-
LICENSE_HEADER_GO ?= hack/boilerplate.go.txt
20+
LICENSE_HEADER_GO ?= hack/boilerplate/boilerplate.go.txt
2121

2222
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
2323
ifeq (,$(shell go env GOBIN))
@@ -61,9 +61,8 @@ manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and Cust
6161

6262
.PHONY: generate
6363
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
64-
@hack/generate_client.sh
65-
@hack/update-scheduler-codegen.sh
6664
$(CONTROLLER_GEN) object:headerFile="$(LICENSE_HEADER_GO)" paths="./apis/..."
65+
@hack/update-codegen.sh
6766

6867
.PHONY: fmt
6968
fmt: ## Run go fmt against code.
@@ -82,7 +81,7 @@ lint-go: golangci-lint ## Lint Go code.
8281

8382
.PHONY: lint-license
8483
lint-license:
85-
$(HACK_DIR)/update-license-header.sh
84+
@hack/update-license-header.sh
8685

8786
.PHONY: test
8887
test: manifests generate fmt vet envtest ## Run tests.
@@ -174,8 +173,7 @@ undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/confi
174173
##@ Build Dependencies
175174

176175
## Location to install dependencies to
177-
PWD ?= $(shell pwd)
178-
LOCALBIN ?= $(PWD)/bin
176+
LOCALBIN ?= $(shell pwd)/bin
179177
$(LOCALBIN):
180178
mkdir -p $(LOCALBIN)
181179

hack/fix_crd_plural.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
11
#!/usr/bin/env bash
2+
#
3+
# Copyright 2017 The Kubernetes Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
217

318
# replace corrected plural/singular name of nodeslo crd.
419
sed -in-place -e 's/ name: nodesloes.slo.koordinator.sh/ name: nodeslos.slo.koordinator.sh/g' config/crd/bases/slo.koordinator.sh_nodesloes.yaml

vendor/k8s.io/code-generator/generate-groups.sh renamed to hack/generate-groups.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
2+
#
33
# Copyright 2017 The Kubernetes Authors.
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,6 +13,7 @@
1313
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
16+
#
1617

1718
set -o errexit
1819
set -o nounset
@@ -47,10 +48,10 @@ GROUPS_WITH_VERSIONS="$4"
4748
shift 4
4849

4950
(
50-
# To support running this script from anywhere, we have to first cd into this directory
51-
# so we can install the tools.
51+
# To support running this script from anywhere, first cd into this directory,
52+
# and then install with forced module mode on and fully qualified name.
5253
cd "$(dirname "${0}")"
53-
go install ./cmd/{defaulter-gen,client-gen,lister-gen,informer-gen,deepcopy-gen}
54+
GO111MODULE=on go install k8s.io/code-generator/cmd/{defaulter-gen,client-gen,lister-gen,informer-gen,deepcopy-gen}
5455
)
5556
# Go installs the above commands to get installed in $GOBIN if defined, and $GOPATH/bin otherwise:
5657
GOBIN="$(go env GOBIN)"
@@ -71,7 +72,7 @@ done
7172

7273
if [ "${GENS}" = "all" ] || grep -qw "deepcopy" <<<"${GENS}"; then
7374
echo "Generating deepcopy funcs"
74-
"${gobin}/deepcopy-gen" --input-dirs "$(codegen::join , "${FQ_APIS[@]}")" -O zz_generated.deepcopy --bounding-dirs "${APIS_PKG}" "$@"
75+
"${gobin}/deepcopy-gen" --input-dirs "$(codegen::join , "${FQ_APIS[@]}")" -O zz_generated.deepcopy "$@"
7576
fi
7677

7778
if [ "${GENS}" = "all" ] || grep -qw "client" <<<"${GENS}"; then
@@ -92,4 +93,4 @@ if [ "${GENS}" = "all" ] || grep -qw "informer" <<<"${GENS}"; then
9293
--listers-package "${OUTPUT_PKG}/listers" \
9394
--output-package "${OUTPUT_PKG}/informers" \
9495
"$@"
95-
fi
96+
fi

vendor/k8s.io/code-generator/generate-internal-groups.sh renamed to hack/generate-internal-groups.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
2+
#
33
# Copyright 2017 The Kubernetes Authors.
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,6 +13,7 @@
1313
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
16+
#
1617

1718
set -o errexit
1819
set -o nounset
@@ -47,7 +48,12 @@ EXT_APIS_PKG="$4"
4748
GROUPS_WITH_VERSIONS="$5"
4849
shift 5
4950

50-
go install ./"$(dirname "${0}")"/cmd/{defaulter-gen,conversion-gen,client-gen,lister-gen,informer-gen,deepcopy-gen,openapi-gen}
51+
(
52+
# To support running this script from anywhere, first cd into this directory,
53+
# and then install with forced module mode on and fully qualified name.
54+
cd "$(dirname "${0}")"
55+
GO111MODULE=on go install k8s.io/code-generator/cmd/{defaulter-gen,conversion-gen,client-gen,lister-gen,informer-gen,deepcopy-gen,openapi-gen}
56+
)
5157

5258
function codegen::join() { local IFS="$1"; shift; echo "$*"; }
5359

@@ -72,7 +78,7 @@ done
7278

7379
if [ "${GENS}" = "all" ] || grep -qw "deepcopy" <<<"${GENS}"; then
7480
echo "Generating deepcopy funcs"
75-
"${GOPATH}/bin/deepcopy-gen" --input-dirs "$(codegen::join , "${ALL_FQ_APIS[@]}")" -O zz_generated.deepcopy --bounding-dirs "${INT_APIS_PKG},${EXT_APIS_PKG}" "$@"
81+
"${GOPATH}/bin/deepcopy-gen" --input-dirs "$(codegen::join , "${ALL_FQ_APIS[@]}")" -O zz_generated.deepcopy "$@"
7682
fi
7783

7884
if [ "${GENS}" = "all" ] || grep -qw "defaulter" <<<"${GENS}"; then
@@ -119,4 +125,4 @@ if [ "${GENS}" = "all" ] || grep -qw "openapi" <<<"${GENS}"; then
119125
--output-package "${OUTPUT_PKG}/openapi" \
120126
-O zz_generated.openapi \
121127
"$@"
122-
fi
128+
fi
Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
#!/usr/bin/env bash
2-
3-
#Copyright 2022 The Koordinator Authors.
4-
5-
#Licensed under the Apache License, Version 2.0 (the "License");
6-
#you may not use this file except in compliance with the License.
7-
#You may obtain a copy of the License at
8-
9-
# http://www.apache.org/licenses/LICENSE-2.0
10-
11-
#Unless required by applicable law or agreed to in writing, software
12-
#distributed under the License is distributed on an "AS IS" BASIS,
13-
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
#See the License for the specific language governing permissions and
15-
#limitations under the License.
2+
#
3+
# Copyright 2017 The Kubernetes Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
1617

1718
set -o errexit
1819
set -o nounset

hack/generate_client.sh

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)