Skip to content

Leader Election doesn't properly report OnError  #1593

@andradf

Description

@andradf

Describe the bug
Leader election should report any errors in trying to acquire a lock on a lease, not only when the response code is NotFound. A specific case where an error should be reported would be when the service account doesn't have permissions to create/update a lease.

Kubernetes C# SDK Client Version
15.0.1

Dotnet Runtime Version
net8

To Reproduce
Use the LeaderElector class in a pod running without permissions on coordination.k8s.io/leases.

Expected behavior
One would expect RunUntilLeadershipLostAsync to trigger an OnError invocation when the k8s api returns 403.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions