This repository has been archived by the owner on Nov 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copy codegen package locally so it can be compiled
The k8s.io/code-generator package version needed to produce code compatible with client-go@v11 is old enough that it won't work with `go mod`. To be able to use it, we have to copy it locally and let it be compiled there.
- Loading branch information
Showing
3 changed files
with
20 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,12 +4,23 @@ set -o errexit | |
set -o nounset | ||
set -o pipefail | ||
|
||
# This corresponds to the tag kubernetes-1.14.4, and to the pinned version in go.mod | ||
CODEGEN_VERSION="[email protected]" | ||
SCRIPT_ROOT=$(dirname ${BASH_SOURCE})/../.. | ||
CODEGEN_PKG=${CODEGEN_PKG:-$(echo `go env GOPATH`'/pkg/mod/k8s.io/[email protected]')} | ||
|
||
go mod download # make sure the code-generator is downloaded | ||
env GOPATH=`go env GOPATH` bash ${CODEGEN_PKG}/generate-groups.sh all github.com/weaveworks/flux/integrations/client \ | ||
# Chosen to line up with the ./build directory used in the Makefile | ||
CODEGEN_ROOT=./build/codegen | ||
rm -rf ${CODEGEN_ROOT} | ||
mkdir -p ${CODEGEN_ROOT} | ||
echo Using codegen in ${CODEGEN_ROOT} | ||
|
||
export GO111MODULE=on | ||
# make sure the codegen module has been fetched | ||
go mod download | ||
cp -R $(echo `go env GOPATH`)'/pkg/mod/k8s.io/'${CODEGEN_VERSION} ${CODEGEN_ROOT} | ||
chmod -R u+w ${CODEGEN_ROOT} | ||
|
||
bash "${CODEGEN_ROOT}/generate-groups.sh" all github.com/weaveworks/flux/integrations/client \ | ||
github.com/weaveworks/flux/integrations/apis \ | ||
"flux.weave.works:v1beta1 helm.integrations.flux.weave.works:v1alpha2" \ | ||
--go-header-file "${SCRIPT_ROOT}/bin/helm/custom-boilerplate.go.txt" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters