Skip to content

Commit

Permalink
use state-file in miniconstellation
Browse files Browse the repository at this point in the history
Signed-off-by: Moritz Sanft <[email protected]>
  • Loading branch information
msanft committed Oct 5, 2023
1 parent b48fcbf commit 921813e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions cli/internal/cmd/miniup.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"github.com/edgelesssys/constellation/v2/cli/internal/helm"
"github.com/edgelesssys/constellation/v2/cli/internal/kubecmd"
"github.com/edgelesssys/constellation/v2/cli/internal/libvirt"
"github.com/edgelesssys/constellation/v2/cli/internal/state"
"github.com/edgelesssys/constellation/v2/cli/internal/terraform"
"github.com/edgelesssys/constellation/v2/internal/api/attestationconfigapi"
"github.com/edgelesssys/constellation/v2/internal/atls"
Expand Down Expand Up @@ -172,14 +173,18 @@ func (m *miniUpCmd) createMiniCluster(ctx context.Context, fileHandler file.Hand
TFWorkspace: constants.TerraformWorkingDir,
TFLogLevel: flags.tfLogLevel,
}
idFile, err := creator.Create(ctx, opts)
infraState, err := creator.Create(ctx, opts)
if err != nil {
return err
}

idFile.UID = constants.MiniConstellationUID // use UID "mini" to identify MiniConstellation clusters.
m.log.Debugf("Cluster id file contains %v", idFile)
return fileHandler.WriteJSON(constants.ClusterIDsFilename, idFile, file.OptNone)
infraState.UID = constants.MiniConstellationUID // use UID "mini" to identify MiniConstellation clusters.

stateFile := state.New().
SetInfrastructure(infraState)

m.log.Debugf("Cluster state file contains %v", stateFile)
return stateFile.WriteToFile(fileHandler, constants.StateFilename)
}

// initializeMiniCluster initializes a QEMU cluster.
Expand Down

0 comments on commit 921813e

Please sign in to comment.