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

Start waiting for certs to be ready before sending data to the channel #2209

Merged

Conversation

tenzen-y
Copy link
Member

@tenzen-y tenzen-y commented Aug 15, 2023

What this PR does / why we need it:
Currently, the controller checks if the cert-generator is enabled before starting setupControllers.

ctx := signals.SetupSignalHandler()
certsReady := make(chan struct{})
defer close(certsReady)
if initConfig.CertGeneratorConfig.Enable {
if err = cert.AddToManager(mgr, initConfig.CertGeneratorConfig, certsReady); err != nil {
log.Error(err, "Failed to set up cert-generator")
}
} else {
certsReady <- struct{}{}
}
// The setupControllers will register controllers to the manager
// after generated certs for the admission webhooks.
go setupControllers(mgr, certsReady, hookServer)

So, if the cert-generator is disabled, the controller sends data to certsReady channel before the controller starts waiting for certs to get ready. By this behavior, in the katib-with-kubeflow, the controller eternally keeps waiting for the certs to get ready.

// The certsReady blocks to register controllers until generated certs.
<-certsReady

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Checklist:

  • Docs included if any changes are user facing

@tenzen-y tenzen-y changed the title Start waiting for certs to be ready before starting cert-generator Start waiting for certs to be ready before sending data to the channel Aug 15, 2023
@tenzen-y tenzen-y force-pushed the move-starting-register-controller branch from 185a325 to 2d03bc4 Compare August 15, 2023 17:08
@tenzen-y tenzen-y marked this pull request as ready for review August 15, 2023 17:49
Start waiting for certs to be ready before sending data to the channel

Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
Copy link
Member

@andreyvelich andreyvelich left a comment

Choose a reason for hiding this comment

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

/lgtm

@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andreyvelich, tenzen-y

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:
  • OWNERS [andreyvelich,tenzen-y]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow google-oss-prow bot merged commit c33494b into kubeflow:master Aug 15, 2023
58 checks passed
tenzen-y added a commit to tenzen-y/katib that referenced this pull request Aug 16, 2023
kubeflow#2209)

Start waiting for certs to be ready before sending data to the channel

Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
@tenzen-y tenzen-y deleted the move-starting-register-controller branch August 16, 2023 08:15
google-oss-prow bot pushed a commit that referenced this pull request Aug 16, 2023
…efore sending data to the channel (#2215)

Start waiting for certs to be ready before sending data to the channel

Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants