fix(core): update
This commit is contained in:
parent
87ff0f01bb
commit
55f45b1c3a
@ -1,6 +1,5 @@
|
||||
import { expect, tap } from '@pushrocks/tapbundle';
|
||||
import * as docker from '../ts/index';
|
||||
import { DockerService } from '../ts/index';
|
||||
|
||||
let testDockerHost: docker.DockerHost;
|
||||
|
||||
@ -94,8 +93,11 @@ tap.test('should create a service', async () => {
|
||||
labels: {},
|
||||
contentArg: '{"hi": "wow"}'
|
||||
});
|
||||
const testService = await DockerService.createService(testDockerHost, {
|
||||
image: 'nginx:latest',
|
||||
const testImage = await docker.DockerImage.createFromRegistry(testDockerHost, {
|
||||
imageUrl: 'nginx:latest'
|
||||
});
|
||||
const testService = await docker.DockerService.createService(testDockerHost, {
|
||||
image: testImage,
|
||||
labels: {
|
||||
'testlabel': 'hi'
|
||||
},
|
||||
|
@ -119,7 +119,13 @@ export class DockerImage {
|
||||
});
|
||||
}
|
||||
|
||||
public tagImage(newTag) {}
|
||||
/**
|
||||
* tag an image
|
||||
* @param newTag
|
||||
*/
|
||||
public async tagImage(newTag) {
|
||||
throw new Error('.tagImage is not yet implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* pulls the latest version from the registry
|
||||
|
@ -39,13 +39,11 @@ export class DockerService {
|
||||
// lets get the image
|
||||
plugins.smartlog.defaultLogger.log(
|
||||
'info',
|
||||
`downloading image for service ${serviceCreationDescriptor.name}`
|
||||
`now creating service ${serviceCreationDescriptor.name}`
|
||||
);
|
||||
const serviceImage = await DockerImage.createFromRegistry(dockerHost, {
|
||||
imageUrl: serviceCreationDescriptor.image
|
||||
});
|
||||
|
||||
const serviceVersion = serviceImage.Labels.version;
|
||||
|
||||
// await serviceCreationDescriptor.image.pullLatestImageFromRegistry();
|
||||
const serviceVersion = await serviceCreationDescriptor.image.getVersion();
|
||||
|
||||
const labels: interfaces.TLabels = {
|
||||
...serviceCreationDescriptor.labels,
|
||||
@ -78,7 +76,7 @@ export class DockerService {
|
||||
Name: serviceCreationDescriptor.name,
|
||||
TaskTemplate: {
|
||||
ContainerSpec: {
|
||||
Image: serviceCreationDescriptor.image,
|
||||
Image: serviceCreationDescriptor.image.RepoTags[0],
|
||||
Labels: labels,
|
||||
Secrets: secretArray
|
||||
},
|
||||
|
@ -1,10 +1,11 @@
|
||||
import * as interfaces from './';
|
||||
import { DockerNetwork } from '../docker.classes.network';
|
||||
import { DockerSecret } from '../docker.classes.secret';
|
||||
import { DockerImage } from '../docker.classes.image';
|
||||
|
||||
export interface IServiceCreationDescriptor {
|
||||
name: string;
|
||||
image: string;
|
||||
image: DockerImage;
|
||||
labels: interfaces.TLabels;
|
||||
networks: DockerNetwork[];
|
||||
networkAlias: string;
|
||||
|
Loading…
Reference in New Issue
Block a user