()
| 81 | } |
| 82 | |
| 83 | func (r *S3RegistryStore) Teardown() error { |
| 84 | bucket, key, err := r.parseS3Path() |
| 85 | if err != nil { |
| 86 | return err |
| 87 | } |
| 88 | ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) |
| 89 | defer cancel() |
| 90 | _, err = r.s3Client.DeleteObject(ctx, |
| 91 | &s3.DeleteObjectInput{ |
| 92 | Bucket: aws.String(bucket), |
| 93 | Key: aws.String(key), |
| 94 | }) |
| 95 | if err != nil { |
| 96 | panic(err) |
| 97 | } |
| 98 | return nil |
| 99 | } |
| 100 | |
| 101 | func (r *S3RegistryStore) parseS3Path() (string, string, error) { |
| 102 | path := strings.TrimPrefix(r.filePath, "s3://") |
nothing calls this directly
no test coverage detected