Skip to content

cancel function could be nil in CLE leader election path #127665

Closed
@Jefftree

Description

#124012 (comment)

Per https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/client-go/tools/leaderelection/leaderelection.go#L210, we could call OnStoppedLeading before OnStartedLeading gets called leading to a nil cancel function. We should check the function before calling it.

/sig api-machinery
/triage accepted

Metadata

Assignees

No one assigned

    Labels

    sig/api-machineryCategorizes an issue or PR as relevant to SIG API Machinery.triage/acceptedIndicates an issue or PR is ready to be actively worked on.

    Type

    No type

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions