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

Update auth config json test #844

Merged
merged 1 commit into from
Aug 30, 2024
Merged

Update auth config json test #844

merged 1 commit into from
Aug 30, 2024

Conversation

adam-cattermole
Copy link
Member

@adam-cattermole adam-cattermole commented Aug 30, 2024

One of the integration tests is failing https://github.com/Kuadrant/kuadrant-operator/actions/runs/10625397804/job/29455286217#step:7:122

I think this is related to the changes to store as v1beta2. I can't quite pinpoint exactly why but before the credentials field had the authorizationHeader present (even though it's omitempty), whereas now it does not - I'm guessing some logic in the webhook was incorrect and was creating an empty Prefixed so the pointer was not null - I've updated all 3 occurrences in the json string.

Before:

"credentials":{"authorizationHeader":{}}

After:

"credentials":{}

I believe the behaviour now looks correct but looking to @guicassolato or @alexsnaps to confirm.

Signed-off-by: Adam Cattermole <acatterm@redhat.com>
Copy link

codecov bot commented Aug 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.28%. Comparing base (ece13e8) to head (3375dea).
Report is 178 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #844      +/-   ##
==========================================
+ Coverage   80.20%   82.28%   +2.07%     
==========================================
  Files          64       76      +12     
  Lines        4492     6090    +1598     
==========================================
+ Hits         3603     5011    +1408     
- Misses        600      740     +140     
- Partials      289      339      +50     
Flag Coverage Δ
bare-k8s-integration 4.50% <ø> (?)
controllers-integration 72.26% <ø> (?)
gatewayapi-integration 10.95% <ø> (?)
integration ?
istio-integration 56.20% <ø> (?)
unit 31.58% <ø> (+1.55%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
api/v1beta1 (u) 71.42% <ø> (ø)
api/v1beta2 (u) 85.35% <80.00%> (-6.08%) ⬇️
pkg/common (u) 88.13% <ø> (-0.70%) ⬇️
pkg/istio (u) 72.50% <ø> (-1.41%) ⬇️
pkg/log (u) 94.73% <ø> (ø)
pkg/reconcilers (u) ∅ <ø> (∅)
pkg/rlptools (u) 83.64% <ø> (+4.19%) ⬆️
controllers (i) 82.87% <82.35%> (+6.06%) ⬆️

see 42 files with indirect coverage changes

@adam-cattermole
Copy link
Member Author

adam-cattermole commented Aug 30, 2024

My only guess is something to do with this kubebuilder validation was making Credentials_In not empty which meant that building the credentials in the original webhook to convert from v1beta1 -> v1beta2 set authorizationHeader to an empty Prefixed instead of null?

Copy link
Contributor

@guicassolato guicassolato left a comment

Choose a reason for hiding this comment

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

IDK why exactly we were getting {"authorizationHeader":{}} before, but it could be due to a difference in the procedure between mashalling the content before versus just reading it from storage now.

Either way, the fix seems correct to me.

Thanks, @adam-cattermole!

@adam-cattermole adam-cattermole merged commit b7a58ca into main Aug 30, 2024
30 checks passed
@adam-cattermole adam-cattermole deleted the update-auth-test branch August 30, 2024 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants