[remotecache/s3] fix: "updated_at" in http header can't pass some http gateway, "_" -> "-"#3444
Conversation
Signed-off-by: lomot <lomot@qq.com>
this problem cost me about 4 hours, i upload the layer cache to the s3 compatible object storage privoded by tencent cloud, it's fine at the begining, untill yesterday, the request failed with finally i found the problem was the http header |
| CopySource: ©Source, | ||
| Key: &key, | ||
| Metadata: map[string]string{"updated_at": time.Now().String()}, | ||
| Metadata: map[string]string{"updated-at": time.Now().String()}, |
There was a problem hiding this comment.
I'm not very familiar with this code and how this information is used, but saw the PR; wondering; would there be code that expects the previous (updated_at) name? And if so, should this set both values (old and new) for compatibility?
i.e, something like;
updatedAt := time.Now.String()
// ....
Metadata: map[string]string{"updated_at": updatedAt, "updated-at": updatedAt},There was a problem hiding this comment.
the head x-amz-meta-updated_at will be dropd when it pass some gateway, it result a change to the request, which will cause a SignatureDoesNotMatch error.
| CopySource: ©Source, | ||
| Key: &key, | ||
| Metadata: map[string]string{"updated_at": time.Now().String()}, | ||
| Metadata: map[string]string{"updated-at": time.Now().String()}, |
There was a problem hiding this comment.
I think we should just remove this metadata. Don't think it has any purpose for BuildKit. cc @bpaquet.
There was a problem hiding this comment.
No, to do a touch, we need to change a meta data. No issue to change the name :)
the word
updated_atin s3 Metadata will be converted tox-amz-meta-updated_atin the http header, but the http headers which contain_can't pass some http gateway, such as tencent cloud object storage gateway.