Skip to content

Conversation

@jpbetz
Copy link
Contributor

@jpbetz jpbetz commented Feb 25, 2021

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Migrates one controller over to use the client-go support for server apply. This is something we had agreed to do as part of the KEP for Apply for client-go's typed client

umbrella issue: kubernetes/enhancements#2155

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Release note will be added when all the last change in the umbrella issue is merged

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

TODO

/sig api-machinery
/wg api-expression

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. wg/api-expression Categorizes an issue or PR as relevant to WG API Expression. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. area/code-generation area/dependency Issues or PRs related to dependency changes area/test kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels Feb 25, 2021
@jpbetz jpbetz force-pushed the apply-cluster-role-aggregator branch from ab14069 to c1e72d2 Compare February 25, 2021 17:51
@fedebongio
Copy link
Contributor

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Feb 25, 2021
@jpbetz jpbetz force-pushed the apply-cluster-role-aggregator branch from c1e72d2 to 7c64054 Compare February 25, 2021 21:26
@jpbetz jpbetz changed the title WIP - Migrate cluster role aggregator to apply Migrate cluster role aggregator to apply Feb 25, 2021
@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 Feb 25, 2021
@jpbetz jpbetz force-pushed the apply-cluster-role-aggregator branch from 7c64054 to bb3737d Compare February 25, 2021 21:40
@fejta-bot
Copy link

This PR may require API review.

If so, when the changes are ready, complete the pre-review checklist and request an API review.

Status of requested reviews is tracked in the API Review project.

@jpbetz jpbetz force-pushed the apply-cluster-role-aggregator branch from bb3737d to 4d08f96 Compare February 25, 2021 22:26
Copy link
Member

@apelisse apelisse left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 5, 2021
@jpbetz jpbetz force-pushed the apply-cluster-role-aggregator branch from 10e4339 to 1e58ee3 Compare March 5, 2021 14:07
@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Mar 5, 2021

@jpbetz: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-kubernetes-e2e-aks-engine-azure 10e4339209548c9e2a9a0345c65047ec0cd14cb7 link /test pull-kubernetes-e2e-aks-engine-azure
pull-kubernetes-e2e-azure-disk-windows 10e4339209548c9e2a9a0345c65047ec0cd14cb7 link /test pull-kubernetes-e2e-azure-disk-windows

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/test-infra repository. I understand the commands that are listed here.

@jpbetz
Copy link
Contributor Author

jpbetz commented Mar 5, 2021

/test pull-kubernetes-unit

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 5, 2021
@jpbetz
Copy link
Contributor Author

jpbetz commented Mar 5, 2021

/retest

@jpbetz jpbetz force-pushed the apply-cluster-role-aggregator branch from 1e58ee3 to b361c03 Compare March 7, 2021 22:30
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Mar 7, 2021
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like a problem worth fixing.

Copy link
Contributor Author

@jpbetz jpbetz Mar 8, 2021

Choose a reason for hiding this comment

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

Yeah, this is an interesting problem I hit. I chatted with a few people out-of-band about this.

Because server-side apply is implemented in the apiserver (see fieldmanager), this looks really difficult to full address (intractable?). It is maybe slightly more tractable now that we have the SMD schemas loaded into the client, but still a large problem. I've opened an issue to track: #99953 with some notes about what we might be able to do (and what makes full support so difficult). Okay to look at this as a follow up to GA? I don't think we're going to be able to do much in the short term :(

cc @apelisse @liggitt

Copy link
Contributor

Choose a reason for hiding this comment

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

It's difficult to recommend people use a shiny new client for their controllers if they are unable to easily unit test the code that they author. If we cannot recommend that people use the new GA feature, is it truly GA? Is there a pattern they can use in the interim?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've spent some time reviewing use cases and trying to come up with a recommendation. See client-go Apply Fake Client: Review of use cases for a lot more detail. There seem to be 4 main uses cases to consider:

  • "Simulate responses to requests (via Reactors)" - works fine
  • "Validate the requests made using the client" - I think this is where we should focus short term efforts
  • "Simulate external changes to objects" - works fine
  • "Using objectTracker as a pretend apiserver" - looks like an anti-pattern, found very few tests doing this

I think we can get the "Validate the requests made using the client" fixed with a relatively small change in the near term.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd like to have the apply fake client be at least as good as the update fake client is today. It certainly needs to detect when cases aren't working right as a minimum bar.

Copy link
Contributor

Choose a reason for hiding this comment

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

I thought we were reserving at least a release in case we find a significant usability problem for which we want to break compatibility. I think it's OK if the fake client isn't feature-complete while in this state, but the comments for the generated fakes should make it clear what works and what doesn't.

@jpbetz jpbetz force-pushed the apply-cluster-role-aggregator branch from b361c03 to 0aa6c80 Compare March 8, 2021 20:06
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 8, 2021
@jpbetz jpbetz force-pushed the apply-cluster-role-aggregator branch from 0aa6c80 to 96a9f17 Compare March 9, 2021 15:09
@jpbetz jpbetz force-pushed the apply-cluster-role-aggregator branch from 96a9f17 to 24f9566 Compare March 9, 2021 15:15
@deads2k
Copy link
Contributor

deads2k commented Mar 9, 2021

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 9, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k, jpbetz

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

The pull request process is described 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 k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 9, 2021
@k8s-ci-robot k8s-ci-robot merged commit 67fbccc into kubernetes:master Mar 9, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.21 milestone Mar 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/code-generation area/dependency Issues or PRs related to dependency changes area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note-none Denotes a PR that doesn't merit a release note. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on. wg/api-expression Categorizes an issue or PR as relevant to WG API Expression.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants