2016-03-18 14:53:27 -04:00
|
|
|
package libcontainerd
|
|
|
|
|
2016-09-16 13:04:53 -04:00
|
|
|
import "strings"
|
2016-03-18 14:53:27 -04:00
|
|
|
|
2016-08-29 06:37:14 -04:00
|
|
|
// setupEnvironmentVariables converts a string array of environment variables
|
2016-03-18 14:53:27 -04:00
|
|
|
// into a map as required by the HCS. Source array is in format [v1=k1] [v2=k2] etc.
|
|
|
|
func setupEnvironmentVariables(a []string) map[string]string {
|
|
|
|
r := make(map[string]string)
|
|
|
|
for _, s := range a {
|
2016-09-04 18:44:13 -04:00
|
|
|
arr := strings.SplitN(s, "=", 2)
|
2016-03-18 14:53:27 -04:00
|
|
|
if len(arr) == 2 {
|
|
|
|
r[arr[0]] = arr[1]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return r
|
|
|
|
}
|
2016-04-13 16:34:07 -04:00
|
|
|
|
|
|
|
// Apply for a servicing option is a no-op.
|
|
|
|
func (s *ServicingOption) Apply(interface{}) error {
|
|
|
|
return nil
|
|
|
|
}
|
2016-06-24 18:24:06 -04:00
|
|
|
|
2016-09-16 13:41:47 -04:00
|
|
|
// Apply for the flush option is a no-op.
|
2016-09-19 17:47:48 -04:00
|
|
|
func (f *FlushOption) Apply(interface{}) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// Apply for the hypervisolation option is a no-op.
|
|
|
|
func (h *HyperVIsolationOption) Apply(interface{}) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// Apply for the layer option is a no-op.
|
|
|
|
func (h *LayerOption) Apply(interface{}) error {
|
2016-09-16 13:41:47 -04:00
|
|
|
return nil
|
|
|
|
}
|
2016-09-17 21:17:51 -04:00
|
|
|
|
|
|
|
// Apply for the network endpoints option is a no-op.
|
|
|
|
func (s *NetworkEndpointsOption) Apply(interface{}) error {
|
|
|
|
return nil
|
|
|
|
}
|
2016-06-07 15:15:50 -04:00
|
|
|
|
|
|
|
// Apply for the credentials option is a no-op.
|
|
|
|
func (s *CredentialsOption) Apply(interface{}) error {
|
|
|
|
return nil
|
|
|
|
}
|
2017-08-01 14:57:50 -04:00
|
|
|
|
|
|
|
// Apply for the LCOW option is a no-op.
|
|
|
|
func (s *LCOWOption) Apply(interface{}) error {
|
|
|
|
return nil
|
|
|
|
}
|