Skip to content

Commit 8c8820e

Browse files
authored
Merge branch 'main' into add_idleReplicaCount
2 parents 071d083 + 8f90980 commit 8c8820e

File tree

6 files changed

+50
-30
lines changed

6 files changed

+50
-30
lines changed

Diff for: Changelog.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ This changelog keeps track of work items that have been completed and are ready
1515

1616
### Breaking Changes
1717

18-
- TODO
18+
- **General**: TODO ([#TODO](https://github.com/kedacore/http-add-on/issues/TODO))
1919

2020
### New
2121

2222
### Improvements
2323

24-
- **General**: TODO ([#TODO](https://github.com/kedacore/http-add-on/issues/TODO))
24+
- **General**: Automatically tag Docker image with commit SHA ([#567](https://github.com/kedacore/http-add-on/issues/567))
2525

2626
### Fixes
2727

Diff for: Makefile

+27-15
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,17 @@ IMAGE_REGISTRY ?= ghcr.io
77
IMAGE_REPO ?= kedacore
88
VERSION ?= main
99

10-
IMAGE_OPERATOR ?= ${IMAGE_REGISTRY}/${IMAGE_REPO}/http-add-on-operator:$(VERSION)
11-
IMAGE_INTERCEPTOR ?= ${IMAGE_REGISTRY}/${IMAGE_REPO}/http-add-on-interceptor:$(VERSION)
12-
IMAGE_SCALER ?= ${IMAGE_REGISTRY}/${IMAGE_REPO}/http-add-on-scaler:$(VERSION)
10+
IMAGE_OPERATOR ?= ${IMAGE_REGISTRY}/${IMAGE_REPO}/http-add-on-operator
11+
IMAGE_INTERCEPTOR ?= ${IMAGE_REGISTRY}/${IMAGE_REPO}/http-add-on-interceptor
12+
IMAGE_SCALER ?= ${IMAGE_REGISTRY}/${IMAGE_REPO}/http-add-on-scaler
13+
14+
IMAGE_OPERATOR_VERSIONED_TAG ?= ${IMAGE_OPERATOR}:$(VERSION)
15+
IMAGE_INTERCEPTOR_VERSIONED_TAG ?= ${IMAGE_INTERCEPTOR}:$(VERSION)
16+
IMAGE_SCALER_VERSIONED_TAG ?= ${IMAGE_SCALER}:$(VERSION)
17+
18+
IMAGE_OPERATOR_SHA_TAG ?= ${IMAGE_OPERATOR}:$(GIT_COMMIT_SHORT)
19+
IMAGE_INTERCEPTOR_SHA_TAG ?= ${IMAGE_INTERCEPTOR}:$(GIT_COMMIT_SHORT)
20+
IMAGE_SCALER_SHA_TAG ?= ${IMAGE_SCALER}:$(GIT_COMMIT_SHORT)
1321

1422
ARCH ?=amd64
1523
CGO ?=0
@@ -22,6 +30,7 @@ GO_BUILD_VARS= GO111MODULE=on CGO_ENABLED=$(CGO) GOOS=$(TARGET_OS) GOARCH=$(ARCH
2230
GO_LDFLAGS="-X github.com/kedacore/http-add-on/pkg/build.version=${VERSION} -X github.com/kedacore/http-add-on/pkg/build.gitCommit=${GIT_COMMIT}"
2331

2432
GIT_COMMIT ?= $(shell git rev-list -1 HEAD)
33+
GIT_COMMIT_SHORT ?= $(shell git rev-parse --short HEAD)
2534

2635
# Build targets
2736

@@ -45,29 +54,32 @@ e2e-test:
4554

4655
# Docker targets
4756
docker-build-operator:
48-
DOCKER_BUILDKIT=1 docker build . -t ${IMAGE_OPERATOR} -f operator/Dockerfile --build-arg VERSION=${VERSION} --build-arg GIT_COMMIT=${GIT_COMMIT}
57+
DOCKER_BUILDKIT=1 docker build . -t ${IMAGE_OPERATOR_VERSIONED_TAG} -t ${IMAGE_OPERATOR_SHA_TAG} -f operator/Dockerfile --build-arg VERSION=${VERSION} --build-arg GIT_COMMIT=${GIT_COMMIT}
4958

5059
docker-build-interceptor:
51-
DOCKER_BUILDKIT=1 docker build . -t ${IMAGE_INTERCEPTOR} -f interceptor/Dockerfile --build-arg VERSION=${VERSION} --build-arg GIT_COMMIT=${GIT_COMMIT}
60+
DOCKER_BUILDKIT=1 docker build . -t ${IMAGE_INTERCEPTOR_VERSIONED_TAG} -t ${IMAGE_INTERCEPTOR_SHA_TAG} -f interceptor/Dockerfile --build-arg VERSION=${VERSION} --build-arg GIT_COMMIT=${GIT_COMMIT}
5261

5362
docker-build-scaler:
54-
DOCKER_BUILDKIT=1 docker build . -t ${IMAGE_SCALER} -f scaler/Dockerfile --build-arg VERSION=${VERSION} --build-arg GIT_COMMIT=${GIT_COMMIT}
63+
DOCKER_BUILDKIT=1 docker build . -t ${IMAGE_SCALER_VERSIONED_TAG} -t ${IMAGE_SCALER_SHA_TAG} -f scaler/Dockerfile --build-arg VERSION=${VERSION} --build-arg GIT_COMMIT=${GIT_COMMIT}
5564

5665
docker-build: docker-build-operator docker-build-interceptor docker-build-scaler
5766

5867
docker-publish: docker-build ## Push images on to Container Registry (default: ghcr.io).
59-
docker push $(IMAGE_OPERATOR)
60-
docker push $(IMAGE_INTERCEPTOR)
61-
docker push $(IMAGE_SCALER)
68+
docker push $(IMAGE_OPERATOR_VERSIONED_TAG)
69+
docker push $(IMAGE_OPERATOR_SHA_TAG)
70+
docker push $(IMAGE_INTERCEPTOR_VERSIONED_TAG)
71+
docker push $(IMAGE_INTERCEPTOR_SHA_TAG)
72+
docker push $(IMAGE_SCALER_VERSIONED_TAG)
73+
docker push $(IMAGE_SCALER_SHA_TAG)
6274

6375
publish-operator-multiarch:
64-
docker buildx build --output=type=${OUTPUT_TYPE} --platform=${BUILD_PLATFORMS} . -t ${IMAGE_OPERATOR} -f operator/Dockerfile --build-arg VERSION=${VERSION} --build-arg GIT_COMMIT=${GIT_COMMIT}
76+
docker buildx build --output=type=${OUTPUT_TYPE} --platform=${BUILD_PLATFORMS} . -t ${IMAGE_OPERATOR_VERSIONED_TAG} -t ${IMAGE_OPERATOR_SHA_TAG} -f operator/Dockerfile --build-arg VERSION=${VERSION} --build-arg GIT_COMMIT=${GIT_COMMIT}
6577

6678
publish-interceptor-multiarch:
67-
docker buildx build --output=type=${OUTPUT_TYPE} --platform=${BUILD_PLATFORMS} . -t ${IMAGE_INTERCEPTOR} -f interceptor/Dockerfile --build-arg VERSION=${VERSION} --build-arg GIT_COMMIT=${GIT_COMMIT}
79+
docker buildx build --output=type=${OUTPUT_TYPE} --platform=${BUILD_PLATFORMS} . -t ${IMAGE_INTERCEPTOR_VERSIONED_TAG} -t ${IMAGE_INTERCEPTOR_SHA_TAG} -f interceptor/Dockerfile --build-arg VERSION=${VERSION} --build-arg GIT_COMMIT=${GIT_COMMIT}
6880

6981
publish-scaler-multiarch:
70-
docker buildx build --output=type=${OUTPUT_TYPE} --platform=${BUILD_PLATFORMS} . -t ${IMAGE_SCALER} -f scaler/Dockerfile --build-arg VERSION=${VERSION} --build-arg GIT_COMMIT=${GIT_COMMIT}
82+
docker buildx build --output=type=${OUTPUT_TYPE} --platform=${BUILD_PLATFORMS} . -t ${IMAGE_SCALER_VERSIONED_TAG} -t ${IMAGE_SCALER_SHA_TAG} -f scaler/Dockerfile --build-arg VERSION=${VERSION} --build-arg GIT_COMMIT=${GIT_COMMIT}
7183

7284
publish-multiarch: publish-operator-multiarch publish-interceptor-multiarch publish-scaler-multiarch
7385

@@ -105,13 +117,13 @@ protoc-gen-go: ## Download protoc-gen-go
105117

106118
deploy: manifests kustomize ## Deploy to the K8s cluster specified in ~/.kube/config.
107119
cd config/interceptor && \
108-
$(KUSTOMIZE) edit set image ghcr.io/kedacore/http-add-on-interceptor=${IMAGE_INTERCEPTOR}
120+
$(KUSTOMIZE) edit set image ghcr.io/kedacore/http-add-on-interceptor=${IMAGE_INTERCEPTOR_VERSIONED_TAG}
109121

110122
cd config/scaler && \
111-
$(KUSTOMIZE) edit set image ghcr.io/kedacore/http-add-on-scaler=${IMAGE_SCALER}
123+
$(KUSTOMIZE) edit set image ghcr.io/kedacore/http-add-on-scaler=${IMAGE_SCALER_VERSIONED_TAG}
112124

113125
cd config/operator && \
114-
$(KUSTOMIZE) edit set image ghcr.io/kedacore/http-add-on-operator=${IMAGE_OPERATOR}
126+
$(KUSTOMIZE) edit set image ghcr.io/kedacore/http-add-on-operator=${IMAGE_OPERATOR_VERSIONED_TAG}
115127

116128
@sed -i".out" -e 's@version:[ ].*@version: $(VERSION)@g' config/default/kustomize-config/metadataLabelTransformer.yaml
117129
rm -rf config/default/kustomize-config/metadataLabelTransformer.yaml.out

Diff for: RELEASE-PROCESS.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ Once you've made changes to the chart, here's how to do submit the change to the
5656

5757
After your PR is merged, you've completed the release. Congratulations! You can optionally write a blog post about it; see the next section if you're interested.
5858

59-
## 4: Write a blog post on the documentation site (_optional_)
59+
## 4: Publish release on Artifact Hub
60+
61+
Publish release on Artifact Hub by creating a new version in [kedacore/external-scalers](https://github.com/kedacore/external-scalers/tree/main/artifacthub/add-ons-http).
62+
63+
## 5: Write a blog post on the documentation site (_optional_)
6064

6165
If you believe that your release is large enough to warrant a blog post on the [keda.sh/blog](https://keda.sh/blog/) site, please go to [github.com/kedacore/keda-docs](https://github.com/kedacore/keda-docs) and submit a new PR with a blog article about the release.
6266

Diff for: go.mod

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ require (
1313
github.com/stretchr/testify v1.8.1
1414
go.uber.org/zap v1.24.0
1515
golang.org/x/sync v0.1.0
16-
google.golang.org/grpc v1.52.1
16+
google.golang.org/grpc v1.52.3
1717
google.golang.org/protobuf v1.28.1
1818
k8s.io/api v0.26.1
1919
k8s.io/apimachinery v0.26.1
2020
k8s.io/client-go v0.26.1
21-
sigs.k8s.io/controller-runtime v0.14.1
21+
sigs.k8s.io/controller-runtime v0.14.4
2222
)
2323

2424
require (
@@ -70,8 +70,8 @@ require (
7070
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
7171
gopkg.in/yaml.v2 v2.4.0 // indirect
7272
gopkg.in/yaml.v3 v3.0.1 // indirect
73-
k8s.io/apiextensions-apiserver v0.26.0 // indirect
74-
k8s.io/component-base v0.26.0 // indirect
73+
k8s.io/apiextensions-apiserver v0.26.1 // indirect
74+
k8s.io/component-base v0.26.1 // indirect
7575
k8s.io/klog/v2 v2.80.1 // indirect
7676
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
7777
k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect

Diff for: go.sum

+8-8
Original file line numberDiff line numberDiff line change
@@ -580,8 +580,8 @@ google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKa
580580
google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
581581
google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
582582
google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
583-
google.golang.org/grpc v1.52.1 h1:2NpOPk5g5Xtb0qebIEs7hNIa++PdtZLo2AQUpc1YnSU=
584-
google.golang.org/grpc v1.52.1/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY=
583+
google.golang.org/grpc v1.52.3 h1:pf7sOysg4LdgBqduXveGKrcEwbStiK2rtfghdzlUYDQ=
584+
google.golang.org/grpc v1.52.3/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY=
585585
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
586586
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
587587
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
@@ -630,14 +630,14 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9
630630
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
631631
k8s.io/api v0.26.1 h1:f+SWYiPd/GsiWwVRz+NbFyCgvv75Pk9NK6dlkZgpCRQ=
632632
k8s.io/api v0.26.1/go.mod h1:xd/GBNgR0f707+ATNyPmQ1oyKSgndzXij81FzWGsejg=
633-
k8s.io/apiextensions-apiserver v0.26.0 h1:Gy93Xo1eg2ZIkNX/8vy5xviVSxwQulsnUdQ00nEdpDo=
634-
k8s.io/apiextensions-apiserver v0.26.0/go.mod h1:7ez0LTiyW5nq3vADtK6C3kMESxadD51Bh6uz3JOlqWQ=
633+
k8s.io/apiextensions-apiserver v0.26.1 h1:cB8h1SRk6e/+i3NOrQgSFij1B2S0Y0wDoNl66bn8RMI=
634+
k8s.io/apiextensions-apiserver v0.26.1/go.mod h1:AptjOSXDGuE0JICx/Em15PaoO7buLwTs0dGleIHixSM=
635635
k8s.io/apimachinery v0.26.1 h1:8EZ/eGJL+hY/MYCNwhmDzVqq2lPl3N3Bo8rvweJwXUQ=
636636
k8s.io/apimachinery v0.26.1/go.mod h1:tnPmbONNJ7ByJNz9+n9kMjNP8ON+1qoAIIC70lztu74=
637637
k8s.io/client-go v0.26.1 h1:87CXzYJnAMGaa/IDDfRdhTzxk/wzGZ+/HUQpqgVSZXU=
638638
k8s.io/client-go v0.26.1/go.mod h1:IWNSglg+rQ3OcvDkhY6+QLeasV4OYHDjdqeWkDQZwGE=
639-
k8s.io/component-base v0.26.0 h1:0IkChOCohtDHttmKuz+EP3j3+qKmV55rM9gIFTXA7Vs=
640-
k8s.io/component-base v0.26.0/go.mod h1:lqHwlfV1/haa14F/Z5Zizk5QmzaVf23nQzCwVOQpfC8=
639+
k8s.io/component-base v0.26.1 h1:4ahudpeQXHZL5kko+iDHqLj/FSGAEUnSVO0EBbgDd+4=
640+
k8s.io/component-base v0.26.1/go.mod h1:VHrLR0b58oC035w6YQiBSbtsf0ThuSwXP+p5dD/kAWU=
641641
k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4=
642642
k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
643643
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 h1:+70TFaan3hfJzs+7VK2o+OGxg8HsuBr/5f6tVAjDu6E=
@@ -647,8 +647,8 @@ k8s.io/utils v0.0.0-20221128185143-99ec85e7a448/go.mod h1:OLgZIPagt7ERELqWJFomSt
647647
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
648648
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
649649
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
650-
sigs.k8s.io/controller-runtime v0.14.1 h1:vThDes9pzg0Y+UbCPY3Wj34CGIYPgdmspPm2GIpxpzM=
651-
sigs.k8s.io/controller-runtime v0.14.1/go.mod h1:GaRkrY8a7UZF0kqFFbUKG7n9ICiTY5T55P1RiE3UZlU=
650+
sigs.k8s.io/controller-runtime v0.14.4 h1:Kd/Qgx5pd2XUL08eOV2vwIq3L9GhIbJ5Nxengbd4/0M=
651+
sigs.k8s.io/controller-runtime v0.14.4/go.mod h1:WqIdsAY6JBsjfc/CqO0CORmNtoCtE4S6qbPc9s68h+0=
652652
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 h1:iXTIw73aPyC+oRdyqqvVJuloN1p0AC/kzH07hu3NE+k=
653653
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
654654
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE=

Diff for: pkg/net/dial_context.go

+4
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ type DialContextFunc func(ctx context.Context, network, addr string) (net.Conn,
2929
func DialContextWithRetry(coreDialer *net.Dialer, backoff wait.Backoff) DialContextFunc {
3030
numDialTries := backoff.Steps
3131
return func(ctx context.Context, network, addr string) (net.Conn, error) {
32+
// We need to copy the backoff struct because Step() mutates it but the
33+
// number of steps is never reset.
34+
backoff := backoff
35+
3236
// note that we could test for backoff.Steps >= 0 here, but every call to backoff.Step()
3337
// (below) decrements the backoff.Steps value. If you accidentally call that function
3438
// more than once inside the loop, you will reduce the number of times the loop

0 commit comments

Comments
 (0)