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

minor adjustments in the sample apiserver around resource creation. #48711

Conversation

p0lyn0mial
Copy link
Contributor

What this PR does / why we need it: This PR improves NewREST method to support an error and nor-error path. The method is then wrapped in a convenient function which panics on error.

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 10, 2017
@k8s-ci-robot
Copy link
Contributor

Hi @p0lyn0mial. Thanks for your PR.

I'm waiting for a kubernetes 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.

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

@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 Jul 10, 2017
@k8s-github-robot k8s-github-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. release-note-none Denotes a PR that doesn't merit a release note. labels Jul 10, 2017
@p0lyn0mial
Copy link
Contributor Author

@deads2k hopefully the changes will make you happy :)

@liggitt liggitt assigned deads2k and unassigned liggitt and smarterclayton Jul 10, 2017
v1alpha1storage["flunders"] = flunderstorage.RESTInPeace(Scheme, c.GenericConfig.RESTOptionsGetter)
v1alpha1storage["fischers"] = fischerstorage.RESTInPeace(Scheme, c.GenericConfig.RESTOptionsGetter)
v1alpha1storage["flunders"] = wardleregistry.RESTInPeace(flunderstorage.NewREST(Scheme, c.GenericConfig.RESTOptionsGetter))
v1alpha1storage["fischers"] = wardleregistry.RESTInPeace(fischerstorage.NewREST(Scheme, c.GenericConfig.RESTOptionsGetter))
Copy link
Member

Choose a reason for hiding this comment

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

at first glace, this is moving the constructor to a package I didn't expect

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if it helps we could change the pkg name to wardlestorage. Notice that RESTInPeace is just a wrapper. To give you more context #48444 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

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

at first glace, this is moving the constructor to a package I didn't expect

It's a wrapper we're trying out here to allow errors from REST construction without panics. We did a similar thing at a lower level in openshift and I wasn't a huge fan of where we put it.

@deads2k
Copy link
Contributor

deads2k commented Jul 17, 2017

/lgtm
/approve no-issue

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 17, 2017
@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 17, 2017
@p0lyn0mial
Copy link
Contributor Author

I think that the tests were very unstable at that time. I will rebase against the master.

@p0lyn0mial p0lyn0mial force-pushed the sample_apiserver_small_improvements branch from 62322f0 to 6a3191a Compare July 17, 2017 16:20
@k8s-github-robot k8s-github-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 17, 2017
@p0lyn0mial
Copy link
Contributor Author

/retest

@k8s-ci-robot
Copy link
Contributor

@p0lyn0mial: you can't request testing unless you are a kubernetes member.

In response to this:

/retest

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.

@p0lyn0mial
Copy link
Contributor Author

@deads2k the bot is not obedient :( please, retest and retag.

@deads2k
Copy link
Contributor

deads2k commented Jul 17, 2017

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 17, 2017
@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

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

Associated issue requirement bypassed by: deads2k

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

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@deads2k
Copy link
Contributor

deads2k commented Jul 17, 2017

@eparis how do we get @p0lyn0mial added to the whitelist to be tested?

@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 48997, 48595, 48898, 48711, 48972)

@k8s-github-robot k8s-github-robot merged commit 219dd9a into kubernetes:master Jul 17, 2017
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. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. release-note-none Denotes a PR that doesn't merit a release note. 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.

6 participants