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

Use UTC for AWS token tests #16680

Merged
merged 1 commit into from
Jul 18, 2024
Merged

Conversation

rifelpet
Copy link
Member

This ensures the unit tests pass when the current UTC date differs from the local timezone's date.

Example failure:

--- FAIL: TestCreateTokenV2 (0.00s)
    aws_authenticator_test.go:266: decoded: &{URL:https://sts.us-east-1.amazonaws.com/?Action=GetCallerIdentity&Version=2011-06-15&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=fakeaccesskey%2F20240718%2Fus-east-1%2Fsts%2Faws4_request&X-Amz-Date=20240718T012100Z&X-Amz-SignedHeaders=host%3Bx-kops-request-sha&X-Amz-Signature=7a851e423b5697c72a68286848c43ef68cfccbb01e46ab96a25cfb63d9e88c6d Method:GET SignedHeader:map[Host:[sts.us-east-1.amazonaws.com] X-Kops-Request-Sha:[2dhlzFTsYGePGxGQhK15rn+TV9HEUZxkV94zFLf7uoo]]}
    aws_authenticator_test.go:335: unexpected amzCredential: got "fakeaccesskey/20240718/us-east-1/sts/aws4_request", want "fakeaccesskey/20240717/us-east-1/sts/aws4_request"
    aws_authenticator_test.go:342: expected amz-date to have prefix "20240717T"; got "20240718T012100Z"

This ensures the unit tests pass when ran when the current UTC date differs from the local timezone's date.
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 18, 2024
@k8s-ci-robot k8s-ci-robot added the area/provider/aws Issues or PRs related to aws provider label Jul 18, 2024
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 18, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hakman

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 18, 2024
@k8s-ci-robot k8s-ci-robot merged commit 8fb8c56 into kubernetes:master Jul 18, 2024
21 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.30 milestone Jul 18, 2024
@rifelpet
Copy link
Member Author

/milestone v1.31

@k8s-ci-robot k8s-ci-robot modified the milestones: v1.30, v1.31 Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/provider/aws Issues or PRs related to aws provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants