Currently container instances are hard-coded to join a single network, the network associated with the session. This change allows the caller of CreateInstance to specify which additional networks should be joined. This is useful, for example, when a container instance requires access to additional "backend" services that may be running. There are security implications associated with this change, hence the additional networks are only joined when a new -unsafe flag is specified. It is hoped the name is a sufficient indicator that thought needs to go into using it.
45 lines
1.5 KiB
Go
45 lines
1.5 KiB
Go
package types
|
|
|
|
import "context"
|
|
|
|
type Instance struct {
|
|
Name string `json:"name" bson:"name"`
|
|
Image string `json:"image" bson:"image"`
|
|
Hostname string `json:"hostname" bson:"hostname"`
|
|
IP string `json:"ip" bson:"ip"`
|
|
RoutableIP string `json:"routable_ip" bson:"routable_id"`
|
|
ServerCert []byte `json:"server_cert" bson:"server_cert"`
|
|
ServerKey []byte `json:"server_key" bson:"server_key"`
|
|
CACert []byte `json:"ca_cert" bson:"ca_cert"`
|
|
Cert []byte `json:"cert" bson:"cert"`
|
|
Key []byte `json:"key" bson:"key"`
|
|
Tls bool `json:"tls" bson:"tls"`
|
|
SessionId string `json:"session_id" bson:"session_id"`
|
|
ProxyHost string `json:"proxy_host" bson:"proxy_host"`
|
|
SessionHost string `json:"session_host" bson:"session_host"`
|
|
Type string `json:"type" bson:"type"`
|
|
WindowsId string `json:"-" bson:"windows_id"`
|
|
ctx context.Context `json:"-" bson:"-"`
|
|
}
|
|
|
|
type WindowsInstance struct {
|
|
Id string `bson:"id"`
|
|
SessionId string `bson:"session_id"`
|
|
}
|
|
|
|
type InstanceConfig struct {
|
|
ImageName string
|
|
Hostname string
|
|
ServerCert []byte
|
|
ServerKey []byte
|
|
CACert []byte
|
|
Cert []byte
|
|
Key []byte
|
|
Tls bool
|
|
PlaygroundFQDN string
|
|
Type string
|
|
DindVolumeSize string
|
|
Envs []string
|
|
Networks []string
|
|
}
|