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

Add AWS SDK Go V2 Packages and a Test Script Using It #1521

Closed
wants to merge 2 commits into from

Conversation

shirady
Copy link
Contributor

@shirady shirady commented Feb 2, 2025

Explain the changes

  1. Add package for AWS SDK Go V2.
  2. Create a test script with the client with AWS SDK Go V2.

Issues: Fixed #xxx / Gap #xxx

  1. List of GAPs:
  • Run this script in our CI (should be from the core repository).
  • As of version v1.29.0 (2025-01-15) - there is a checksum calculation that was added by default, we would need to fix it in the core repository, I opened Jira ticket (MCGI-300).

Testing Instructions:

Currently, only a manual test is available:
If you want to test it against NooBaa:

  1. Deploy noobaa on MInikube or Rancher Desktop (see guide).
  2. Since we use this: kubectl port-forward -n <your-namesopace> service/s3 12443:443 (the endpoint address will be https://localhost:12443).
  3. Use the admin credentials using noobaa status --show-secrets -n <you-namespace> (you can set us-east-1 as the region, it doesn't matter) and then set the environment variables:
// $ export AWS_ACCESS_KEY_ID=<access-key-id>
// $ export AWS_SECRET_ACCESS_KEY=<secret-key>
// $ export AWS_DEFAULT_REGION=<region>
  1. Use a higher debug level: noobaa system set-debug-level 5 -n <your-namespace>
  2. Run the script: go run script/client_script.go -bucket <bucket-name> -key <key-name> -mpu <key-name-of-multi--part-upload> -endpoint "<endpoint-address>" [-disable-deletion], for example: go run script/client_script.go -bucket second.bucket -key test-key -mpu test-mpu-key -endpoint "https://localhost:12443" -disable-deletion (without deletion of the objects and bucket).
  • Doc added/updated
  • Tests added

@shirady
Copy link
Contributor Author

shirady commented Feb 2, 2025

Attaching an example:
go run script/client_script.go -bucket nine.bucket -key test-key -mpu test-mpu-key -endpoint "https://localhost:12443"

Running a couple of tests using AWS SDK Go V2...
--------------------------------------------------
Running on configured endpoint https://localhost:12443

creating bucket nine.bucket
got error when trying to create bucket nine.bucket. error:
operation error S3: CreateBucket, https response error StatusCode: 409, RequestID: m6nb4jzc-c9nkft-8ox, HostID: m6nb4jzc-c9nkft-8ox, BucketAlreadyOwnedByYou:

put object test-key in bucket nine.bucket
got error when trying to put object test-key in bucket nine.bucket. error:
operation error S3: PutObject, https response error StatusCode: 400, RequestID: m6nb4jzh-ccqx4b-cs0, HostID: m6nb4jzh-ccqx4b-cs0, api error InvalidDigest: The Content-MD5 you specified is not valid.

create multi part upload test-mpu-key in bucket nine.bucket
succeeded in create multipart upload test-mpu-key bucket nine.bucket.

upload part test-mpu-key in bucket nine.bucket
got error when trying to upload part 1 test-mpu-key in bucket nine.bucket. error:
operation error S3: UploadPart, https response error StatusCode: 400, RequestID: m6nb4k05-cqvnoe-18dp, HostID: m6nb4k05-cqvnoe-18dp, api error InvalidDigest: The Content-MD5 you specified is not valid.

delete object test-key in bucket nine.bucket
succeeded in delete object test-key bucket nine.bucket.

delete object test-mpu-key in bucket nine.bucket
succeeded in delete object test-mpu-key bucket nine.bucket.

deleting bucket nine.bucket
succeeded in delete bucket nine.bucket.
--------------------------------------------------

Total Tests: 7
Passing Tests:  4 [createMultipartUpload deleteObject deleteMultipartUploadObject deleteBucket]
Failing Tests:  3 [createBucket putObject uploadPart]
Skipped Tests:  1 [completeMultiPartUpload]

@shirady
Copy link
Contributor Author

shirady commented Feb 9, 2025

Closing this PR as it should be in the noobaa-core repo because we want to test a client directly (not related to the k8s deployment).
It was open in first place in noobaa-operator since the script is written in Go lang.

@shirady shirady closed this Feb 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant