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

Add option for custom status readers #383

Merged
merged 2 commits into from
Jul 12, 2021

Conversation

makkes
Copy link
Member

@makkes makkes commented Jul 5, 2021

This commit adds the CustomStatusReadersFactoryFunc option to the
StatusPoller's Poll method options so that consumers can provide
custom status readers for certain GroupKinds (esp. CRDs).

It also changes the NewGenericStatusReader func so that it accepts a
statusFunc parameter so that consumers only have to implement that
single func and use the genericStatusReader for all the boilerplate
stuff (like fetching an object from the API).

refs #382

@k8s-ci-robot k8s-ci-robot added do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jul 5, 2021
@k8s-ci-robot k8s-ci-robot requested review from barney-s and soltysh July 5, 2021 20:43
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 5, 2021
This commit adds the `CustomStatusReadersFactoryFunc` option to the
StatusPoller's `Poll` method options so that consumers can provide
custom status readers for certain GroupKinds (esp. CRDs).

It also changes the `NewGenericStatusReader` func so that it accepts a
statusFunc parameter so that consumers only have to implement that
single func and use the genericStatusReader for all the boilerplate
stuff (like fetching an object from the API).

refs kubernetes-sigs#382
@makkes makkes force-pushed the custom-reader-status branch from 1b9ed40 to 5b7b824 Compare July 5, 2021 20:44
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Jul 5, 2021
Copy link
Member

@mortent mortent left a comment

Choose a reason for hiding this comment

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

Supporting custom status readers has been the plan since the beginning, we just haven't had time to do it. This is a good change. I just have a few small comments.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 9, 2021
Copy link
Member

@mortent mortent left a comment

Choose a reason for hiding this comment

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

/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 Jul 12, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: makkes, mortent

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 Jul 12, 2021
@k8s-ci-robot k8s-ci-robot merged commit ea43c0a into kubernetes-sigs:master Jul 12, 2021
@makkes makkes deleted the custom-reader-status branch July 13, 2021 07:33
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants