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

test: fix: add status sub resource to fake clients #1

Merged

Conversation

zwpaper
Copy link

@zwpaper zwpaper commented Jul 28, 2023

What type of PR is this?

/kind failing-test

What this PR does / why we need it:

ctrl runtime added a subresource option to fake client in 0.15, make it failed to patch eq and podgroup.

also found a failing test case, changed it together

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?


Signed-off-by: Zhang Wei <kweizh@gmail.com>
@@ -237,7 +237,10 @@ func setUpEQ(ctx context.Context,
s := scheme.Scheme
utilruntime.Must(v1alpha1.AddToScheme(s))

client := fake.NewClientBuilder().WithScheme(s).Build()
client := fake.NewClientBuilder().
Copy link
Owner

Choose a reason for hiding this comment

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

thanks for the catch!

@Huang-Wei Huang-Wei merged commit 6a76206 into Huang-Wei:bump-k8s-1.27 Jul 28, 2023
Huang-Wei pushed a commit that referenced this pull request Jul 28, 2023
Signed-off-by: Zhang Wei <kweizh@gmail.com>
@Huang-Wei
Copy link
Owner

From the release notes of controller-runtime v0.15.0:

  • Testing: Fake client status handling (⚠️ Fakeclient: Fix status handling kubernetes-sigs/controller-runtime#2259)
    • Added a new WithStatusSubresource option and pre-populating it with
      all in-tree resources that have a status subresource
    • Update and Patch methods now don't change the status for any such
      resource anymore
    • The status clients Update and Patch methods now only change the status
      for any such resource

@zwpaper zwpaper deleted the bump-k8s-1.27-ctrl-runtime branch July 29, 2023 05:04
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