Skip to content

Commit c92f36e

Browse files
committed
🏃 remove git-lfs usage
We no longer use git-lfs due to bandwidth quota issues. This removes git-lfs usage from test scripts.
1 parent 88c65c8 commit c92f36e

8 files changed

+26
-35
lines changed

.gitattributes

-1
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
testdata/*.tgz filter=lfs diff=lfs merge=lfs -text

.travis.yml

-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ go:
1414

1515
git:
1616
depth: 3
17-
lfs_skip_smudge: true
1817

1918
go_import_path: sigs.k8s.io/kubebuilder
2019

@@ -23,12 +22,9 @@ services:
2322

2423
before_install:
2524
- go get -u github.com/golang/dep/cmd/dep
26-
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl -sL https://github.com/git-lfs/git-lfs/releases/download/v2.7.2/git-lfs-darwin-amd64-v2.7.2.tar.gz | tar -xz git-lfs; fi
2725
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then GO111MODULE=on scripts/install_and_setup.sh; fi
2826

2927
before_script:
30-
- git lfs install
31-
- git lfs pull
3228

3329
# Install must be set to prevent default `go get` to run.
3430
# The dependencies have already been vendored by `dep` so

CONTRIBUTING.md

+1-6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ Kubernetes projects require that you sign a Contributor License Agreement (CLA)
77
Please see https://git.k8s.io/community/CLA.md for more info.
88

99
## Contributing steps
10-
1. Setup [Git LFS plugin](https://git-lfs.github.com/)
1110
1. Submit an issue describing your proposed change to the repo in question.
1211
1. The [repo owners](OWNERS) will respond to your issue promptly.
1312
1. If your proposed change is accepted, and you haven't already done so, sign a Contributor License Agreement (see details above).
@@ -16,13 +15,9 @@ Please see https://git.k8s.io/community/CLA.md for more info.
1615

1716
## How to build kubebuilder locally
1817

19-
1. Setup Git LFS
20-
Install the git-lfs plugin using the instructions from [git-lfs](https://git-lfs.github.com/) page.
21-
Once installed, run `git lfs install` in your repo to setup git lfs hooks.
22-
2318
1. Build
2419
```sh
25-
$ go build -o /output/path/kubebuilder ./cmd
20+
$ make build
2621
```
2722

2823
1. Test

common.sh

+14-1
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,22 @@ function setup_envs {
160160
export KUBECONFIG="$(kind get kubeconfig-path --name="kind")"
161161
}
162162

163+
# download_vendor_archive downloads vendor tarball for v1 projects. It skips the
164+
# download if tarball exists.
165+
function download_vendor_archive {
166+
archive_name="vendor.v1.tgz"
167+
archive_download_url="https://storage.googleapis.com/kubebuilder-vendor/$archive_name"
168+
archive_path="$tmp_root/$archive_name"
169+
if [ ! -f $archive_path ]; then
170+
header_text "downloading vendor archive $archive_path"
171+
curl -sL ${archive_download_url} -o "$archive_path"
172+
fi
173+
}
174+
163175
function restore_go_deps {
164176
header_text "restoring Go dependencies"
165-
tar -zxf ${go_workspace}/src/sigs.k8s.io/kubebuilder/testdata/vendor.v1.tgz
177+
download_vendor_archive
178+
tar -zxf $tmp_root/vendor.v1.tgz
166179
}
167180

168181
function cache_project {

generated_golden.sh

+2-7
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ scaffold_test_project() {
4343
export GO111MODULE=auto
4444
export GOPATH=$(pwd)/../.. # go ignores vendor under testdata, so fake out a gopath
4545
# untar Gopkg.lock and vendor directory for appropriate project version
46-
tar -zxf $testdata_dir/vendor.v$version.tgz
46+
download_vendor_archive
47+
tar -zxf $tmp_root/vendor.v$version.tgz
4748

4849
$kb init --project-version $version --domain testproject.org --license apache2 --owner "The Kubernetes authors" --dep=false
4950
$kb create api --group crew --version v1 --kind FirstMate --controller=true --resource=true --make=false
@@ -80,12 +81,6 @@ scaffold_test_project() {
8081

8182
set -e
8283

83-
if ! git lfs > /dev/null 2>&1 ; then
84-
echo "this project requires git-lfs, see: https://git-lfs.github.com/"
85-
echo "after installing, you'll need to git checkout ./testdata/*tgz"
86-
exit 1
87-
fi
88-
8984
build_kb
9085
scaffold_test_project gopath/src/project 1
9186
scaffold_test_project project-v2 2

test.sh

-11
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,6 @@ y
8585
EOF
8686
}
8787

88-
# download_vendor_archive downloads vendor tarball for v1 projects. It skips the
89-
# download if tarball exists.
90-
function download_vendor_archive {
91-
archive_name="vendor.v1.tgz"
92-
archive_download_url="https://storage.googleapis.com/kubebuilder-vendor/$archive_name"
93-
archive_path="$tmp_root/$archive_name"
94-
if [ ! -f $archive_path ]; then
95-
header_text "downloading vendor archive $archive_path"
96-
curl -sL ${archive_download_url} -o "$archive_path"
97-
fi
98-
}
9988

10089
function test_project {
10190
project_dir=$1

test/e2e/e2e_v1.go

+9-2
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,18 @@ var _ = Describe("kubebuilder", func() {
5353

5454
It("should generate a runnable project", func() {
5555
// prepare v1 vendor
56-
By("untar the vendor tarball")
57-
cmd := exec.Command("tar", "-zxf", "../../../testdata/vendor.v1.tgz")
56+
By("downloading the vendor tarball")
57+
cmd := exec.Command("wget",
58+
"https://storage.googleapis.com/kubebuilder-vendor/vendor.v1.tgz",
59+
"-O", "/tmp/vendor.v1.tgz")
5860
_, err := kbc.Run(cmd)
5961
Expect(err).Should(Succeed())
6062

63+
By("untar the vendor tarball")
64+
cmd = exec.Command("tar", "-zxf", "/tmp/vendor.v1.tgz")
65+
_, err = kbc.Run(cmd)
66+
Expect(err).Should(Succeed())
67+
6168
var controllerPodName string
6269

6370
By("init v1 project")

testdata/vendor.v1.tgz

-3
This file was deleted.

0 commit comments

Comments
 (0)