Skip to content

Commit 4e793d6

Browse files
committed
feat: New ScalingSet CRD to deploy isolated interceptors+scalers
Signed-off-by: Jorge Turrado <[email protected]>
1 parent 7d1740a commit 4e793d6

File tree

70 files changed

+5474
-104
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+5474
-104
lines changed

.github/workflows/tests.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,13 @@ jobs:
6666
- name: Test
6767
run: ARCH=${{ matrix.name }} make test
6868

69+
- name: Test Summary
70+
uses: test-summary/action@032c8a9cec6aaa3c20228112cae6ca10a3b29336 # v2.3
71+
with:
72+
paths: |
73+
test-report.xml
74+
if: always()
75+
6976
statics:
7077
name: Static Checks
7178
runs-on: ubuntu-latest

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -362,3 +362,6 @@ admin/Cargo.lock
362362
*.csr
363363
*.srl
364364
*.ext
365+
366+
# test results
367+
test-report.xml

.golangci.yml

+4
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ issues:
5252
- dupl
5353
- unparam
5454
- revive
55+
- path: tests
56+
linters:
57+
- stylecheck
58+
- revive
5559
# Exclude gci check for //+kubebuilder:scaffold:imports comments. Waiting to
5660
# resolve https://github.com/kedacore/keda/issues/4379
5761
- path: operator/controllers/http/suite_test.go

Makefile

+17-4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ GO_LDFLAGS="-X github.com/kedacore/http-add-on/pkg/build.version=${VERSION} -X g
3232
GIT_COMMIT ?= $(shell git rev-list -1 HEAD)
3333
GIT_COMMIT_SHORT ?= $(shell git rev-parse --short HEAD)
3434

35+
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
36+
ENVTEST_K8S_VERSION = 1.29
37+
3538
define DOMAINS
3639
basicConstraints=CA:FALSE
3740
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
@@ -71,13 +74,19 @@ clean-test-certs:
7174
rm -r certs || true
7275

7376
# Test targets
74-
test: fmt vet test-certs
75-
go test ./...
7677

77-
e2e-test:
78+
.PHONY: install-test-deps
79+
install-test-deps:
80+
go install github.com/jstemmer/go-junit-report/v2@latest
81+
go install gotest.tools/gotestsum@latest
82+
83+
test: fmt vet test-certs install-test-deps envtest
84+
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" gotestsum --junitfile test-report.xml
85+
86+
e2e-test: install-test-deps
7887
go run -tags e2e ./tests/run-all.go
7988

80-
e2e-test-local:
89+
e2e-test-local: install-test-deps
8190
SKIP_SETUP=true go run -tags e2e ./tests/run-all.go
8291

8392
# Docker targets
@@ -160,6 +169,10 @@ lint: ## Run golangci-lint against code.
160169
pre-commit: ## Run static-checks.
161170
pre-commit run --all-files
162171

172+
ENVTEST = $(shell pwd)/bin/setup-envtest
173+
envtest: ## Install envtest-setup if necessary.
174+
GOBIN=$(shell pwd)/bin go install sigs.k8s.io/controller-runtime/tools/setup-envtest
175+
163176
CONTROLLER_GEN = $(shell pwd)/bin/controller-gen
164177
controller-gen: ## Download controller-gen locally if necessary.
165178
GOBIN=$(shell pwd)/bin go install sigs.k8s.io/controller-tools/cmd/[email protected]

config/crd/bases/http.keda.sh_clusterhttpscalingsets.yaml

+361
Large diffs are not rendered by default.

config/crd/bases/http.keda.sh_httpscaledobjects.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,22 @@ spec:
151151
type: string
152152
type: object
153153
type: object
154+
scalingSet:
155+
description: |-
156+
ScalingSet to be used for this HTTPScaledObject, if empty, default
157+
interceptor and scaler will be used
158+
properties:
159+
kind:
160+
description: Kind of the resource being referred to. Defaults
161+
to HTTPScalingSet.
162+
enum:
163+
- HTTPScalingSet
164+
- ClusterHTTPScalingSet
165+
type: string
166+
name:
167+
description: Name of the scaling set
168+
type: string
169+
type: object
154170
targetPendingRequests:
155171
description: (optional) DEPRECATED (use SscalingMetric instead) Target
156172
metric value

0 commit comments

Comments
 (0)