Documentation
¶
Index ¶
- Constants
- Variables
- func APIEnvVarsToMap(envs []api.EnvVar) map[string]string
- func AddToEnvList(env []string, key string, value string, overwrite bool) []string
- func EnvironToAPIEnvVar(envs []string) []api.EnvVar
- func ExpandContainerCommandOnlyStatic(containerCommand []string, envs []api.EnvVar) (command []string)
- func GetNameFromString(n string) string
- func GetNamespaceFromString(n string) string
- func GetNumberOfFreeAndAvailableBlocks(path string) (uint64, uint64, error)
- func LookupUser(userspec string, lookup UserLookup) (uint32, uint32, string, error)
- func MapDiff(spec, status map[string]interface{}) ([]string, []string, []string)
- func Minint64(a, b int64) int64
- func ParseImageSpec(image string) (string, string, error)
- func SetOOMScore(pid, score int) error
- func SplitNamespaceAndName(n string) (string, string)
- func Version() string
- func WithNamespace(ns, name string) string
- type FakeUserLookup
- type OsUserLookup
- type PasswdUserLookup
- type UserLookup
Constants ¶
const (
NamespaceSeparator = '_'
)
Variables ¶
var ( // VERSION is set during the build from the file at itzo/version VERSION string = "" // GIT_REVISION and GIT_DIRTY are set during build. GIT_REVISION string = "" GIT_DIRTY string = "" )
Functions ¶
func APIEnvVarsToMap ¶
V1EnvVarsToMap constructs a map of environment name to value from a slice of env vars.
func AddToEnvList ¶
Add an entry to the list of environment variables. Also removes duplicate entries, only keeping the last one.
func EnvironToAPIEnvVar ¶
func ExpandContainerCommandOnlyStatic ¶
func ExpandContainerCommandOnlyStatic(containerCommand []string, envs []api.EnvVar) (command []string)
ExpandContainerCommandOnlyStatic substitutes only static environment variable values from the container environment definitions. This does *not* include valueFrom substitutions. TODO: callers should use ExpandContainerCommandAndArgs with a fully resolved list of environment.
func GetNameFromString ¶
func GetNamespaceFromString ¶
func LookupUser ¶
func ParseImageSpec ¶
Most registry URLs don't have a leading scheme (e.g. http://). This means that we can't use url.Parse to find the host name from the image's path. We'll use some heuristics to get the server and image path.
func SetOOMScore ¶
We disable the OOM Killer for Itzo in the itzo startup script but we want to reenable it for user processes that itzo spawns
func SplitNamespaceAndName ¶
func WithNamespace ¶
Types ¶
type FakeUserLookup ¶
type FakeUserLookup struct {
Uid uint32
UidGid uint32
UidErr error
Gid uint32
GidErr error
Homedir string
}
func (*FakeUserLookup) Lookup ¶
func (ful *FakeUserLookup) Lookup(username string) (*user.User, error)
func (*FakeUserLookup) LookupGroup ¶
func (ful *FakeUserLookup) LookupGroup(name string) (*user.Group, error)
func (*FakeUserLookup) LookupGroupId ¶
func (ful *FakeUserLookup) LookupGroupId(name string) (*user.Group, error)
type OsUserLookup ¶
type OsUserLookup struct{}
func (*OsUserLookup) LookupGroup ¶
func (oul *OsUserLookup) LookupGroup(name string) (*user.Group, error)
func (*OsUserLookup) LookupGroupId ¶
func (oul *OsUserLookup) LookupGroupId(name string) (*user.Group, error)
type PasswdUserLookup ¶
type PasswdUserLookup struct {
RootFs string
// contains filtered or unexported fields
}
func NewPasswdUserLookup ¶
func NewPasswdUserLookup(path string) (*PasswdUserLookup, error)
func (*PasswdUserLookup) Lookup ¶
func (l *PasswdUserLookup) Lookup(username string) (*user.User, error)
func (*PasswdUserLookup) LookupGroup ¶
func (l *PasswdUserLookup) LookupGroup(name string) (*user.Group, error)
func (*PasswdUserLookup) LookupGroupId ¶
func (l *PasswdUserLookup) LookupGroupId(name string) (*user.Group, error)