-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Richard Case <[email protected]>
- Loading branch information
1 parent
a1aff98
commit 0792598
Showing
4 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package plans | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/weaveworks/reignite/core/models" | ||
"github.com/weaveworks/reignite/core/ports" | ||
"github.com/weaveworks/reignite/pkg/log" | ||
"github.com/weaveworks/reignite/pkg/planner" | ||
) | ||
|
||
type MicroVMCreatePlanInput struct { | ||
ID *models.VMID | ||
} | ||
|
||
func MicroVMCreatePlan(input *MicroVMCreatePlanInput, providers *ProvidersInput) planner.Plan { | ||
return µvmCreatePlan{ | ||
vmid: input.ID, | ||
vmProvider: providers.MicroVMProvider, | ||
vmRepo: providers.MicroVMRepo, | ||
eventSvc: providers.EventService, | ||
imageSvc: providers.ImageService, | ||
} | ||
} | ||
|
||
type microvmCreatePlan struct { | ||
vmid *models.VMID | ||
|
||
vmProvider ports.MicroVMProvider | ||
vmRepo ports.MicroVMRepository | ||
eventSvc ports.EventService | ||
imageSvc ports.ImageService | ||
} | ||
|
||
func (p *microvmCreatePlan) Name() string { | ||
return "microvm_reconcile" | ||
} | ||
|
||
// Create will create the plan to reconcile a microvm. | ||
func (p *microvmCreatePlan) Create(ctx context.Context) ([]planner.Procedure, error) { | ||
logger := log.GetLogger(ctx) | ||
logger.Debugf("creating plan for microvm %s", p.vmid.String()) | ||
|
||
procs := []planner.Procedure{} | ||
|
||
return procs, nil | ||
} | ||
|
||
// Result is the result of the plan | ||
func (p *microvmCreatePlan) Result() interface{} { | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package plans | ||
|
||
import "github.com/weaveworks/reignite/core/ports" | ||
|
||
// Providers input is a type to be used as input to plans. | ||
type ProvidersInput struct { | ||
MicroVMProvider ports.MicroVMProvider | ||
MicroVMRepo ports.MicroVMRepository | ||
EventService ports.EventService | ||
ImageService ports.ImageService | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters