fix(core): update
This commit is contained in:
parent
2fb628213d
commit
72c74e44b5
@ -13,6 +13,13 @@ export class DockerImage {
|
||||
return images;
|
||||
}
|
||||
|
||||
public static async findImageByName (dockerHost: DockerHost, imageNameArg: string) {
|
||||
const images = await this.getImages(dockerHost);
|
||||
return images.find(image => {
|
||||
return image.RepoTags.includes(imageNameArg);
|
||||
});
|
||||
}
|
||||
|
||||
public static async createFromRegistry(
|
||||
dockerHostArg: DockerHost,
|
||||
creationObject: interfaces.IImageCreationDescriptor
|
||||
@ -28,7 +35,10 @@ export class DockerImage {
|
||||
'info',
|
||||
`Successfully pulled image ${creationObject.imageUrl} from the registry`
|
||||
);
|
||||
const image = (await DockerImage.getImages(dockerHostArg)).find(image => true);
|
||||
const originTag = `${creationObject.imageUrl}:${creationObject.tag}`;
|
||||
console.log(originTag)
|
||||
const image = await DockerImage.findImageByName(dockerHostArg, originTag);
|
||||
image.tagImage(originTag);
|
||||
return image;
|
||||
} else {
|
||||
plugins.smartlog.defaultLogger.log('error', `Failed at the attempt of creating a new image`);
|
||||
@ -85,6 +95,10 @@ export class DockerImage {
|
||||
return this.RepoTags.length > 0;
|
||||
}
|
||||
|
||||
public tagImage(newTag) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* pulls the latest version from the registry
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user