Skip to content

Convert IDMS/ICSP into registries.conf #674

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tonyskapunk
Copy link
Contributor

@tonyskapunk tonyskapunk commented May 14, 2025

SUMMARY

This is a functionality that is required to deploy clusters with a different version than the hub. It is used by the spoke clusters in disconnected mode.

ISSUE TYPE
  • Enhanced Feature
Tests
  • TestBos2Sno: ocp-4.18-hub-abi-sno ocp-4.18-spoke-sno -

Build-depends: https://softwarefactory-project.io/r/c/dci-openshift-agent/+/33754

@tonyskapunk tonyskapunk requested review from a team as code owners May 14, 2025 21:11
Copy link
Contributor

coderabbitai bot commented May 14, 2025

📝 Walkthrough

Walkthrough

This update introduces new variables and tasks to the acm.utils role for transforming image source data into the registries.conf format, supporting disconnected ACM spoke clusters. It also bumps the collection version to 2.3.0 in both the spec and galaxy metadata, and updates documentation to reflect these changes.

Changes

Files/Paths Change Summary
ansible-collection-redhatci-ocp.spec, galaxy.yml Version updated from 2.2 to 2.3; changelog entry added in spec file.
roles/acm/utils/README.md Documentation updated: four new variables (utils_imagesource_file, utils_hub_mirrors, utils_registry, utils_unqualified_search_registries) documented; usage example and variable table reformatted.
roles/acm/utils/defaults/main.yml Added default for utils_unqualified_search_registries.
roles/acm/utils/meta/argument_specs.yml New argument spec image-sources added, defining options for image source transformation.
roles/acm/utils/tasks/image-sources.yml New task file added to convert image source data to registries.conf format and set utils_acm_registries.

Suggested reviewers

  • betoredhat

[!ANNOUNCEMENT]

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


[!ANNOUNCEMENT]

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between e417e26 and 2d7679c.

📒 Files selected for processing (6)
  • ansible-collection-redhatci-ocp.spec (2 hunks)
  • galaxy.yml (1 hunks)
  • roles/acm/utils/README.md (2 hunks)
  • roles/acm/utils/defaults/main.yml (1 hunks)
  • roles/acm/utils/meta/argument_specs.yml (1 hunks)
  • roles/acm/utils/tasks/image-sources.yml (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • galaxy.yml
🚧 Files skipped from review as they are similar to previous changes (5)
  • roles/acm/utils/defaults/main.yml
  • ansible-collection-redhatci-ocp.spec
  • roles/acm/utils/README.md
  • roles/acm/utils/meta/argument_specs.yml
  • roles/acm/utils/tasks/image-sources.yml
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Sanity Check (stable-2.9)
  • GitHub Check: Sanity Check (stable-2.17)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (4)
ansible-collection-redhatci-ocp.spec (1)

57-59: Document changelog for 2.3.EPOCH release
The new entry records the version bump and role updates. Consider briefly mentioning the image-sources conversion feature to give more context in the changelog.

roles/acm/utils/README.md (1)

65-82: Add image-sources usage example
The new example correctly demonstrates the image-sources task. For extra clarity, you could show a snippet of the resulting utils_acm_registries variable.

roles/acm/utils/tasks/image-sources.yml (2)

11-22: Simplify the Jinja merging logic
Building a dict via manual loops and update() is fragile and prints unwanted None. Consider Ansible’s combine filter to merge your mirror maps:

-    combined_mirrors: |-
-      {%- set c = dict() %}
-      {%- for mirror in hub_mirrors + spoke_mirrors %}
-      {%- set s = mirror.source %}
-      {%- set m = mirror.mirrors %}
-      {%- if c.get(s) %}
-      {{ c.update({s: c[s] + m}) }}
-      {%- else %}
-      {{ c.update({s: m}) }}
-      {%- endif %}
-      {%- endfor %}
-      {{ c }}
+    combined_mirrors: "{{ hub_mirrors | combine(spoke_mirrors, recursive=True) }}"

This yields a merged dict directly and avoids side-effects.


28-39: Deterministic ordering & cleanup
Iterating over combined_mirrors.keys() | list can produce non-deterministic TOML block order. Consider sorting the keys for reproducible output:

{% for registry in combined_mirrors.keys() | sort %}

Also, you already filter mirrors with unique—nice touch.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 05ed8b8 and a134ca7.

📒 Files selected for processing (6)
  • ansible-collection-redhatci-ocp.spec (2 hunks)
  • galaxy.yml (1 hunks)
  • roles/acm/utils/README.md (2 hunks)
  • roles/acm/utils/defaults/main.yml (1 hunks)
  • roles/acm/utils/meta/argument_specs.yml (1 hunks)
  • roles/acm/utils/tasks/image-sources.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Sanity Check (stable-2.17)
  • GitHub Check: Sanity Check (stable-2.9)
🔇 Additional comments (8)
galaxy.yml (1)

12-12: Bump collection version to 2.3.0
Version bump from 2.2.0 to 2.3.0 aligns with the new acm.utils enhancements. Ensure this is reflected across all metadata and documentation.

roles/acm/utils/defaults/main.yml (1)

4-7: Add default for unqualified search registries
The new utils_unqualified_search_registries default provides sensible fallback registries for unqualified image lookups. It matches the argument spec and README.

ansible-collection-redhatci-ocp.spec (1)

6-6: Update RPM spec version to 2.3.EPOCH
This aligns the RPM spec version with the collection bump for the newly added image-sources feature in acm.utils.

roles/acm/utils/README.md (1)

8-16: Document new image-sources variables in table
The addition of utils_unqualified_search_registries is well aligned with the defaults and argument specs, and the table formatting is clear.

roles/acm/utils/meta/argument_specs.yml (1)

41-64: Define image-sources argument spec
The spec enforces required parameters (utils_registry, utils_imagesource_file) and provides a default for utils_unqualified_search_registries. Descriptions and types are clear and consistent with the role’s implementation.

roles/acm/utils/tasks/image-sources.yml (3)

1-3: Header and task declaration look good
Using --- and a top-level - name: is valid for a tasks file in a role.


23-27: Inspect indentation of the set_fact block
The literal block (|-) will preserve all leading spaces, which may lead to unexpected whitespace in your generated registries.conf. Please verify how utils_acm_registries is consumed downstream to ensure the indent is trimmed or acceptable.


41-47: Validate availability of the urlsplit filter
You use {{ utils_registry | urlsplit('netloc') }}—ensure that the urlsplit Jinja2 filter is provided by your Ansible version or a loaded collection (e.g., ansible.netcommon). If it’s not, this will error out.

Copy link

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (4)
roles/acm/utils/meta/argument_specs.yml (4)

47-51: Clarify utils_registry formatting.
Consider specifying if this should be a hostname (e.g., registry.local:5000) or a full URL with protocol, and whether trailing slashes are allowed.


52-61: Improve example formatting for utils_hub_mirrors.
The description block is helpful, but the nested YAML example could use consistent indentation. You might illustrate it as:

- mirrors:
    - mirror1
  source: source1

62-67: Clarify path expectations for utils_imagesource_file.
Does this accept only absolute paths, relative to the playbook, or both? Adding a brief note will help users avoid confusion.


68-74: Align default utils_unqualified_search_registries.
Since this default also appears in defaults/main.yml, ensure they stay in sync or consider centralizing it to avoid drift.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a134ca7 and e417e26.

📒 Files selected for processing (6)
  • ansible-collection-redhatci-ocp.spec (2 hunks)
  • galaxy.yml (1 hunks)
  • roles/acm/utils/README.md (2 hunks)
  • roles/acm/utils/defaults/main.yml (1 hunks)
  • roles/acm/utils/meta/argument_specs.yml (1 hunks)
  • roles/acm/utils/tasks/image-sources.yml (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • galaxy.yml
  • roles/acm/utils/defaults/main.yml
🚧 Files skipped from review as they are similar to previous changes (3)
  • roles/acm/utils/README.md
  • ansible-collection-redhatci-ocp.spec
  • roles/acm/utils/tasks/image-sources.yml
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Sanity Check (stable-2.17)
  • GitHub Check: Sanity Check (stable-2.9)
🔇 Additional comments (1)
roles/acm/utils/meta/argument_specs.yml (1)

41-46: New image-sources argument spec follows existing patterns and explains its purpose clearly.
Well structured and consistent with the other argument specs.

This is a functionality that is required to deploy clusters with a
different version than the hub. It is used by the spoke clusters in
disconnected mode.
Copy link

@dcibot
Copy link
Collaborator

dcibot commented May 14, 2025

@dcibot
Copy link
Collaborator

dcibot commented May 14, 2025

@dcibot
Copy link
Collaborator

dcibot commented May 15, 2025

@dcibot
Copy link
Collaborator

dcibot commented May 15, 2025

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.

2 participants