Add first version of the windows ASG provider

This commit is contained in:
Marcos Lilljedahl
2017-08-04 21:54:03 -03:00
parent f810c0c92f
commit ed7cefcf9c
10 changed files with 388 additions and 29 deletions

View File

@@ -103,7 +103,7 @@ type PWDApi interface {
}
func NewPWD(f docker.FactoryApi, e event.EventApi, s storage.StorageApi) *pwd {
return &pwd{dockerFactory: f, event: e, storage: s, generator: xidGenerator{}, windowsProvisioner: provisioner.NewWindows(f), dindProvisioner: provisioner.NewDinD(f)}
return &pwd{dockerFactory: f, event: e, storage: s, generator: xidGenerator{}, windowsProvisioner: provisioner.NewWindowsASG(f, s), dindProvisioner: provisioner.NewDinD(f)}
}
func (p *pwd) getProvisioner(t string) (provisioner.ProvisionerApi, error) {

View File

@@ -19,6 +19,12 @@ type Instance struct {
Type string `json:"type" bson:"type"`
Session *Session `json:"-" bson:"-"`
ctx context.Context `json:"-" bson:"-"`
WindowsId string `json:"-" bson:"windows_id"`
}
type WindowsInstance struct {
ID string `bson:"id"`
SessionId string `bson:"session_id"`
}
type InstanceConfig struct {

View File

@@ -6,18 +6,19 @@ import (
)
type Session struct {
Id string `json:"id"`
Instances map[string]*Instance `json:"instances" bson:"-"`
CreatedAt time.Time `json:"created_at"`
ExpiresAt time.Time `json:"expires_at"`
PwdIpAddress string `json:"pwd_ip_address"`
Ready bool `json:"ready"`
Stack string `json:"stack"`
StackName string `json:"stack_name"`
ImageName string `json:"image_name"`
Host string `json:"host"`
Clients []*Client `json:"-" bson:"-"`
rw sync.Mutex `json:"-"`
Id string `json:"id"`
Instances map[string]*Instance `json:"instances" bson:"-"`
CreatedAt time.Time `json:"created_at"`
ExpiresAt time.Time `json:"expires_at"`
PwdIpAddress string `json:"pwd_ip_address"`
Ready bool `json:"ready"`
Stack string `json:"stack"`
StackName string `json:"stack_name"`
ImageName string `json:"image_name"`
Host string `json:"host"`
Clients []*Client `json:"-" bson:"-"`
WindowsAssigned []*WindowsInstance `json:"-" bson:"-"`
rw sync.Mutex `json:"-"`
}
func (s *Session) Lock() {