Skip to content

Fix panic when annotation of ingress is empty#1437

Merged
aryan9600 merged 1 commit intofluxcd:mainfrom
pinkavaj:pi-fix-nil
May 30, 2023
Merged

Fix panic when annotation of ingress is empty#1437
aryan9600 merged 1 commit intofluxcd:mainfrom
pinkavaj:pi-fix-nil

Conversation

@pinkavaj
Copy link
Contributor

When the annotation of ingress is not set, the returned value is nil (not empty map). Trying to assign to this map leads to panic.

Closes #1277

@pinkavaj pinkavaj requested a review from stefanprodan as a code owner May 23, 2023 22:28
@pinkavaj pinkavaj force-pushed the pi-fix-nil branch 2 times, most recently from b9f030f to a1d0ed0 Compare May 24, 2023 07:24
Copy link
Member

@aryan9600 aryan9600 left a comment

Choose a reason for hiding this comment

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

thanks for opening this PR @pinkavaj!

Copy link
Member

@aryan9600 aryan9600 left a comment

Choose a reason for hiding this comment

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

thanks for opening this PR @pinkavaj!

When the annotation of ingress is not set, the returned value is nil
(not empty map). Trying to assign to this map leads to panic.

Signed-off-by: Jiří Pinkava <j-pi@seznam.cz>
@codecov-commenter
Copy link

Codecov Report

Patch coverage has no change and project coverage change: -0.03 ⚠️

Comparison is base (e71ce18) 54.54% compared to head (d256487) 54.52%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1437      +/-   ##
==========================================
- Coverage   54.54%   54.52%   -0.03%     
==========================================
  Files          84       84              
  Lines       10140    10142       +2     
==========================================
- Hits         5531     5530       -1     
- Misses       3953     3955       +2     
- Partials      656      657       +1     
Impacted Files Coverage Δ
pkg/router/util.go 82.35% <0.00%> (-17.65%) ⬇️

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

Copy link
Member

@aryan9600 aryan9600 left a comment

Choose a reason for hiding this comment

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

lgtm! thanks @pinkavaj 🏅

@aryan9600 aryan9600 merged commit d960666 into fluxcd:main May 30, 2023
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.

Empty annotations cause IngressRouter to hit nil crash

3 participants