feat: Handle reconciling after internalMemberCluster has been deleted.#92
feat: Handle reconciling after internalMemberCluster has been deleted.#92minhng22 merged 3 commits intoAzure:mainfrom
Conversation
There was a problem hiding this comment.
While testing this var it keeps returning error expecting pointer, got nil, and for other CR we often don't use pointer var so I updated.
There was a problem hiding this comment.
I wonder if you can paste the error here? it shouldn't matter if the variable is pointer or not.
There was a problem hiding this comment.
The error is {"error": "expected pointer, but got nil"}. I actually realized that if we don't init a pointer var, it's default to null, so the current way actually needs to be updated. I didn't know that at all. I tested on playground https://go.dev/play/p/eVaPZADDu8l
There was a problem hiding this comment.
yes, an uninitialized pointer is nil. What's expected. I wonder why we need it to be initialized? Is that on the hubClient.Get?
There was a problem hiding this comment.
hubclient.Get is the same as other client.Get that we use. I don't know why it requires a pointer var and not ok with nil. For other usage of client.Get, I see we often pass in a var pointer, so this solution is really just following the convention. When I have more time I would dig into this for a better answer. At least I think it won't break anything since we do what's done in other places of this and other repo(s).
pkg/controllers/membership/membership_controller_integration_test.go
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
I wonder if you can paste the error here? it shouldn't matter if the variable is pointer or not.
Co-authored-by: Ryan Zhang <yangzhangrice@hotmail.com>
There was a problem hiding this comment.
yes, an uninitialized pointer is nil. What's expected. I wonder why we need it to be initialized? Is that on the hubClient.Get?
--------- Signed-off-by: Zhiying Lin <zhiyingl456@gmail.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: britaniar <145056127+britaniar@users.noreply.github.com>
Description of your changes
I have:
make reviewableto ensure this PR is ready for review.How has this code been tested
Special notes for your reviewer