File tree Expand file tree Collapse file tree 3 files changed +12
-5
lines changed
Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " lup-docker" ,
3- "version" : " 1.1.3 " ,
3+ "version" : " 1.1.4 " ,
44 "description" : " NodeJS library to interact with the Docker engine." ,
55 "main" : " ./lib/index" ,
66 "types" : " ./lib/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -375,12 +375,15 @@ export function decodeDockerContainer(json: any | undefined): DockerContainer |
375375 if ( ! json ) return undefined ;
376376
377377 let healthState : DockerContainerHealthState | undefined = undefined ;
378- if ( json . Status . includes ( 'healthy' ) ) {
378+ const statusStr = ( json . Status || '' ) . toLowerCase ( ) ;
379+ if ( statusStr . includes ( 'healthy' ) ) {
379380 healthState = 'healthy' ;
380- } else if ( json . Status . includes ( 'unhealthy' ) ) {
381+ } else if ( statusStr . includes ( 'unhealthy' ) ) {
381382 healthState = 'unhealthy' ;
382- } else if ( json . Status . includes ( 'starting' ) ) {
383+ } else if ( statusStr . includes ( 'starting' ) ) {
383384 healthState = 'starting' ;
385+ } else if ( statusStr . includes ( 'paused' ) ) {
386+ healthState = 'paused' ;
384387 }
385388
386389 return {
@@ -396,6 +399,7 @@ export function decodeDockerContainer(json: any | undefined): DockerContainer |
396399 imageName : json . Image ,
397400 imageMetadata : decodeDockerOCIDescriptor ( json . ImageManifestDescriptor ) ! ,
398401 isHealthy : json . State === 'running' && healthState !== 'unhealthy' ,
402+ isPaused : healthState === 'paused' ,
399403 isRunning : json . State === 'running' ,
400404 labels : json . Labels || { } ,
401405 mounts : ( ( json . Mounts as any [ ] ) || [ ] ) . map < DockerContainerMountInfo > (
Original file line number Diff line number Diff line change @@ -171,6 +171,9 @@ export type DockerContainer = {
171171 /** Whether the container is healthy or not (false if container is running and explicitly unhealthy). */
172172 isHealthy : boolean ;
173173
174+ /** Whether the container is paused. */
175+ isPaused : boolean ;
176+
174177 /** Whether the container is currently running. */
175178 isRunning : boolean ;
176179} ;
@@ -228,7 +231,7 @@ export type DockerContainerCpuStats = {
228231 } ;
229232} ;
230233
231- export type DockerContainerHealthState = 'starting' | 'healthy' | 'unhealthy' ;
234+ export type DockerContainerHealthState = 'starting' | 'healthy' | 'paused' | ' unhealthy';
232235
233236export type DockerContainerInheritedVolume = {
234237 /** Name of the container the volumes are inherited from. */
You can’t perform that action at this time.
0 commit comments