Table of Contents

Class ImageUpdateService

Namespace
Bielu.Microservices.Orchestrator.Storage
Assembly
Bielu.Microservices.Orchestrator.dll

Default IImageUpdateService implementation.

Strategy: each managed instance persists its OriginalRequest in IInstanceStore. The container is stamped at creation time with the image digest it was created from (label ImageDigest). We compare that recorded digest with the digest of the image currently available locally (optionally after pulling) and recreate the containers when they differ.

public class ImageUpdateService : IImageUpdateService
Inheritance
ImageUpdateService
Implements
Inherited Members

Constructors

ImageUpdateService(IContainerOrchestrator, IInstanceStore, ILogger<ImageUpdateService>)

Default IImageUpdateService implementation.

Strategy: each managed instance persists its OriginalRequest in IInstanceStore. The container is stamped at creation time with the image digest it was created from (label ImageDigest). We compare that recorded digest with the digest of the image currently available locally (optionally after pulling) and recreate the containers when they differ.

public ImageUpdateService(IContainerOrchestrator orchestrator, IInstanceStore instanceStore, ILogger<ImageUpdateService> logger)

Parameters

orchestrator IContainerOrchestrator
instanceStore IInstanceStore
logger ILogger<ImageUpdateService>

Methods

CheckAllAsync(ImageUpdateOptions?, CancellationToken)

Checks every managed instance and returns the per-instance status.

public Task<IReadOnlyList<ImageUpdateStatus>> CheckAllAsync(ImageUpdateOptions? options = null, CancellationToken cancellationToken = default)

Parameters

options ImageUpdateOptions
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<ImageUpdateStatus>>

CheckAsync(string, ImageUpdateOptions?, CancellationToken)

Checks whether an image update is available for the given managed instance.

public Task<ImageUpdateStatus> CheckAsync(string instanceId, ImageUpdateOptions? options = null, CancellationToken cancellationToken = default)

Parameters

instanceId string

The managed instance identifier.

options ImageUpdateOptions

Check options (e.g. whether to pull first).

cancellationToken CancellationToken

Cancellation token.

Returns

Task<ImageUpdateStatus>

UpdateAsync(string, ImageUpdateOptions?, CancellationToken)

Pulls the latest image and, if the digest changed (or Force is set), removes the existing containers of the instance and recreates them from the persisted OriginalRequest.

public Task<ImageUpdateResult> UpdateAsync(string instanceId, ImageUpdateOptions? options = null, CancellationToken cancellationToken = default)

Parameters

instanceId string
options ImageUpdateOptions
cancellationToken CancellationToken

Returns

Task<ImageUpdateResult>