Skip to content
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

Merged
merged 1 commit into from
Sep 12, 2024

Conversation

mike-nguyen
Copy link
Member

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 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.
Copy link
Member

@marmijo marmijo left a 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
Copy link
Member

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.

Copy link
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mike-nguyen mike-nguyen merged commit c211431 into coreos:main Sep 12, 2024
5 checks passed
@mike-nguyen
Copy link
Member Author

/cherrypick rhcos-4.17 rhcos-4.16 rhcos-4.15 rhcos-4.14 rhcos-4.13 rhcos-4.12

@openshift-cherrypick-robot

@mike-nguyen: new pull request created: #3874

In response to this:

/cherrypick rhcos-4.17 rhcos-4.16 rhcos-4.15 rhcos-4.14 rhcos-4.13 rhcos-4.12

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants