You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// The path includes random data to ensure that each request is treated separately by the mock server, allowing us to track data across calls.
71
+
// It also ensures that the client isn't using some pre-saved path and is actually using the presigned URL returned by the mock server in the previous step, which is important for test validity.
http.Error(w, fmt.Sprintf("x-amz-tagging should contain an agent_version tag with value %s", version.PreflightVersion), http.StatusInternalServerError)
254
+
return
255
+
}
256
+
257
+
iftags.Get("tenant_id") =="" {
258
+
// TODO: if we change setup a bit, we can check the tenant_id matches the expected tenant_id from the test config, but for now, just check it's set
259
+
http.Error(w, "x-amz-tagging should contain a tenant_id tag", http.StatusInternalServerError)
260
+
return
261
+
}
262
+
263
+
iftags.Get("upload_type") !="k8s_snapshot" {
264
+
http.Error(w, "x-amz-tagging should contain an upload_type tag with value k8s_snapshot", http.StatusInternalServerError)
http.Error(w, "x-amz-tagging should contain an uploader_id tag which matches the cluster ID sent in the RetrievePresignedUploadURL request", http.StatusInternalServerError)
270
+
return
271
+
}
272
+
273
+
iftags.Get("username") =="" {
274
+
// TODO: if we change setup a bit, we can check the username matches the expected username from the test config
275
+
// but for now, just check it's set
276
+
http.Error(w, "x-amz-tagging should contain a username tag", http.StatusInternalServerError)
277
+
return
278
+
}
279
+
280
+
iftags.Get("vendor") !="k8s" {
281
+
http.Error(w, "x-amz-tagging should contain a vendor tag with value k8s", http.StatusInternalServerError)
282
+
return
283
+
}
284
+
181
285
body, err:=io.ReadAll(r.Body)
182
286
require.NoError(mds.t, err)
183
287
288
+
ifuploadValues.FileSize!=int64(len(body)) {
289
+
http.Error(w, fmt.Sprintf("file size in request body should match that sent in RetrievePresignedUploadURL request; expected %d, got %d", uploadValues.FileSize, len(body)), http.StatusInternalServerError)
0 commit comments