|
|
@@ -152,7 +152,7 @@ func StartContainer(containerName string, containerType string) error {
|
|
|
imageExistsLocally := false
|
|
|
for _, img := range images {
|
|
|
for _, tag := range img.RepoTags {
|
|
|
- if tag == desiredRepo+":"+desiredTag && img.ID == desiredHash {
|
|
|
+ if tag == containerType+":"+desiredTag && img.ID == desiredHash {
|
|
|
imageExistsLocally = true
|
|
|
break
|
|
|
}
|
|
|
@@ -172,7 +172,7 @@ func StartContainer(containerName string, containerType string) error {
|
|
|
case existingContainer == nil:
|
|
|
// if the container does not exist, create and start it
|
|
|
_, err := cli.ContainerCreate(ctx, &container.Config{
|
|
|
- Image: desiredRepo + ":" + desiredTag,
|
|
|
+ Image: containerType + ":" + desiredTag,
|
|
|
}, nil, nil, nil, containerName)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
@@ -181,7 +181,7 @@ func StartContainer(containerName string, containerType string) error {
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
- msg := fmt.Sprintf("%s started with image %s:%s", containerName, desiredRepo, desiredTag)
|
|
|
+ msg := fmt.Sprintf("%s started with image %s:%s", containerName, containerType, desiredTag)
|
|
|
logger.Info(msg)
|
|
|
case existingContainer.State == "exited":
|
|
|
// if the container exists but is stopped, start it
|
|
|
@@ -202,7 +202,7 @@ func StartContainer(containerName string, containerType string) error {
|
|
|
return err
|
|
|
}
|
|
|
_, err = cli.ContainerCreate(ctx, &container.Config{
|
|
|
- Image: desiredRepo + ":" + desiredTag,
|
|
|
+ Image: containerType + ":" + desiredTag,
|
|
|
}, nil, nil, nil, containerName)
|
|
|
if err != nil {
|
|
|
return err
|