Skip to content

Commit

Permalink
BUILD: order api pkgs for code-generator consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
hdurand0710 committed Dec 22, 2023
1 parent 9fc8d9c commit 6e27721
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 26 deletions.
1 change: 1 addition & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ diff-crd:
tags:
- go
before_script:
- go version
- make cr_generate
script:
- git diff
Expand Down
5 changes: 3 additions & 2 deletions crs/code-generator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ CR_DIR=$(dirname "$0")
OUTPUT_DIR="${CR_DIR}/.generated"
HDR_FILE="${CR_DIR}/../assets/license-header.txt"
CR_PKG="github.com/haproxytech/kubernetes-ingress/crs"
API_PKGS=$(find ${CR_DIR}/api -mindepth 2 -type d -printf "$CR_PKG/api/%P,")
API_PKGS=$(find ${CR_DIR}/api -mindepth 2 -type d -printf "$CR_PKG/api/%P\n"| sort | tr '\n' ',')
API_PKGS=${API_PKGS::-1} # remove trailing ","

# Install Kubernetes Code Generators from k8s.io/code-generator
Expand All @@ -21,7 +21,6 @@ GOBIN="$(go env GOBIN)"
gobin="${GOBIN:-$(go env GOPATH)/bin}"
go install k8s.io/code-generator/cmd/{deepcopy-gen,register-gen,client-gen,lister-gen,informer-gen,defaulter-gen}@$VERSION


# Generate Code
echo "Generating code for $API_PKGS"

Expand Down Expand Up @@ -77,4 +76,6 @@ cp -r ${OUTPUT_DIR}/${CR_PKG}/generated/{clientset,listers,informers} ${CR_DIR}/
rm -rf ${OUTPUT_DIR}

go install sigs.k8s.io/controller-tools/cmd/controller-gen@latest
# Controller-gen version
echo "Controller-gen: " $(controller-gen --version)
controller-gen crd paths=./crs/api/ingress/... output:crd:dir=./crs/definition
20 changes: 10 additions & 10 deletions crs/generated/clientset/versioned/clientset.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions crs/generated/clientset/versioned/fake/clientset_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crs/generated/clientset/versioned/fake/register.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crs/generated/clientset/versioned/scheme/register.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions crs/generated/informers/externalversions/core/interface.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6e27721

Please sign in to comment.