forked from LaconicNetwork/kompose
This commit updates libcompose in order to merge in https://github.com/docker/libcompose/pull/423 which affected https://github.com/kubernetes-incubator/kompose/issues/92 by not erroring out when an image name wasn't provided. Closes https://github.com/kubernetes-incubator/kompose/issues/92 As well as knocks out the last required milestone for a 0.2.1 release https://github.com/kubernetes-incubator/kompose/milestone/2
25 lines
707 B
Go
25 lines
707 B
Go
package lookup
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/docker/libcompose/config"
|
|
)
|
|
|
|
// OsEnvLookup is a "bare" structure that implements the project.EnvironmentLookup interface
|
|
type OsEnvLookup struct {
|
|
}
|
|
|
|
// Lookup creates a string slice of string containing a "docker-friendly" environment string
|
|
// in the form of 'key=value'. It gets environment values using os.Getenv.
|
|
// If the os environment variable does not exists, the slice is empty. serviceName and config
|
|
// are not used at all in this implementation.
|
|
func (o *OsEnvLookup) Lookup(key string, config *config.ServiceConfig) []string {
|
|
ret := os.Getenv(key)
|
|
if ret == "" {
|
|
return []string{}
|
|
}
|
|
return []string{fmt.Sprintf("%s=%s", key, ret)}
|
|
}
|