mirror of
https://github.com/kubernetes-sigs/kind.git
synced 2025-12-01 07:26:05 +07:00
add go-bindata sources to kind
This commit is contained in:
31
hack/generate.sh
Executable file
31
hack/generate.sh
Executable 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
|
||||
24
pkg/build/sources/generate.go
Normal file
24
pkg/build/sources/generate.go
Normal 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/...
|
||||
Reference in New Issue
Block a user