cli: use apply command to start mini cluster (#2551)

Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
Daniel Weiße 2023-11-20 12:10:16 +01:00 committed by GitHub
parent 4c8ce55e5a
commit 35abc3c354
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 92 deletions

View file

@ -16,7 +16,6 @@ import (
"errors"
"fmt"
"io"
"strings"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
@ -76,9 +75,8 @@ func (r *Runner) Start(ctx context.Context, name, imageName string) error {
// check if it is using the correct image and if it is running
if len(containers) == 1 {
// make sure the container we listed is using the correct image
imageBase := strings.Split(imageName, ":")[0]
if containers[0].Image != imageBase {
return fmt.Errorf("existing libvirt container %q is using a different image: expected %q, got %q", containerName, imageBase, containers[0].Image)
if containers[0].Image != imageName {
return fmt.Errorf("existing libvirt container %q is using a different image: expected %q, got %q", containerName, imageName, containers[0].Image)
}
// container already exists, check if its running