-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aliyun: make image replication idempotent #3872
Conversation
There is a history of failure copying images to other regions on aliyun. Upstream code that calls the CopyImage code more than once will get a DuplicateImage error when an image with the same name already exists. Let's check to see if the image name exists in the region before attempting to copy the image to the region and return early if it already exists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't test this, but it LGTM! This should help to resolve the recent failures we've seen in the RHCOS pipeline.
// return early if there is already an image with that tag | ||
if len(images.Images.Image) > 0 { | ||
plog.Infof("image with name %v in %v region already exists--skipping copy", dest_name, dest_region) | ||
return images.Images.Image[0].ImageId, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i wonder if we should somehow respect wait_for_ready
here too? I guess it's possible that the image pre-exists but isn't ready yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/cherrypick rhcos-4.17 rhcos-4.16 rhcos-4.15 rhcos-4.14 rhcos-4.13 rhcos-4.12 |
@mike-nguyen: new pull request created: #3874 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
There is a history of failure copying images to other regions on aliyun. Upstream code that calls the CopyImage code more than once will get a DuplicateImage error when an image with the same name already exists. Let's check to see if the image name exists in the region before attempting to copy the image to the region and return early if it already exists.