Class MetaObjectLock<T>
Inheritance
MetaObjectLock<T>
Assembly: KubernetesClient.dll
public abstract class MetaObjectLock<T> : ILock where T : class, IMetadata<V1ObjectMeta>, new()
Type Parameters
Constructors
View Source
Declaration
protected MetaObjectLock(IKubernetes client, string @namespace, string name, string identity)
Parameters
Properties
View Source
Declaration
public string Identity { get; }
Property Value
Methods
View Source
Create attempts to create a LeaderElectionRecord
Declaration
public Task<bool> CreateAsync(LeaderElectionRecord record, CancellationToken cancellationToken = default)
Parameters
Returns
| Type |
Description |
| Task<bool> |
true if created
|
View Source
Declaration
protected abstract Task<T> CreateMetaObjectAsync(IKubernetes client, T obj, string namespaceParameter, CancellationToken cancellationToken)
Parameters
Returns
View Source
Describe is used to convert details on current resource lock into a string
Declaration
Returns
| Type |
Description |
| string |
resource lock description
|
View Source
Get returns the LeaderElectionRecord
Declaration
public Task<LeaderElectionRecord> GetAsync(CancellationToken cancellationToken = default)
Parameters
Returns
View Source
Declaration
protected abstract LeaderElectionRecord GetLeaderElectionRecord(T obj)
Parameters
| Type |
Name |
Description |
| T |
obj |
|
Returns
View Source
Declaration
protected abstract Task<T> ReadMetaObjectAsync(IKubernetes client, string name, string namespaceParameter, CancellationToken cancellationToken)
Parameters
Returns
View Source
Declaration
protected abstract Task<T> ReplaceMetaObjectAsync(IKubernetes client, T obj, string name, string namespaceParameter, CancellationToken cancellationToken)
Parameters
Returns
View Source
Declaration
protected abstract T SetLeaderElectionRecord(LeaderElectionRecord record, T metaObj)
Parameters
Returns
View Source
Update will update and existing LeaderElectionRecord
Declaration
public Task<bool> UpdateAsync(LeaderElectionRecord record, CancellationToken cancellationToken = default)
Parameters
Returns
| Type |
Description |
| Task<bool> |
true if updated
|
Events
View Source
OnHttpError is called when there is a http operation error.
Declaration
public event Action<HttpOperationException> OnHttpError
Event Type
Implements