Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Fix cast panic in operator.go #492

Merged
merged 1 commit into from Jul 21, 2020
Merged

Fix cast panic in operator.go #492

merged 1 commit into from Jul 21, 2020

Conversation

luxas
Copy link
Contributor

@luxas luxas commented Jul 21, 2020

Objects given to informed add/update/delete events are always pointers to structs, so a cast of that object to a struct (without the pointer) will always result in a panic.
In the case of this deletefunc, we've already cast the object to a pointer in checkCustomResourceType and returned the struct alone, so just use that in the status.ObserveReleaseConditions call

cc @hiddeco

Objects given to informed add/update/delete events are always pointers to structs, so a cast of that object to a struct (without the pointer) will always result in a panic.
In the case of this deletefunc, we've already cast the object to a pointer in `checkCustomResourceType` and returned the struct alone, so just use that in the `status.ObserveReleaseConditions` call
Copy link
Member

@hiddeco hiddeco left a comment

Choose a reason for hiding this comment

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

Excellent 🎣

@hiddeco hiddeco merged commit dd41360 into fluxcd:master Jul 21, 2020
@saada saada mentioned this pull request Jul 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants