Skip to content

CH-297 Handle missing registry Secrets when generating workflows - #880

Open
afonsobspinto wants to merge 2 commits into
developfrom
feature/CH-297
Open

afonsobspinto wants to merge 2 commits into
developfrom
feature/CH-297

Conversation

@afonsobspinto

@afonsobspinto afonsobspinto commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Closes CH-297.

Implemented solution

Handle missing, null or empty registry Secret configuration without crashing. Add imagePullSecrets to the workflow only when a Secret name exists; preserve valid named references.

This enables local/test workflow generation when images are already available or accessible without an explicit pull Secret. Deployments with a valid registry Secret already work.

How to test this PR

From the repository root:

conda activate ch
cd libraries/cloudharness-common
python -m pytest -q tests/test_workflow.py -k 'registry_secret or image_pull_secret'

These nine tests run without Kubernetes. Check that:

  • Missing registry.secret, null, {}, an empty string and empty/null names are treated as no configured Secret.
  • Rendering without a Secret succeeds and omits spec.imagePullSecrets, rather than generating an empty reference.
  • With registry.secret.name: private-registry, rendering retains exactly imagePullSecrets: [{name: private-registry}].

Sanity checks:

  • The pull request is explicitly linked to the relevant issue(s)
  • The issue is well described: clearly states the problem and the general proposed solution(s)
  • In this PR it is explicitly stated how to test the current change
  • The issue sets the scope and the type of issue (bug, story, task, etc.)
  • The relevant components are indicated in the issue (if any)
  • All the automated test checks are passing
  • All the linked issues are included in one Sprint
  • All the linked issues are in the Review state
  • All the linked issues are assigned

Breaking changes (select one):

  • The present changes preserve the preexisting API and behavior
  • This PR and the issue are tagged as a breaking-change and the migration procedure is described above

Possible deployment updates issues (select one):

  • There is no reason why existing deployments should break after this update
  • This PR and the issue are tagged as alert:deployment

Test coverage (select one):

  • Tests for the relevant cases are included in this PR
  • The changes included in this PR are out of the current test coverage scope

Documentation (select one):

  • The documentation has been updated to match the current changes
  • The changes included in this PR are out of the current documentation scope

Nice to have (if relevant):

  • Screenshots of the changes
  • Explanatory video/animated GIF

@afonsobspinto
afonsobspinto added this pull request to stack #881 October 15, 2026 21:05
@afonsobspinto
afonsobspinto removed this pull request from stack #881 October 15, 2026 21:39
@afonsobspinto
afonsobspinto added this pull request to stack #882 October 15, 2026 21:39
@afonsobspinto
afonsobspinto marked this pull request as ready for review October 15, 2026 21:59
@afonsobspinto
afonsobspinto removed this pull request from stack #882 October 15, 2026 22:00
@afonsobspinto
afonsobspinto changed the base branch from feature/CH-296 to develop October 15, 2026 22:00
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.

1 participant