Skip to content

Commit

Permalink
ec2 tags collection is broken when kube2iam is used (#3174)
Browse files Browse the repository at this point in the history
  • Loading branch information
arminioa authored and Simwar committed Mar 29, 2019
1 parent 4a1a379 commit 36d7364
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/util/ec2/ec2_tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func getSecurityCreds() (*ec2SecurityCred, error) {
return iamParams, err
}

res, err := getResponse(metadataURL + "/iam/security-credentials/" + iamRole + "/")
res, err := getResponse(metadataURL + "/iam/security-credentials/" + iamRole)
if err != nil {
return iamParams, fmt.Errorf("unable to fetch EC2 API, %s", err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/ec2/ec2_tags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func TestGetSecurityCreds(t *testing.T) {
if r.URL.Path == "/iam/security-credentials/" {
w.Header().Set("Content-Type", "text/plain")
io.WriteString(w, "test-role")
} else if r.URL.Path == "/iam/security-credentials/test-role/" {
} else if r.URL.Path == "/iam/security-credentials/test-role" {
w.Header().Set("Content-Type", "text/plain")
content, err := ioutil.ReadFile("payloads/security_cred.json")
require.Nil(t, err, fmt.Sprintf("failed to load json in payloads/security_cred.json: %v", err))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Each section from every releasenote are combined when the
# CHANGELOG.rst is rendered. So the text needs to be worded so that
# it does not depend on any information only available in another
# section. This may mean repeating some details, but each section
# must be readable independently of the other.
#
# Each section note must be formatted as reStructuredText.
---
fixes:
- |
Fixes ec2 tags collection when datadog agent is deployed
into a kubernetes cluster along with kube2iam.

0 comments on commit 36d7364

Please sign in to comment.