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

Remove the output checksum validation skip warning if object is not fetched from S3 #3034

Merged
merged 3 commits into from
Mar 11, 2025

Conversation

wty-Bryant
Copy link
Contributor

@wty-Bryant wty-Bryant commented Mar 10, 2025

Some users complains (e.g. #3024) the response checksum validation skip warning would be printed out when the object is not actually fetched from S3. Both Go SDK checksum middleware and S3 work correctly. This PR just turns off the validation skip warning to not scare users who update their SDK to latest version.

By submitting this PR, it is guaranteed that flex checksum unit and integration tests passed. Manual test using following code confirms the warning log no longer shows when no object is returned from S3, which should resolve #3024 :

import (
	"context"
	"github.com/aws/aws-sdk-go-v2/aws"
	"github.com/aws/aws-sdk-go-v2/config"
	"github.com/aws/aws-sdk-go-v2/service/s3"
	"log"
)

func main() {
	cfg, err := config.LoadDefaultConfig(context.Background())
	if err != nil {
		log.Fatalf("failed to load SDK config: %v", err)
	}

	s3Client := s3.NewFromConfig(cfg)
	_, err = s3Client.GetObject(context.Background(), &s3.GetObjectInput{
		Bucket:      aws.String("your bucket"),
		Key:         aws.String("your key"),
		IfNoneMatch: aws.String("your object E-Tag"),
	})

	if err != nil {
		log.Fatalf("failed to get object: %v", err)
	}
}

@wty-Bryant wty-Bryant requested a review from a team as a code owner March 10, 2025 19:43
@wty-Bryant wty-Bryant force-pushed the feat-skip-nilbody-checksumvalidation branch from 276e21e to a56c483 Compare March 10, 2025 19:57
Copy link
Contributor

@Madrigal Madrigal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as soon as CI passes

@wty-Bryant wty-Bryant merged commit 7aec2ed into main Mar 11, 2025
13 checks passed
@wty-Bryant wty-Bryant deleted the feat-skip-nilbody-checksumvalidation branch March 11, 2025 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

S3:GetObject - No Supported Checksum when using IfNoneMatch (ETag)
2 participants