Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob Weinstock <[email protected]>
  • Loading branch information
jacobweinstock committed Jan 19, 2024
1 parent c113c8d commit 92b69db
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
5 changes: 0 additions & 5 deletions playground/Dockerfile

This file was deleted.

1 change: 1 addition & 0 deletions playground/Process.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* KinD
* clusterctl
* kubectl
* virt-install

### Hardware Dependencies

Expand Down
5 changes: 3 additions & 2 deletions playground/cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ func NewCreateCommand(rc *rootConfig) *ffcli.Command {
rc.registerRootFlags(fs)
return &ffcli.Command{
Name: "create",
ShortUsage: "create the CAPT playground [flags]",
ShortUsage: "capt-playground create [flags]",
ShortHelp: "Create the CAPT playground",
Options: []ff.Option{ff.WithEnvVarPrefix("CAPT_PLAYGROUND")},
FlagSet: fs,
Exec: func(ctx context.Context, _ []string) error {
Expand Down Expand Up @@ -120,7 +121,7 @@ func (c *Create) exec(ctx context.Context) error {
Network: "kind",
ContainerName: "virtualbmc",
LibvirtSocket: "/var/run/libvirt/libvirt-sock",
Image: "capt-playground:v2",
Image: "ghcr.io/jacobweinstock/virtualbmc",
}
log.Println("Start Virtual BMC")
vbmcIP, err := vbmc.RunVirtualBMCContainer(context.Background())
Expand Down
18 changes: 9 additions & 9 deletions playground/cmd/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,26 +57,26 @@ func (d *Delete) exec(ctx context.Context) error {
// delete all virsh nodes

log.Println("Deleting KinD cluster")
if err := deleteKindCluster(s.ClusterName); err != nil {
return err
if errC := deleteKindCluster(s.ClusterName); errC != nil {
err = fmt.Errorf("error deleting kind cluster: %w", errC)
}

log.Println("Deleting output directory")
if err := deleteOutputDir(s.OutputDir); err != nil {
return err
if errC := deleteOutputDir(s.OutputDir); errC != nil {
err = fmt.Errorf("error deleting output directory: %w", errC)
}

log.Println("Deleting virtualbmc docker container")
if err := deleteDockerContainer("virtualbmc"); err != nil {
return err
if errC := deleteDockerContainer("virtualbmc"); errC != nil {
err = fmt.Errorf("error deleting virtualbmc docker container: %w", errC)
}

log.Println("Deleting virsh nodes")
if err := deleteVirshNodes(s.TotalHardware); err != nil {
return err
if errC := deleteVirshNodes(s.TotalHardware); errC != nil {
err = fmt.Errorf("error deleting virsh nodes: %w", errC)
}

return nil
return err
}

func deleteKindCluster(name string) error {
Expand Down
3 changes: 3 additions & 0 deletions playground/internal/docker/vbmc.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ func (v VirtualBMC) RunVirtualBMCContainer(ctx context.Context) (netip.Addr, err
}

func (v VirtualBMC) RegisterVirtualBMC(ctx context.Context) error {
/*
docker exec virtualbmc vbmc add --username admin --password password --port 623 node1
*/
for _, bmc := range v.BMCInfo {
args := Args{
Cmd: "exec",
Expand Down

0 comments on commit 92b69db

Please sign in to comment.