Skip to content

Complete source images - #866

Open
filippomc wants to merge 3 commits into
developfrom
feature/CH-287
Open

Complete source images#866
filippomc wants to merge 3 commits into
developfrom
feature/CH-287

Conversation

@filippomc

@filippomc filippomc commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Closes CH-287

Implemented solution

  • Add support for sub chart images
  • Add support for other hardcoded images (dbs, etc)
  • Update docs

All image paths/values are exported as values-overrides.yaml, so it's easier to change everything in one place.
harness-deployment generate that file with every image that's relevant

How to test this PR

Run harness-deployment and then check deployment/helm/values-overrides.yaml.
It should contain all the relevant source images.

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 seta 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 do not change the preexisting api in any way
  • This PR and the issue are tagged as a breaking-change and the migration procedure is well described above

Possible deployment updates issues (select one):

  • There is no reason why deployments based on CloudHarness may break after the current 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

domain="my.local", namespace='test', env='dev', local=False, tag=1, registry='reg')

helm_path = out_path / HELM_CHART_PATH
overrides = yaml.safe_load(open(helm_path / VALUES_OVERRIDES_PATH))
overrides_path = helm_path / VALUES_OVERRIDES_PATH

# Editing the generated file is enough to change the deployed image: Helm applies it after values.yaml
overrides = yaml.safe_load(open(overrides_path))
helm_path = out_path / HELM_CHART_PATH

# values-template-chartimages.yaml overrides only the tag: the overrides file shows the merged result
overrides = yaml.safe_load(open(helm_path / VALUES_OVERRIDES_PATH))
out_path = tmp_path / 'test_values_overrides_no_include'
create_helm_chart([CLOUDHARNESS_ROOT, RESOURCES], output_path=out_path, domain="my.local",
namespace='test', env='dev', local=False, tag=1)
overrides = yaml.safe_load(open(out_path / HELM_CHART_PATH / VALUES_OVERRIDES_PATH))
# An application declaring a prebuilt image is not built, so that image IS an overridable
# source, unlike the image CloudHarness would have built for it
assert values[KEY_APPS]['myapp']['build'] is False
overrides = yaml.safe_load(open(out_path / HELM_CHART_PATH / VALUES_OVERRIDES_PATH))

@aranega aranega left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The PR looks good to me, I just added a comment/nitpick about the fact of using some hardcoded path, but I'm unsure the line in question is something which is supposed to run on the CI/CD or on the user's machine.

arguments = deployment_step.get("arguments")
if arguments:
# Apply the generated image overrides after values.yaml so editing them wins
values_overrides_file = f"./{DEPLOYMENT_PATH}/{HELM_CHART_PATH}/{VALUES_OVERRIDES_PATH}"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nitpick: it could be cool to use more Path object from the pathlib builtin libs as it removes the use of / as os dependent separator. This is something which is not entirely coherent through our base code (CH-269 points to this as something to solve), but in some cases, I'm not sure if that's meant to be run only on the CI/CD (usually linux-based) or on the user machine.

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