Skip to content

feat: Added new role for managing registry credentials - #91

Merged
tech2734 merged 1 commit into
redhat-cop:v2from
sabre1041:utility_registry_credentials
Sep 17, 2026
Merged

tech2734 merged 1 commit into
redhat-cop:v2from
sabre1041:utility_registry_credentials

Conversation

@sabre1041

Copy link
Copy Markdown
Contributor

Description

Adds a new role for managing registry credentials. Enables creating a Secret and associating the imagePullSecret to the specified Service Account

Type of Change

  • feat: A new feature
  • fix: A bug fix
  • docs: Documentation changes
  • style: Formatting, missing semi colons, etc; no code change
  • refactor: Refactoring production code
  • test: Adding missing tests, refactoring tests; no production code change
  • chore: Updating configs, etc; no production code change

@sabre1041
sabre1041 force-pushed the utility_registry_credentials branch from 87541ca to 3461d5c Compare September 13, 2026 04:54
@tech2734

Copy link
Copy Markdown

Review Feedback

Nice implementation — the dockerconfigjson secret construction, SA linking via strategic-merge, and idempotency check on imagePullSecrets are all well done. A couple of items:

1. Assertion logic gap — is defined always true given empty defaults

The Assert required parameters task has this condition:

when:
  - >-
    __utility_registry_credentials_secret.resources | length == 0 or
    (utility_registry_credentials_registry_host is defined and
     utility_registry_credentials_registry_username is defined and
     utility_registry_credentials_registry_password is defined)

Since registry_host, registry_username, and registry_password all default to "" in defaults/main.yml, they will always be is defined. This means the assertion always fires — including the case where the secret already exists and the user intentionally omitted registry credentials (expecting a skip). The assertion then fails because the | length > 0 checks inside fail on the empty defaults.

The when should probably check for non-empty values (| default("", true) | length > 0) instead of just is defined, matching the pattern already used on the Create registry credentials secret task which correctly guards with:

utility_registry_credentials_registry_host | default("", true) | length > 0 and
utility_registry_credentials_registry_username | default("", true) | length > 0 and
utility_registry_credentials_registry_password | default("", true) | length > 0

2. Minor — default namespace convention

utility_registry_credentials_namespace defaults to virtualization-migration, which differs from other roles that default to openshift-mtv. May be intentional since this is a utility role not strictly tied to MTV — just flagging for awareness.

@sabre1041
sabre1041 force-pushed the utility_registry_credentials branch from 3461d5c to b6b1212 Compare September 17, 2026 18:28
@sabre1041
sabre1041 force-pushed the utility_registry_credentials branch from b6b1212 to 2760de6 Compare September 17, 2026 18:30
@sabre1041

Copy link
Copy Markdown
Contributor Author

@tech2734 addressed your feedback

Signed-off-by: Andrew Block <andy.block@gmail.com>
@sabre1041
sabre1041 force-pushed the utility_registry_credentials branch from 2760de6 to 71ba087 Compare September 17, 2026 19:04

@tech2734 tech2734 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Assertion checks fixed — looks good. Approved.

@tech2734
tech2734 merged commit 171be1b into redhat-cop:v2 Sep 17, 2026
22 checks passed

This branch was successfully deployed

1 active deployment
external-ci — 71ba0879 Deployed Sep 17, 2026 by sabre1041 via external-approval #626
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