add go-bindata sources to kind

This commit is contained in:
Benjamin Elder
2018-08-06 10:51:02 -07:00
parent 04c63ec1dc
commit 05e273f7d6
2 changed files with 55 additions and 0 deletions

31
hack/generate.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/bin/sh
# Copyright 2018 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# 'go generate's kind, using tools from vendor (go-bindata)
set -o errexit
REPO_ROOT=$(git rev-parse --show-toplevel)
# install go-bindata from vendor locally
OUTPUT_GOBIN="${REPO_ROOT}/_output/bin"
GOBIN="${OUTPUT_GOBIN}" go install ./vendor/github.com/jteeuwen/go-bindata/go-bindata
# go generate (using go-bindata)
# NOTE: go will only take package paths, not absolute directories
cd "${REPO_ROOT}"
PATH="${OUTPUT_GOBIN}:${PATH}" go generate ./kind/...
# gofmt the generated file
find ./kind -name "*.go" | xargs gofmt -s -w

View File

@@ -0,0 +1,24 @@
/*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Package sources contains the baked in sources kind needs to build.
// Primarily this includes the node-image dockerfile, which should rarely
// change.
// These can be overridden with newer files at build-time, see ./../build
package sources
// We pull in the sources with go-bindata
//go:generate go-bindata -nometadata -mode=0666 -pkg=$GOPACKAGE -o=images_node_sources.go -ignore=(\.*README\.md)|(\.*BUILD\.bazel) -prefix=./../../../ ./../../../images/node/...