Skip to content

Commit

Permalink
mantle/aliyun: add tags when doing ImportImage
Browse files Browse the repository at this point in the history
This adds tags indicating that `mantle` created the image in the
Aliyun cloud. This matches the behavior when we do `CopyImage()`
during replication operations and makes the discoverability of images
uploaded via `mantle`/`ore` easier.

(cherry picked from commit 5d0ca36)
  • Loading branch information
miabbott committed Feb 9, 2022
1 parent ede5f1e commit c8c5cec
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mantle/platform/api/aliyun/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,12 @@ func (a *API) ImportImage(format, bucket, object, image_size, device, name, desc
request.ImageName = name
request.Description = description
request.Architecture = architecture
request.Tag = &[]ecs.ImportImageTag{
{
Key: "created-by",
Value: "mantle",
},
}

plog.Infof("importing image")
response, err := a.ecs.ImportImage(request)
Expand Down

0 comments on commit c8c5cec

Please sign in to comment.