add 'k8s.io/code-generator' dependency file

This commit is contained in:
Dylan 2020-11-09 15:11:22 +08:00 committed by Siyu Wang
parent 2d63e97e2e
commit 9eab40bc9b
2 changed files with 22 additions and 2 deletions

22
hack/tools.go Normal file
View File

@ -0,0 +1,22 @@
// +build tools
/*
Copyright 2020 The Kruise 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.
*/
// This package imports things required by build scripts, to force `go mod` to see them as dependencies
package hack
import _ "k8s.io/code-generator"

View File

@ -1,9 +1,7 @@
#!/usr/bin/env bash
printf 'package hack\nimport "k8s.io/code-generator"\n' > ./hack/hold.go
go mod vendor
retVal=$?
rm -f ./hack/hold.go
if [ $retVal -ne 0 ]; then
exit $retVal
fi