Skip to content
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

fix: Fix issue preventing from detecting images from a Helm Chart with an aliased sub-chart #1038

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

rm3l
Copy link
Member

@rm3l rm3l commented Jan 23, 2025

Description

This PR fixes the issue reported in #1037, where oc-mirror might not be able to detect the images from a Helm Chart that has an aliased sub-chart. See #1037 for more context.
This PR mimics what helm template does, by processing the dependencies prior to rendering the values. This ensures that the aliases are properly resolved.

Since this is my very first contribution to this repo, please do let me know if I've missed anything.
Thanks.

Github / Jira issue:

Fixes #1037

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code Improvements (Refactoring, Performance, CI upgrades, etc)
  • Internal repo assets (diagrams / docs on github repo)
  • This change requires a documentation update on openshift docs

How Has This Been Tested?

A new test case with a sample chart archive has been provided. The test would fail without the changes in pkg/cli/mirror/helm.go.

Expected Outcome

Tests should pass.

rm3l added 3 commits January 24, 2025 00:34
… the Chart

Otherwise, the error is hidden
and it gets hard to figure out what's wrong.
This way, the aliased subcharts are processed correctly.
This is how `helm template` seems to handle subcharts.
@openshift-ci openshift-ci bot requested review from aguidirh and sherine-k January 23, 2025 23:48
Copy link

openshift-ci bot commented Jan 23, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: rm3l
Once this PR has been reviewed and has the lgtm label, please assign jerpeter1 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@rm3l
Copy link
Member Author

rm3l commented Jan 24, 2025

/retest

@rm3l
Copy link
Member Author

rm3l commented Jan 24, 2025

go: downloading github.com/cenkalti/backoff v2.2.1+incompatible
go: downloading github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/redis/go-redis/v9: /usr/lib/golang/pkg/tool/linux_amd64/compile: signal: killed
/usr/bin/go: line 19:   348 Killed                  GO_COMPLIANCE_INFO=0 GO_COMPLIANCE_DEBUG=0 go.real "${ARGS[@]}"
make: *** [Makefile:120: build] Error 137
{"component":"entrypoint","error":"wrapped process failed: exit status 2","file":"sigs.k8s.io/prow/pkg/entrypoint/run.go:84","func":"sigs.k8s.io/prow/pkg/entrypoint.Options.internalRun","level":"error","msg":"Error executing test process","severity":"error","time":"2025-01-24T10:12:24Z"} 
INFO[2025-01-24T10:12:26Z] Ran for 30m41s                               
ERRO[2025-01-24T10:12:26Z] Some steps failed:                           
ERRO[2025-01-24T10:12:26Z] 
  * could not run steps: step e2e failed: test "e2e" failed: could not watch pod: the pod ci-op-10fshrdc/e2e failed after 17m58s (failed containers: test): ContainerFailed one or more containers exited

And

        Jan 24 11:39:47.174820 ip-10-0-17-101 kubenswrapper[2466]: I0124 11:39:47.174792    2466 ???:1] "http: TLS handshake error from 10.0.17.101:60680: EOF"
        Jan 24 11:39:47.195345 ip-10-0-117-159 kubenswrapper[2471]: I0124 11:39:47.195298    2471 ???:1] "http: TLS handshake error from 10.0.117.159:38552: EOF"
        Jan 24 11:39:49.946367 ip-10-0-121-197 ovs-vswitchd[1138]: ovs|02373|connmgr|INFO|br-int<->unix#15: 18 flow_mods in the 25 s starting 58 s ago (9 adds, 9 deletes)
        Jan 24 11:39:52.143617 ip-10...
    Gomega truncated this representation as it exceeds 'format.MaxLength'.
    Consider having the object provide a custom 'GomegaStringer' representation
    or adjust the parameters in Gomega's 'format' package.
    Learn more here: https://onsi.github.io/gomega/#adjusting-output
    to contain substring
        <string>: ip-10-0-117-159.us-west-2.compute.internal
    In [It] at: github.com/openshift/origin/test/extended/cli/admin.go:51 @ 01/24/25 11:40:50.381

Any clue why the tests are failing? I couldn't determine if the failures are related to the changes in this PR.

/retest

@rm3l
Copy link
Member Author

rm3l commented Jan 25, 2025

/test okd-scos-e2e-aws-ovn

Copy link

openshift-ci bot commented Jan 25, 2025

@rm3l: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@r4f4
Copy link
Contributor

r4f4 commented Jan 28, 2025

@rm3l We appreciate the contribution. At the moment we are super busy with GA tasks but we'll review the PR as soon as we can.

@rm3l
Copy link
Member Author

rm3l commented Jan 28, 2025

@rm3l We appreciate the contribution. At the moment we are super busy with GA tasks but we'll review the PR as soon as we can.

@r4f4 Sure - no problem. Thanks.

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.

Unable to mirror Helm Chart with aliased sub-chart: no images detected
2 participants