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

fix: add IgnoreUnexported to Node Taints comparison #1371

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

afarbos
Copy link
Contributor

@afarbos afarbos commented Nov 18, 2024

What type of PR is this?

/kind bug

What this PR does / why we need it:

The goal of this PR is to fix a panic after creating a cluster around node taint:

panic: cannot handle unexported field at {[]*containerpb.NodeTaint}[0].state:
"cloud.google.com/go/container/apiv1/containerpb".NodeTaint
consider using a custom Comparer; if you control the implementation of type, you can also consider using an Exporter, AllowUnexported, or cmpopts.IgnoreUnexported [recovered]
	panic: cannot handle unexported field at {[]*containerpb.NodeTaint}[0].state:

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

Full error and stack trace bellow:

panic: cannot handle unexported field at {[]*containerpb.NodeTaint}[0].state:
	"cloud.google.com/go/container/apiv1/containerpb".NodeTaint
consider using a custom Comparer; if you control the implementation of type, you can also consider using an Exporter, AllowUnexported, or cmpopts.IgnoreUnexported [recovered]
	panic: cannot handle unexported field at {[]*containerpb.NodeTaint}[0].state:
	"cloud.google.com/go/container/apiv1/containerpb".NodeTaint
consider using a custom Comparer; if you control the implementation of type, you can also consider using an Exporter, AllowUnexported, or cmpopts.IgnoreUnexported

goroutine 90 [running]:
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile.func1()
	sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:111 +0x1e5
panic({0x2d817a0?, 0xc0021251a0?})
	runtime/panic.go:770 +0x132
github.com/google/go-cmp/cmp.validator.apply({{}}, 0xc001284dc0, {0x335a9e0?, 0xc0005bf630?, 0xc002125100?}, {0x335a9e0?, 0xc001544b90?, 0x335a9e0?})
	github.com/google/[email protected]/cmp/options.go:248 +0x3ab
github.com/google/go-cmp/cmp.(*state).tryOptions(0xc001284dc0, {0x3d13170, 0x335a9e0}, {0x335a9e0?, 0xc0005bf630?, 0x10?}, {0x335a9e0?, 0xc001544b90?, 0xc000680008?})
	github.com/google/[email protected]/cmp/compare.go:306 +0x109
github.com/google/go-cmp/cmp.(*state).compareAny(0xc001284dc0, {0x3ceca30, 0xc0020a2800})
	github.com/google/[email protected]/cmp/compare.go:261 +0x4c7
github.com/google/go-cmp/cmp.(*state).compareStruct(0xc001284dc0, {0x3d13170, 0x34a8300}, {0x34a8300?, 0xc0005bf630?, 0x4182df?}, {0x34a8300?, 0xc001544b90?, 0x407f4b?})
	github.com/google/[email protected]/cmp/compare.go:414 +0x586
github.com/google/go-cmp/cmp.(*state).compareAny(0xc001284dc0, {0x3cecac0, 0xc00212e680})
	github.com/google/[email protected]/cmp/compare.go:289 +0xcce
github.com/google/go-cmp/cmp.(*state).comparePtr(0xc001284dc0, {0x3d13170, 0x3367960}, {0x3367960?, 0xc000272d48?, 0xc00212e640?}, {0x3367960?, 0xc00138e100?, 0xc0011edc08?})
	github.com/google/[email protected]/cmp/compare.go:566 +0x373
github.com/google/go-cmp/cmp.(*state).compareAny(0xc001284dc0, {0x3ceca60, 0xc000383e60})
	github.com/google/[email protected]/cmp/compare.go:295 +0xb72
github.com/google/go-cmp/cmp.(*state).statelessCompare(0xc001284dc0, {0x3ceca60?, 0xc000383e60?})
	github.com/google/[email protected]/cmp/compare.go:232 +0x7a
github.com/google/go-cmp/cmp.(*state).compareSlice.func2(0x0?, 0xc000383f80?)
	github.com/google/[email protected]/cmp/compare.go:480 +0x5a
github.com/google/go-cmp/cmp/internal/diff.Difference(0x1, 0x1, 0xc0011ee038)
	github.com/google/[email protected]/cmp/internal/diff/diff.go:286 +0x3e2
github.com/google/go-cmp/cmp.(*state).compareSlice(0xc001284dc0, {0x3d13170, 0x2d112c0}, {0x2d112c0?, 0xc000f9ae28?, 0xc002125f80?}, {0x2d112c0?, 0xc000f9ae40?, 0x30?})
	github.com/google/[email protected]/cmp/compare.go:479 +0x9ac
github.com/google/go-cmp/cmp.(*state).compareAny(0xc001284dc0, {0x3cecb50, 0xc00212e600})
	github.com/google/[email protected]/cmp/compare.go:291 +0xbbb
github.com/google/go-cmp/cmp.Equal({0x2d112c0, 0xc000f9ae28}, {0x2d112c0, 0xc000f9ae40}, {0x0?, 0x2b?, 0x0?})
	github.com/google/[email protected]/cmp/compare.go:97 +0x65
sigs.k8s.io/cluster-api-provider-gcp/cloud/services/container/nodepools.(*Service).checkDiffAndPrepareUpdateConfig(0xc0009182c0, 0xc0011c48c0)
	sigs.k8s.io/cluster-api-provider-gcp/cloud/services/container/nodepools/reconcile.go:373 +0x555
sigs.k8s.io/cluster-api-provider-gcp/cloud/services/container/nodepools.(*Service).Reconcile(0xc0009182c0, {0x3cef5e8, 0xc00003c000})
	sigs.k8s.io/cluster-api-provider-gcp/cloud/services/container/nodepools/reconcile.go:147 +0xfa5
sigs.k8s.io/cluster-api-provider-gcp/exp/controllers.(*GCPManagedMachinePoolReconciler).reconcile(0xc001066078?, {0x3cef5e8, 0xc00003c000}, 0xc000927d10)
	sigs.k8s.io/cluster-api-provider-gcp/exp/controllers/gcpmanagedmachinepool_controller.go:334 +0x4de
sigs.k8s.io/cluster-api-provider-gcp/exp/controllers.(*GCPManagedMachinePoolReconciler).Reconcile(0xc000d98b40, {0x3cef540?, 0xc000e7ba70?}, {{{0xc000e00b60?, 0x0?}, {0xc0003af650?, 0xc000b39d10?}}})
	sigs.k8s.io/cluster-api-provider-gcp/exp/controllers/gcpmanagedmachinepool_controller.go:316 +0x8df
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile(0x3cf66a0?, {0x3cef540?, 0xc000e7ba70?}, {{{0xc000e00b60?, 0xb?}, {0xc0003af650?, 0x0?}}})
	sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:114 +0xb7
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0xc000674210, {0x3cef578, 0xc000936c30}, {0x3188560, 0xc000b48820})
	sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:311 +0x3bc
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0xc000674210, {0x3cef578, 0xc000936c30})
	sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:261 +0x1be
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2()
	sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:222 +0x79
created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2 in goroutine 220
	sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:218 +0x486

Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests

Release note:

fix panic when setting node taints

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 18, 2024
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Nov 18, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @afarbos. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Nov 18, 2024
Copy link

netlify bot commented Nov 18, 2024

Deploy Preview for kubernetes-sigs-cluster-api-gcp ready!

Name Link
🔨 Latest commit ef0b820
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cluster-api-gcp/deploys/6765a10b7516e40008f9dec7
😎 Deploy Preview https://deploy-preview-1371--kubernetes-sigs-cluster-api-gcp.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@afarbos
Copy link
Contributor Author

afarbos commented Nov 18, 2024

I am not clear, how to add a test in repo. Let me know if what I did is wrong.

@afarbos afarbos marked this pull request as ready for review November 18, 2024 17:55
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 18, 2024
@cpanato
Copy link
Member

cpanato commented Nov 19, 2024

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 19, 2024
@salasberryfin
Copy link
Contributor

salasberryfin commented Nov 21, 2024

Thanks @afarbos. Overall this looks good to me (just added a minor comment) and the template you modified should be enough to update the E2E test for GKE provisioning but, in this case, I see the specific GKE test cases are skipped (you can take a look at it in the prow dashboard).

@cpanato @damdo @richardcase are these E2E tests skipped because there are no changes in the managed cluster code (in ./exp/)? In this case it would be nice to also validate GKE's functionality.

@damdo
Copy link
Member

damdo commented Dec 16, 2024

/assign @cpanato @richardcase

@afarbos afarbos force-pushed the af/fixNodeTaintPanic branch from 2e4af5c to ef0b820 Compare December 20, 2024 16:53
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: afarbos
Once this PR has been reviewed and has the lgtm label, please ask for approval from cpanato. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot
Copy link
Contributor

@afarbos: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cluster-api-provider-gcp-e2e-test ef0b820 link true /test pull-cluster-api-provider-gcp-e2e-test

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@salasberryfin
Copy link
Contributor

Hey @afarbos, thanks for this. I see the GKE tests are now running and seem to be failing, could you take a look at this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants