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: skip render the subcharts for sealer build. #1690

Merged
merged 2 commits into from
Sep 8, 2022

Conversation

tgfree7
Copy link
Contributor

@tgfree7 tgfree7 commented Sep 7, 2022

Signed-off-by: tgfree [email protected]

Describe what this PR does / why we need it

Skip render the subcharts.

Does this pull request fix one issue?

Try to fix #1689

@github-actions github-actions bot added the ImageBuilding related to all staff with image building label Sep 7, 2022
@justadogistaken
Copy link
Member

@tgfree7 @kakaZhou719 The render for subcharts should be skipped? I think I need more information.

@tgfree7
Copy link
Contributor Author

tgfree7 commented Sep 7, 2022

@tgfree7 @kakaZhou719 The render for subcharts should be skipped? I think I need more information.

Render subcharts may list unwanted images, like this:
values.yaml for chart apps-all-in-one

app1:
    Registry: release.com
    image: app1:v1_2022

and values.yaml for subcharts app1 in the apps-all-in-one

Registry: test.com
image: app1:v1_2022

In the case, render the subchart app1 will list the unwanted images. test.com/app1:v1_2022

And render subcharts may cause the tpl error, if app1 call the tpl of _helper.tpl in the apps-all-in-one

@justadogistaken
Copy link
Member

@tgfree7 If i'm not mistaken, subcharts has their own values? And of course the parent values could be passed to the subcharts. But what will happen if the user need the "test/com/app1:v1_2022"

@tgfree7
Copy link
Contributor Author

tgfree7 commented Sep 7, 2022

@tgfree7 If i'm not mistaken, subcharts has their own values? And of course the parent values could be passed to the subcharts. But what will happen if the user need the "test/com/app1:v1_2022"

Yes, subcharts has their own values.yaml.
But when we release the chart apps-all-in-one and set the subchart app1( Registry, images,etc.) by the parent chart values.yaml. this means we just need the image release.com/app1:v1_2022 in this helm chart.
For the chart apps-all-in-one, we release the apps(app1,app2,etc) in one chart.

@justadogistaken
Copy link
Member

Okay, I understand what you mean. But in this case, we need to know that the (registry. images) for app1 has been specified in parent values.yaml, Right? What if user assign the app1 (registry. images) in subcharts only? I think it will igonre the image.

@tgfree7
Copy link
Contributor Author

tgfree7 commented Sep 7, 2022

Okay, I understand what you mean. But in this case, we need to know that the (registry. images) for app1 has been specified in parent values.yaml, Right? What if user assign the app1 (registry. images) in subcharts only? I think it will igonre the image.

If user assign the app1 (registry. images) in subcharts only, helm render will use the subcharts' setting.
The subcharts_and_globals shows the details.

@codecov-commenter
Copy link

codecov-commenter commented Sep 7, 2022

Codecov Report

Base: 18.06% // Head: 18.41% // Increases project coverage by +0.35% 🎉

Coverage data is based on head (2e7e155) compared to base (47f8ada).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1690      +/-   ##
==========================================
+ Coverage   18.06%   18.41%   +0.35%     
==========================================
  Files          66       66              
  Lines        5354     5354              
==========================================
+ Hits          967      986      +19     
+ Misses       4265     4242      -23     
- Partials      122      126       +4     
Impacted Files Coverage Δ
build/layerutils/charts/helm.go 44.18% <0.00%> (+44.18%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@justadogistaken
Copy link
Member

Okay, I understand what you mean. But in this case, we need to know that the (registry. images) for app1 has been specified in parent values.yaml, Right? What if user assign the app1 (registry. images) in subcharts only? I think it will igonre the image.

If user assign the app1 (registry. images) in subcharts only, helm render will use the subcharts' setting. The subcharts_and_globals shows the details.

Yes, helm will render, but the render logic in sealer will do the same thing? Could you help confirm this? Write a test for this part will be perfect.

@tgfree7
Copy link
Contributor Author

tgfree7 commented Sep 7, 2022

Okay, I understand what you mean. But in this case, we need to know that the (registry. images) for app1 has been specified in parent values.yaml, Right? What if user assign the app1 (registry. images) in subcharts only? I think it will igonre the image.

If user assign the app1 (registry. images) in subcharts only, helm render will use the subcharts' setting. The subcharts_and_globals shows the details.

Yes, helm will render, but the render logic in sealer will do the same thing? Could you help confirm this? Write a test for this part will be perfect.

Yes, i confirm that RenderHelmChart will render in the same way,and i will write a test for the RenderHelmChart.

@justadogistaken
Copy link
Member

@tgfree7 Thanks for your work. I think you can create test samples(subchart included and excluded). And call the function of sealer, check the expected content.

@tgfree7
Copy link
Contributor Author

tgfree7 commented Sep 7, 2022

@tgfree7 Thanks for your work. I think you can create test samples(subchart included and excluded). And call the function of sealer, check the expected content.

In the test case, where the chart should i store? in the sealer's path test ? I reivew the old test case, the chart ./test/alpine are not found.

@justadogistaken
Copy link
Member

@tgfree7 You can create a testfile dir under the build or buildimage.

@github-actions github-actions bot added the test label Sep 8, 2022
@tgfree7
Copy link
Contributor Author

tgfree7 commented Sep 8, 2022

@tgfree7 You can create a testfile dir under the build or buildimage.

test case added.

@justadogistaken justadogistaken assigned tgfree7 and unassigned tgfree7 and kakaZhou719 Sep 8, 2022
@tgfree7 tgfree7 force-pushed the bugfix/rendersubcharts branch from 2e7e155 to c0c14fe Compare September 8, 2022 02:54
@justadogistaken
Copy link
Member

There is license problem.
make install-addlicense && make filelicense
Could you plz try this command?
And Probably the install-addlicense will fail, in that case, you can try install it yourself, and do make filelicense.

Signed-off-by: tgfree <[email protected]>

test: add TestGetImageList unit test.

Signed-off-by: tgfree <[email protected]>

test: add TestGetImageList unit test.

Signed-off-by: tgfree <[email protected]>
@tgfree7 tgfree7 force-pushed the bugfix/rendersubcharts branch from c0c14fe to 3631c4c Compare September 8, 2022 04:02
@tgfree7
Copy link
Contributor Author

tgfree7 commented Sep 8, 2022

There is license problem. make install-addlicense && make filelicense Could you plz try this command? And Probably the install-addlicense will fail, in that case, you can try install it yourself, and do make filelicense.

ok, license added.

@justadogistaken
Copy link
Member

LGTM
@kakaZhou719 Help check this work.

@kakaZhou719 kakaZhou719 merged commit 7f76157 into sealerio:main Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ImageBuilding related to all staff with image building test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sealer build by RenderHelmChart render subcharts
4 participants