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

apiextensions: wait for complete discovery endpoint #89145

Merged

Conversation

sttts
Copy link
Contributor

@sttts sttts commented Mar 16, 2020

/kind bug

The discovery endpoint is driven by an informer. During startup it adds CRDs asynchronously (in contrast to the main handler endpoint which is complete as soon as the lister has synched). As a consequence the discovery endpoint might be incomplete for a short period of time when the server starts up. This PR adds an explicit wait until all CRD version have been added to discovery.

Wait for all CRDs to show up in discovery endpoint before reporting readiness.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 16, 2020
@sttts sttts added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 16, 2020
@k8s-ci-robot k8s-ci-robot removed the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label Mar 16, 2020
@sttts sttts added the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Mar 16, 2020
@k8s-ci-robot k8s-ci-robot removed the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Mar 16, 2020
@sttts
Copy link
Contributor Author

sttts commented Mar 16, 2020

/assign @deads2k @liggitt

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sttts

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 16, 2020
@sttts sttts force-pushed the sttts-apiextensions-discovery-sync branch from d149a43 to c76ded2 Compare March 16, 2020 10:53
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 16, 2020
@sttts sttts force-pushed the sttts-apiextensions-discovery-sync branch from c76ded2 to 99add1a Compare March 16, 2020 11:27
}
return true, nil
}, stopCh); err != nil {
utilruntime.HandleError(fmt.Errorf("timed out waiting for discovery endpoint to initialize"))
Copy link
Contributor

Choose a reason for hiding this comment

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

panic on these please. Based on the code it should never happen, but I don't want to ever silently not run this.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok, timeout happens only when stopCh closed, so we can simply error

@sttts sttts force-pushed the sttts-apiextensions-discovery-sync branch from 99add1a to 34f5737 Compare March 17, 2020 13:05
@deads2k
Copy link
Contributor

deads2k commented Mar 17, 2020

/lgtm

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

/assign @jpbetz @apelisse

@k8s-ci-robot k8s-ci-robot merged commit c1a66a4 into kubernetes:master Mar 19, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.19 milestone Mar 19, 2020
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. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. 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.

None yet

7 participants