Skip to content
Permalink
Browse files

🏃 remove git-lfs usage

We no longer use git-lfs due to bandwidth quota issues. This
removes git-lfs usage from test scripts.
  • Loading branch information...
droot committed Jun 18, 2019
1 parent 88c65c8 commit c92f36e3b11ab3923571647e9d64bbe19a289632
Showing with 26 additions and 35 deletions.
  1. +0 −1 .gitattributes
  2. +0 −4 .travis.yml
  3. +1 −6 CONTRIBUTING.md
  4. +14 −1 common.sh
  5. +2 −7 generated_golden.sh
  6. +0 −11 test.sh
  7. +9 −2 test/e2e/e2e_v1.go
  8. +0 −3 testdata/vendor.v1.tgz
@@ -1 +0,0 @@
testdata/*.tgz filter=lfs diff=lfs merge=lfs -text
@@ -14,7 +14,6 @@ go:

git:
depth: 3
lfs_skip_smudge: true

go_import_path: sigs.k8s.io/kubebuilder

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

before_install:
- go get -u github.com/golang/dep/cmd/dep
- 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
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then GO111MODULE=on scripts/install_and_setup.sh; fi

before_script:
- git lfs install
- git lfs pull

# Install must be set to prevent default `go get` to run.
# The dependencies have already been vendored by `dep` so
@@ -7,7 +7,6 @@ Kubernetes projects require that you sign a Contributor License Agreement (CLA)
Please see https://git.k8s.io/community/CLA.md for more info.

## Contributing steps
1. Setup [Git LFS plugin](https://git-lfs.github.com/)
1. Submit an issue describing your proposed change to the repo in question.
1. The [repo owners](OWNERS) will respond to your issue promptly.
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.

## How to build kubebuilder locally

1. Setup Git LFS
Install the git-lfs plugin using the instructions from [git-lfs](https://git-lfs.github.com/) page.
Once installed, run `git lfs install` in your repo to setup git lfs hooks.

1. Build
```sh
$ go build -o /output/path/kubebuilder ./cmd
$ make build
```

1. Test
@@ -160,9 +160,22 @@ function setup_envs {
export KUBECONFIG="$(kind get kubeconfig-path --name="kind")"
}

# download_vendor_archive downloads vendor tarball for v1 projects. It skips the
# download if tarball exists.
function download_vendor_archive {
archive_name="vendor.v1.tgz"
archive_download_url="https://storage.googleapis.com/kubebuilder-vendor/$archive_name"
archive_path="$tmp_root/$archive_name"
if [ ! -f $archive_path ]; then
header_text "downloading vendor archive $archive_path"
curl -sL ${archive_download_url} -o "$archive_path"
fi
}

function restore_go_deps {
header_text "restoring Go dependencies"
tar -zxf ${go_workspace}/src/sigs.k8s.io/kubebuilder/testdata/vendor.v1.tgz
download_vendor_archive
tar -zxf $tmp_root/vendor.v1.tgz
}

function cache_project {
@@ -43,7 +43,8 @@ scaffold_test_project() {
export GO111MODULE=auto
export GOPATH=$(pwd)/../.. # go ignores vendor under testdata, so fake out a gopath
# untar Gopkg.lock and vendor directory for appropriate project version
tar -zxf $testdata_dir/vendor.v$version.tgz
download_vendor_archive
tar -zxf $tmp_root/vendor.v$version.tgz

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

set -e

if ! git lfs > /dev/null 2>&1 ; then
echo "this project requires git-lfs, see: https://git-lfs.github.com/"
echo "after installing, you'll need to git checkout ./testdata/*tgz"
exit 1
fi

build_kb
scaffold_test_project gopath/src/project 1
scaffold_test_project project-v2 2
11 test.sh
@@ -85,17 +85,6 @@ y
EOF
}

# download_vendor_archive downloads vendor tarball for v1 projects. It skips the
# download if tarball exists.
function download_vendor_archive {
archive_name="vendor.v1.tgz"
archive_download_url="https://storage.googleapis.com/kubebuilder-vendor/$archive_name"
archive_path="$tmp_root/$archive_name"
if [ ! -f $archive_path ]; then
header_text "downloading vendor archive $archive_path"
curl -sL ${archive_download_url} -o "$archive_path"
fi
}

function test_project {
project_dir=$1
@@ -53,11 +53,18 @@ var _ = Describe("kubebuilder", func() {

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

By("untar the vendor tarball")
cmd = exec.Command("tar", "-zxf", "/tmp/vendor.v1.tgz")
_, err = kbc.Run(cmd)
Expect(err).Should(Succeed())

var controllerPodName string

By("init v1 project")

This file was deleted.

0 comments on commit c92f36e

Please sign in to comment.
You can’t perform that action at this time.