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

fix(KFLUXBUGS-1848): associate existing images with a new repository #303

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

ralphbean
Copy link
Member

@ralphbean ralphbean commented Nov 8, 2024

This adds a new behavior.

If asked to create an image associated with a repository, and the image does not exist at all - then create it, as before.

If the image does exist, but is not associated with the desired repository, then submit a PATCH request to update it, adding the desired repository.

This is related to #300 and KFLUXBUGS-1848.

@ralphbean ralphbean requested a review from a team as a code owner November 8, 2024 01:32
@ralphbean ralphbean changed the title feat: associate existing images with a new repository fix(KFLUXBUGS-1848): associate existing images with a new repository Nov 8, 2024
@ralphbean ralphbean force-pushed the patch-repository branch 4 times, most recently from d04a890 to a5f9d9f Compare November 8, 2024 02:32
@ralphbean
Copy link
Member Author

Needs a run of black and (maybe) a rebase.

This adds a new behavior.

If asked to create an image associated with a repository, and the image
does not exist at all - then create it, as before.

If the image does exist, but is not associated with the desired
repository, then submit a PATCH request to update it, adding the desired
repository.

Signed-off-by: Ralph Bean <[email protected]>
@mmalina mmalina merged commit 6963f58 into main Nov 8, 2024
3 checks passed
@mmalina mmalina deleted the patch-repository branch November 8, 2024 13:31
mmalina added a commit to mmalina/release-service-utils that referenced this pull request Nov 8, 2024
This is a followup of what was done in konflux-ci#303

Most notably:

- rename the image_already_exists to find_image
  to reflect what it does - it used to return bool, now it returns
  the image if found.
- only include the repositories field in the patch payload
- for consistency, create the same two repo entries when adding
  a new repository like we do when creating a brand new image

Signed-off-by: Martin Malina <[email protected]>
mmalina added a commit to mmalina/release-service-utils that referenced this pull request Nov 8, 2024
This is a followup of what was done in konflux-ci#303

Most notably:

- rename the image_already_exists to find_image
  to reflect what it does - it used to return bool, now it returns
  the image if found.
- only include the repositories field in the patch payload
- for consistency, create the same two repo entries when adding
  a new repository like we do when creating a brand new image

Signed-off-by: Martin Malina <[email protected]>
@johnbieren
Copy link
Collaborator

https://issues.redhat.com/browse/RELEASE-793 added for unit tests

mmalina added a commit to mmalina/release-service-utils that referenced this pull request Nov 22, 2024
This is a followup of what was done in konflux-ci#303

Most notably:

- rename the image_already_exists to find_image
  to reflect what it does - it used to return bool, now it returns
  the image if found.
- only include the repositories field in the patch payload
- for consistency, create the same two repo entries when adding
  a new repository like we do when creating a brand new image

Signed-off-by: Martin Malina <[email protected]>
mmalina added a commit to mmalina/release-service-utils that referenced this pull request Nov 22, 2024
This is a followup of what was done in konflux-ci#303

Most notably:

- rename the image_already_exists to find_image
  to reflect what it does - it used to return bool, now it returns
  the image if found.
- only include the repositories field in the patch payload
- for consistency, create the same two repo entries when adding
  a new repository like we do when creating a brand new image

Signed-off-by: Martin Malina <[email protected]>
mmalina added a commit to mmalina/release-service-utils that referenced this pull request Nov 22, 2024
This is a followup of what was done in konflux-ci#303

Most notably:

- rename the image_already_exists to find_image
  to reflect what it does - it used to return bool, now it returns
  the image if found.
- only include the repositories field in the patch payload
- for consistency, create the same two repo entries when adding
  a new repository like we do when creating a brand new image

Signed-off-by: Martin Malina <[email protected]>
mmalina added a commit to mmalina/release-service-utils that referenced this pull request Nov 22, 2024
This is a followup of what was done in konflux-ci#303

Most notably:

- rename the image_already_exists to find_image
  to reflect what it does - it used to return bool, now it returns
  the image if found.
- only include the repositories field in the patch payload
- for consistency, create the same two repo entries when adding
  a new repository like we do when creating a brand new image

Signed-off-by: Martin Malina <[email protected]>
mmalina added a commit to mmalina/release-service-utils that referenced this pull request Nov 25, 2024
This is a followup of what was done in konflux-ci#303

Most notably:

- rename the image_already_exists to find_image
  to reflect what it does - it used to return bool, now it returns
  the image if found.
- only include the repositories field in the patch payload
- for consistency, create the same two repo entries when adding
  a new repository like we do when creating a brand new image

Signed-off-by: Martin Malina <[email protected]>
mmalina added a commit to mmalina/release-service-utils that referenced this pull request Nov 25, 2024
This is a followup of what was done in konflux-ci#303

Most notably:

- rename the image_already_exists to find_image
  to reflect what it does - it used to return bool, now it returns
  the image if found.
- only include the repositories field in the patch payload
- for consistency, create the same two repo entries when adding
  a new repository like we do when creating a brand new image

Signed-off-by: Martin Malina <[email protected]>
mmalina added a commit to mmalina/release-service-utils that referenced this pull request Nov 25, 2024
This is a followup of what was done in konflux-ci#303

Most notably:

- rename the image_already_exists to find_image
  to reflect what it does - it used to return bool, now it returns
  the image if found.
- only include the repositories field in the patch payload
- for consistency, create the same two repo entries when adding
  a new repository like we do when creating a brand new image

Signed-off-by: Martin Malina <[email protected]>
mmalina added a commit to mmalina/release-service-utils that referenced this pull request Nov 27, 2024
This is a followup of what was done in konflux-ci#303

Most notably:

- rename the image_already_exists to find_image
  to reflect what it does - it used to return bool, now it returns
  the image if found.
- only include the repositories field in the patch payload
- for consistency, create the same two repo entries when adding
  a new repository like we do when creating a brand new image

Signed-off-by: Martin Malina <[email protected]>
mmalina added a commit to mmalina/release-service-utils that referenced this pull request Nov 27, 2024
This is a followup of what was done in konflux-ci#303

Most notably:

- rename the image_already_exists to find_image
  to reflect what it does - it used to return bool, now it returns
  the image if found.
- only include the repositories field in the patch payload
- for consistency, create the same two repo entries when adding
  a new repository like we do when creating a brand new image

Also, this adds tests for pyxis.patch
- RELEASE-1285

Signed-off-by: Martin Malina <[email protected]>
mmalina added a commit that referenced this pull request Nov 27, 2024
This is a followup of what was done in #303

Most notably:

- rename the image_already_exists to find_image
  to reflect what it does - it used to return bool, now it returns
  the image if found.
- only include the repositories field in the patch payload
- for consistency, create the same two repo entries when adding
  a new repository like we do when creating a brand new image

Also, this adds tests for pyxis.patch
- RELEASE-1285

Signed-off-by: Martin Malina <[email protected]>
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.

3 participants