Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Provide scaler for Amazon managed service for Prometheus #5373

Merged
merged 37 commits into from
Jan 18, 2024
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
d5bdd71
chore: add large lag threshold test for Kafka scalers (#5361)
dttung2905 Jan 12, 2024
dd24cc2
Add support aws secretmanager authentication (#5162)
geoffrey1330 Jan 12, 2024
a37620e
chore(deps): update actions/upload-artifact digest to 1eb3cb2 (#5369)
renovate[bot] Jan 12, 2024
f58f9a6
chore: fix jetstream flaky test (#5372)
JorTurFer Jan 13, 2024
ccccc67
chore: bump Go to 1.21.6 (#5370)
zroubalik Jan 13, 2024
5c7c7f2
https://github.com/kedacore/keda/issues/2214
Jan 15, 2024
332e51e
https://github.com/kedacore/keda/issues/2214
Jan 15, 2024
1ad5671
https://github.com/kedacore/keda/issues/2214
Jan 15, 2024
ba8f6ac
Update pkg/scalers/aws_sigv4.go
sguruvar Jan 15, 2024
2034dba
Update tests/scalers/aws/aws_managed_prometheus_pod_identity/aws_mana…
sguruvar Jan 15, 2024
c29fb15
https://github.com/kedacore/keda/issues/2214
Jan 15, 2024
4b53d8e
https://github.com/kedacore/keda/issues/2214
Jan 15, 2024
68e52fe
https://github.com/kedacore/keda/issues/2214
Jan 15, 2024
ebaa539
https://github.com/kedacore/keda/issues/2214
Jan 15, 2024
4bb9d44
Update pkg/scalers/aws_sigv4.go
sguruvar Jan 15, 2024
f1a3f72
Update tests/scalers/aws/aws_managed_prometheus_pod_identity/aws_mana…
sguruvar Jan 15, 2024
8c6a39a
https://github.com/kedacore/keda/issues/2214
Jan 15, 2024
12b1817
Merge branch 'main' of https://github.com/sguruvar/keda
sguruvar Jan 15, 2024
2ba1144
Update CHANGELOG.md
sguruvar Jan 15, 2024
5c6efaf
Update pkg/scalers/aws_sigv4.go
sguruvar Jan 15, 2024
8813dad
https://github.com/kedacore/keda/issues/2214
sguruvar Jan 16, 2024
f76045b
Merge branch 'main' into main
tomkerkhove Jan 16, 2024
f805d13
Merge remote-tracking branch 'upstream/main'
sguruvar Jan 16, 2024
90f50e5
https://github.com/kedacore/keda/issues/2214
sguruvar Jan 16, 2024
ee28386
Update pkg/scalers/aws/aws_sigv4.go
sguruvar Jan 16, 2024
147186e
Update pkg/scalers/aws/aws_sigv4.go
sguruvar Jan 16, 2024
a31fa7c
Merge remote-tracking branch 'upstream/main'
sguruvar Jan 16, 2024
f73c7aa
https://github.com/kedacore/keda/issues/2214
sguruvar Jan 16, 2024
c3bb6ab
Apply suggestions from code review
JorTurFer Jan 17, 2024
268fe43
Apply suggestions from code review
JorTurFer Jan 17, 2024
bcafe6f
https://github.com/kedacore/keda/issues/2214
sguruvar Jan 17, 2024
5a5b8b2
Merge branch 'main' of https://github.com/sguruvar/keda
sguruvar Jan 17, 2024
b16e7fc
Update pkg/scalers/aws/aws_sigv4.go
sguruvar Jan 18, 2024
d86d3e5
Update pkg/scalers/aws/aws_sigv4.go
sguruvar Jan 18, 2024
a564efd
Update pkg/scalers/aws/aws_sigv4.go
sguruvar Jan 18, 2024
3376b82
https://github.com/kedacore/keda/issues/2214
sguruvar Jan 18, 2024
31d2afa
Merge branch 'main' into main
zroubalik Jan 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
https://github.com/kedacore/keda/issues/2214
Signed-off-by: Siva Guruvareddiar <sivagurunath@gmail.com>
  • Loading branch information
sguruvar committed Jan 16, 2024
commit f73c7aa29b490397837060fbd68e21a340cb72c3
12 changes: 5 additions & 7 deletions pkg/scalers/aws/aws_sigv4.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@ package aws

sguruvar marked this conversation as resolved.
Show resolved Hide resolved
import (
"context"
"crypto/sha256"
"encoding/hex"
"errors"
"net/http"
"time"

v4 "github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/amp"

"github.com/kedacore/keda/v2/pkg/scalers/scalersconfig"
Expand All @@ -31,10 +28,11 @@ func (rt *roundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
if err != nil {
return nil, err
}
// Sign request
hasher := sha256.New()
reqCxt := v4.SetPayloadHash(req.Context(), hex.EncodeToString(hasher.Sum([]byte{})))
reqHash := v4.GetPayloadHash(reqCxt)

// This is to avoid the semgrp issue of odd hash.Sum call flow when using hasher.sum(nil)
// "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" is the sha256 of ""
const reqHash = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
zroubalik marked this conversation as resolved.
Show resolved Hide resolved

err = rt.client.Options().HTTPSignerV4.SignHTTP(req.Context(), cred, req, reqHash, "aps", rt.region, time.Now())
if err != nil {
return nil, err
Expand Down
Loading