Skip to content

feat: Handle reconciling after internalMemberCluster has been deleted.#92

Merged
minhng22 merged 3 commits intoAzure:mainfrom
minhng22:imc-pr
Jun 14, 2022
Merged

feat: Handle reconciling after internalMemberCluster has been deleted.#92
minhng22 merged 3 commits intoAzure:mainfrom
minhng22:imc-pr

Conversation

@minhng22
Copy link
Member

Description of your changes

  • Handle reconciling after internalMemberCluster has been deleted.
  • Update internalMemberCluster to not using pointer var.

I have:

  • Run make reviewable to ensure this PR is ready for review.

How has this code been tested

Special notes for your reviewer

@minhng22 minhng22 requested a review from ryanzhang-oss June 13, 2022 23:56
Copy link
Member Author

Choose a reason for hiding this comment

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

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if you can paste the error here? it shouldn't matter if the variable is pointer or not.

Copy link
Member Author

Choose a reason for hiding this comment

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

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

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, an uninitialized pointer is nil. What's expected. I wonder why we need it to be initialized? Is that on the hubClient.Get?

Copy link
Member Author

Choose a reason for hiding this comment

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

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).

@minhng22 minhng22 requested review from Arvindthiru and helayoty June 14, 2022 00:09
Copy link
Contributor

Choose a reason for hiding this comment

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

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>
@minhng22 minhng22 requested a review from ryanzhang-oss June 14, 2022 16:22
Copy link
Contributor

Choose a reason for hiding this comment

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

yes, an uninitialized pointer is nil. What's expected. I wonder why we need it to be initialized? Is that on the hubClient.Get?

@minhng22 minhng22 merged commit e47cc47 into Azure:main Jun 14, 2022
@minhng22 minhng22 deleted the imc-pr branch June 14, 2022 21:19
britaniar added a commit to britaniar/fleet that referenced this pull request Jun 16, 2025
---------
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>
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.

2 participants