Skip to content

Commit

Permalink
MINOR: add acls and http requests in backend CRD
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanmatmati committed Sep 9, 2024
1 parent 5676edd commit 87733bf
Show file tree
Hide file tree
Showing 20 changed files with 966 additions and 33 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ linters:
enable-all: true
disable:
- ireturn
- tagliatelle
- dupl
- exhaustive
- funlen
Expand Down
4 changes: 3 additions & 1 deletion crs/api/ingress/v1/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ type Backend struct {

// BackendSpec defines the desired state of Backend
type BackendSpec struct {
Config *models.Backend `json:"config"`
Config *models.Backend `json:"config"`
Acls models.Acls `json:"acls,omitempty"`
HTTPRequests models.HTTPRequestRules `json:"http-requests,omitempty"`
}

// DeepCopyInto deepcopying the receiver into out. in must be non-nil.
Expand Down
11 changes: 6 additions & 5 deletions crs/code-generator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ API_PKGS=${API_PKGS::-1} # remove trailing ","

VERSION=$(go list -m k8s.io/api | cut -d ' ' -f2)
GOBIN="$(go env GOBIN)"
gopath="$(go env GOPATH)"
gobin="${GOBIN:-$(go env GOPATH)/bin}"
# new version is completly broken (with breaking changes \o/) use old one
#go install k8s.io/code-generator/cmd/{deepcopy-gen,register-gen,client-gen,lister-gen,informer-gen,defaulter-gen}@$VERSION
Expand All @@ -36,21 +37,21 @@ go install k8s.io/code-generator/cmd/{deepcopy-gen,register-gen,client-gen,liste
echo "Generating code for $API_PKGS"

echo "Generating deepcopy funcs"
"${gobin}/deepcopy-gen"\
GOPATH=$gopath "${gobin}/deepcopy-gen"\
-O zz_generated.deepcopy\
--input-dirs ${API_PKGS}\
--go-header-file ${HDR_FILE}\
--output-base ${OUTPUT_DIR}

echo "Generating register funcs"
"${gobin}/register-gen"\
GOPATH=$gopath "${gobin}/register-gen"\
-O zz_generated.register\
--input-dirs ${API_PKGS}\
--go-header-file ${HDR_FILE}\
--output-base ${OUTPUT_DIR}

echo "Generating clientset"
"${gobin}/client-gen"\
GOPATH=$gopath "${gobin}/client-gen"\
--plural-exceptions "Defaults:Defaults"\
--clientset-name "versioned"\
--input ${API_PKGS}\
Expand All @@ -60,15 +61,15 @@ echo "Generating clientset"
--output-base ${OUTPUT_DIR}

echo "Generating listers"
"${gobin}/lister-gen"\
GOPATH=$gopath "${gobin}/lister-gen"\
--plural-exceptions "Defaults:Defaults"\
--input-dirs ${API_PKGS}\
--output-package "${CR_PKG}/generated/listers"\
--go-header-file ${HDR_FILE}\
--output-base ${OUTPUT_DIR}

echo "Generating informers"
"${gobin}/informer-gen"\
GOPATH=$gopath "${gobin}/informer-gen"\
--plural-exceptions "Defaults:Defaults"\
--input-dirs ${API_PKGS}\
--versioned-clientset-package "${CR_PKG}/generated/clientset/versioned"\
Expand Down
Loading

0 comments on commit 87733bf

Please sign in to comment.