Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

S3 types.ReplicationStatusComplete is invalid #524

Closed
Nuru opened this issue Apr 15, 2023 · 3 comments
Closed

S3 types.ReplicationStatusComplete is invalid #524

Nuru opened this issue Apr 15, 2023 · 3 comments
Assignees
Labels
bug Something isn't working s3 service-api This issue pertains to the AWS API

Comments

@Nuru
Copy link

Nuru commented Apr 15, 2023

Describe the bug

The S3 service defines the enum ReplicationStatusComplete https://github.com/aws/aws-sdk-go-v2/blob/b83b3053dda120e4687168a211cf5eca4c071bfe/service/s3/types/enums.go#L983

The value actually returned by S3 is "COMPLETED" not "COMPLETE". See Replication Status and many other documents.

Expected Behavior

All enums match valid responses.

Current Behavior

There is no enum to match the resulting replication status when an object is replicated. No response will ever match types.ReplicationStatusComplete

Reproduction Steps

if replicaStatus, err := s3Client.HeadObject(context.TODO(), replicaStatusRequest); err == nil {  
  if replicaStatus.ReplicationStatus != types.ReplicationStatusComplete {
    log.Printf("Replication Status is %v", replicaStatus.ReplicationStatus)
  }
}

Possible Solution

The enum should be named ReplicationStatusCompleted and have a value of "COMPLETED".

Additional Information/Context

No response

AWS Go SDK V2 Module Versions Used

1.27.1

Compiler and Version used

go version go1.20.2 darwin/amd64

Operating System and version

macOS 12.6.4

@Nuru Nuru added bug Something isn't working needs-triage labels Apr 15, 2023
@jmklix jmklix self-assigned this Apr 21, 2023
@RanVaknin RanVaknin assigned RanVaknin and unassigned jmklix Apr 24, 2023
@RanVaknin
Copy link

RanVaknin commented Apr 24, 2023

Hi @Nuru ,

Thanks for reporting the issue. I can verify that this is an issue.
In the meantime you can do a string comparison since this is a string enum:

if replicaStatus, err := s3Client.HeadObject(context.TODO(), replicaStatusRequest); err == nil {  
  if replicaStatus.ReplicationStatus != "COMPLETE" {
    log.Printf("Replication Status is %v", replicaStatus.ReplicationStatus)
  }
}

I'll upstream this to the service team to either update their model or to return the correct value from their backend.
Thanks,
Ran~

P86847278

@RanVaknin RanVaknin added service-api This issue pertains to the AWS API and removed needs-triage labels Apr 24, 2023
@RanVaknin RanVaknin transferred this issue from aws/aws-sdk-go-v2 Apr 24, 2023
@RanVaknin RanVaknin added the s3 label Apr 24, 2023
@RanVaknin
Copy link

The S3 service team added a COMPLETED enum that can now be used.

Thanks,
Ran~

Copy link

This issue is now closed.

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working s3 service-api This issue pertains to the AWS API
Projects
None yet
Development

No branches or pull requests

3 participants