Skip to content

Commit

Permalink
Fix robot account federations for older versions of Quay (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
herve4m authored Dec 14, 2024
1 parent 33619b0 commit dba1df0
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:
types:
- yaml
- repo: https://github.com/ansible/ansible-lint.git
rev: v24.10.0
rev: v24.12.2
hooks:
- id: ansible-lint
types:
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ Quay Container Registry Collection Release Notes

.. contents:: Topics

v2.5.1
======

Bugfixes
--------

- quay_robot - updating robot accounts failed for Quay versions prior to 3.13 because of the robot account federations feature introduced in this version of Quay. Fix now skip federation configuration if the ``federations`` parameter is not specified (https://github.com/redhat-cop/quay_configuration/issues/18).

v2.5.0
======

Expand Down
10 changes: 10 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -283,3 +283,13 @@ releases:
fragments:
- 17-v2.5.0-summary.yml
release_date: '2024-11-26'
2.5.1:
changes:
bugfixes:
- quay_robot - updating robot accounts failed for Quay versions prior to 3.13
because of the robot account federations feature introduced in this version
of Quay. Fix now skip federation configuration if the ``federations`` parameter
is not specified (https://github.com/redhat-cop/quay_configuration/issues/18).
fragments:
- 19-v2.5.1-summary.yml
release_date: '2024-12-14'
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
namespace: infra
name: quay_configuration
version: 2.5.0
version: 2.5.1
readme: README.md
authors:
- Hervé Quatremain <[email protected]>
Expand Down
5 changes: 4 additions & 1 deletion plugins/modules/quay_robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,9 @@ def main():
module.delete(robot_details, "robot account", name, path_url)

if robot_details:
if federations is None:
exit_module(module, False, robot_details)

# GET /api/v1/organization/{orgname}/robots/{robot_shortname}/federation
# [
# {
Expand All @@ -288,7 +291,7 @@ def main():
)
fed_to_add = fed_req_set - fed_curr_set

if federations is None or fed_req_set == fed_curr_set or (append and not fed_to_add):
if fed_req_set == fed_curr_set or (append and not fed_to_add):
exit_module(module, False, robot_details)

if append:
Expand Down

0 comments on commit dba1df0

Please sign in to comment.