-
Notifications
You must be signed in to change notification settings - Fork 257
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add custom CRD clientset * nit * nit * clean up .DS_Store files --------- Co-authored-by: varungupta <[email protected]>
- Loading branch information
1 parent
1428139
commit 96ff193
Showing
52 changed files
with
3,695 additions
and
10 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 |
---|---|---|
|
@@ -23,3 +23,4 @@ go.work | |
go.work.sum | ||
.idea | ||
|
||
.DS_Store |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/bin/bash | ||
|
||
# This shell is used to auto generate some useful tools for k8s, such as clientset, lister, informer and so on. | ||
# We don't use this tool to generate deepcopy because kubebuilder (controller-tools) has coverred that part. | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. | ||
ROOT_PKG=github.com/aibrix/aibrix | ||
|
||
# Grab code-generator version from go.sum | ||
CODEGEN_VERSION=$(grep 'k8s.io/code-generator' go.sum | awk '{print $2}' | sed 's/\/go.mod//g' | head -1) | ||
CODEGEN_PKG=$(echo `go env GOPATH`"/pkg/mod/k8s.io/code-generator@${CODEGEN_VERSION}") | ||
|
||
if [[ ! -d ${CODEGEN_PKG} ]]; then | ||
echo "${CODEGEN_PKG} is missing. Running 'go mod download'." | ||
go mod download | ||
fi | ||
|
||
echo ">> Using ${CODEGEN_PKG}" | ||
|
||
# code-generator does work with go.mod but makes assumptions about | ||
# the project living in `$GOPATH/src`. To work around this and support | ||
# any location; create a temporary directory, use this as an output | ||
# base, and copy everything back once generated. | ||
TEMP_DIR=$(mktemp -d) | ||
cleanup() { | ||
echo ">> Removing ${TEMP_DIR}" | ||
# rm -rf ${TEMP_DIR} | ||
} | ||
trap "cleanup" EXIT SIGINT | ||
|
||
echo ">> Temporary output directory ${TEMP_DIR}" | ||
|
||
# Ensure we can execute. | ||
chmod +x ${CODEGEN_PKG}/generate-groups.sh | ||
|
||
# generate the code with: | ||
# --output-base because this script should also be able to run inside the vendor dir of | ||
# k8s.io/kubernetes. The output-base is needed for the generators to output into the vendor dir | ||
# instead of the $GOPATH directly. For normal projects this can be dropped. | ||
# | ||
cd ${SCRIPT_ROOT} | ||
${CODEGEN_PKG}/generate-groups.sh all \ | ||
github.com/aibrix/aibrix/pkg/client github.com/aibrix/aibrix/api \ | ||
"model:v1alpha1 autoscaling:v1alpha1" \ | ||
--output-base "${TEMP_DIR}" \ | ||
--go-header-file hack/boilerplate.go.txt | ||
|
||
# Copy everything back. | ||
cp -a "${TEMP_DIR}/${ROOT_PKG}/." "${SCRIPT_ROOT}/" |
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/bin/bash | ||
|
||
# This shell is used to auto generate some useful tools for k8s, such as clientset, lister, informer and so on. | ||
# We don't use this tool to generate deepcopy because kubebuilder (controller-tools) has coverred that part. | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. | ||
ROOT_PKG=github.com/aibrix/aibrix | ||
|
||
# Grab code-generator version from go.sum | ||
CODEGEN_VERSION=$(grep 'k8s.io/code-generator' go.sum | awk '{print $2}' | sed 's/\/go.mod//g' | head -1) | ||
CODEGEN_PKG=$(echo `go env GOPATH`"/pkg/mod/k8s.io/code-generator@${CODEGEN_VERSION}") | ||
|
||
if [[ ! -d ${CODEGEN_PKG} ]]; then | ||
echo "${CODEGEN_PKG} is missing. Running 'go mod download'." | ||
go mod download | ||
fi | ||
|
||
echo ">> Using ${CODEGEN_PKG}" | ||
|
||
# code-generator does work with go.mod but makes assumptions about | ||
# the project living in `$GOPATH/src`. To work around this and support | ||
# any location; create a temporary directory, use this as an output | ||
# base, and copy everything back once generated. | ||
TEMP_DIR=$(mktemp -d) | ||
cleanup() { | ||
echo ">> Removing ${TEMP_DIR}" | ||
# rm -rf ${TEMP_DIR} | ||
} | ||
trap "cleanup" EXIT SIGINT | ||
|
||
echo ">> Temporary output directory ${TEMP_DIR}" | ||
|
||
# Ensure we can execute. | ||
chmod +x ${CODEGEN_PKG}/generate-groups.sh | ||
|
||
# generate the code with: | ||
# --output-base because this script should also be able to run inside the vendor dir of | ||
# k8s.io/kubernetes. The output-base is needed for the generators to output into the vendor dir | ||
# instead of the $GOPATH directly. For normal projects this can be dropped. | ||
# | ||
cd ${SCRIPT_ROOT} | ||
${CODEGEN_PKG}/generate-groups.sh all \ | ||
github.com/aibrix/aibrix/pkg/client github.com/aibrix/aibrix/api \ | ||
"model:v1alpha1 autoscaling:v1alpha1" \ | ||
--output-base "${TEMP_DIR}" \ | ||
--go-header-file hack/boilerplate.go.txt | ||
|
||
# Copy everything back. | ||
cp -a "${TEMP_DIR}/${ROOT_PKG}/." "${SCRIPT_ROOT}/" |
56 changes: 56 additions & 0 deletions
56
pkg/client/applyconfiguration/autoscaling/v1alpha1/metricsource.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.