fix(deps): upgrade core tooling dependencies and adapt Docker client internals for compatibility
This commit is contained in:
@@ -59,8 +59,8 @@ export class DockerImage extends DockerResource {
|
||||
imageOriginTag: string;
|
||||
} = {
|
||||
imageUrl: optionsArg.creationObject.imageUrl,
|
||||
imageTag: optionsArg.creationObject.imageTag,
|
||||
imageOriginTag: null,
|
||||
imageTag: optionsArg.creationObject.imageTag ?? '',
|
||||
imageOriginTag: '',
|
||||
};
|
||||
if (imageUrlObject.imageUrl.includes(':')) {
|
||||
const imageUrl = imageUrlObject.imageUrl.split(':')[0];
|
||||
@@ -94,9 +94,24 @@ export class DockerImage extends DockerResource {
|
||||
dockerHostArg,
|
||||
imageUrlObject.imageOriginTag,
|
||||
);
|
||||
if (!image) {
|
||||
throw new Error(`Image ${imageUrlObject.imageOriginTag} not found after pull`);
|
||||
}
|
||||
return image;
|
||||
} else {
|
||||
logger.log('error', `Failed at the attempt of creating a new image`);
|
||||
// Pull failed — check if the image already exists locally
|
||||
const existingImage = await DockerImage._fromName(
|
||||
dockerHostArg,
|
||||
imageUrlObject.imageOriginTag,
|
||||
);
|
||||
if (existingImage) {
|
||||
logger.log(
|
||||
'warn',
|
||||
`Pull failed for ${imageUrlObject.imageUrl}, using locally cached image`,
|
||||
);
|
||||
return existingImage;
|
||||
}
|
||||
throw new Error(`Failed to pull image ${imageUrlObject.imageOriginTag} and no local copy exists`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -217,16 +232,16 @@ export class DockerImage extends DockerResource {
|
||||
/**
|
||||
* the tags for an image
|
||||
*/
|
||||
public Containers: number;
|
||||
public Created: number;
|
||||
public Id: string;
|
||||
public Labels: interfaces.TLabels;
|
||||
public ParentId: string;
|
||||
public RepoDigests: string[];
|
||||
public RepoTags: string[];
|
||||
public SharedSize: number;
|
||||
public Size: number;
|
||||
public VirtualSize: number;
|
||||
public Containers!: number;
|
||||
public Created!: number;
|
||||
public Id!: string;
|
||||
public Labels!: interfaces.TLabels;
|
||||
public ParentId!: string;
|
||||
public RepoDigests!: string[];
|
||||
public RepoTags!: string[];
|
||||
public SharedSize!: number;
|
||||
public Size!: number;
|
||||
public VirtualSize!: number;
|
||||
|
||||
constructor(dockerHostArg: DockerHost, dockerImageObjectArg: any) {
|
||||
super(dockerHostArg);
|
||||
|
||||
Reference in New Issue
Block a user