Skip to content

Conversation

viccuad
Copy link
Member

@viccuad viccuad commented Aug 4, 2025

Description

Fix #1298

This fixes error on creating the resource catalog for the first time.

The rustls dependency is configured exactly as we do in policy-fetcher.

Test

Added new e2e test for kwctl scaffold admission-request. Doubles as e2e test for #1300.

Additional Information

Tradeoff

Potential improvement

@viccuad viccuad requested a review from a team as a code owner August 4, 2025 15:01
@github-project-automation github-project-automation bot moved this to Pending review in Kubewarden Aug 4, 2025
Cargo.toml Outdated
@@ -51,6 +51,10 @@ hostname-validator = "1.1.1"
reqwest = { version = "0", default-features = false, features = [
"rustls-tls-native-roots",
] }
rustls = { version = "0.23", default-features = false, features = [
Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe it's better to re-export on policy-fetcher and consume it that way.

Copy link
Member

Choose a reason for hiding this comment

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

Fine by me. One less dependency to keep on sync among our code.

@viccuad viccuad removed this from Kubewarden Aug 4, 2025
tests/e2e.rs Outdated
.arg(&deployment_yaml);
cmd.assert().success();

// Fail if deployment.yaml test data file was changed
Copy link
Member Author

Choose a reason for hiding this comment

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

test will fail until rebased on top of #1300.

Copy link
Member

Choose a reason for hiding this comment

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

Let's wait to rebase it before merge it then.

Copy link
Member Author

Choose a reason for hiding this comment

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

Rebased onto main, the e2e test was copied to the other PR and merged already.

Copy link
Member

@jvanz jvanz left a comment

Choose a reason for hiding this comment

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

We need to wait the rebase to see if the tests are green. So far, LGTM

tests/e2e.rs Outdated
Copy link
Member

Choose a reason for hiding this comment

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

ouch, I've already provided a e2e test for that inside of the other PR... I think we can drop this one

Cargo.toml Outdated
Comment on lines 54 to 57
rustls = { version = "0.23", default-features = false, features = [
"std",
"tls12",
] }
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
rustls = { version = "0.23", default-features = false, features = [
"std",
"tls12",
] }
# We will use the same version of rustls used by policy-fetcher
rustls = { version = "0", default-features = false, features = [
"std",
"tls12",
] }

Copy link
Member

Choose a reason for hiding this comment

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

Changing that inside of policy-fetcher and exporting it will be quite a pain. This should be enough.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@flavio flavio force-pushed the fix/scaffold-client branch 2 times, most recently from 756007d to a5d7eec Compare August 5, 2025 07:24
viccuad added 2 commits August 5, 2025 09:55
Signed-off-by: Víctor Cuadrado Juan <vcuadradojuan@suse.de>
This fixes error on creating the resource catalog for the first time.

Signed-off-by: Víctor Cuadrado Juan <vcuadradojuan@suse.de>
@viccuad viccuad force-pushed the fix/scaffold-client branch from a5d7eec to c9ce0c9 Compare August 5, 2025 07:55
@viccuad
Copy link
Member Author

viccuad commented Aug 5, 2025

Rebased on top of main, after merging the other PR and the e2e test there.

@viccuad viccuad requested review from flavio and jvanz August 5, 2025 08:04
Copy link

codecov bot commented Aug 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.47%. Comparing base (6e4108d) to head (2c5ab5c).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1301      +/-   ##
==========================================
+ Coverage   87.46%   87.47%   +0.01%     
==========================================
  Files          34       34              
  Lines        4932     4936       +4     
==========================================
+ Hits         4314     4318       +4     
  Misses        618      618              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Víctor Cuadrado Juan <vcuadradojuan@suse.de>
@@ -51,6 +51,7 @@ hostname-validator = "1.1.1"
reqwest = { version = "0", default-features = false, features = [
"rustls-tls-native-roots",
] }
rustls = { version = "0.23", default-features = false }
Copy link
Member

Choose a reason for hiding this comment

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

Have you tried to relax that even more, like version = "0". This should avoid any complication with the next minor release of rustls

Copy link
Member Author

Choose a reason for hiding this comment

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

I prefer to leave it as is, we will get the bot to bump anyways.

Copy link
Member

@flavio flavio left a comment

Choose a reason for hiding this comment

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

LGTM, I'm fine merging it as it is. You can ignore the last comment I wrote if you want

@viccuad viccuad merged commit 41ceaa7 into kubewarden:main Aug 5, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kwctl scaffold admission-request errors when creating the resource catalog
3 participants