Documentation ¶
Index ¶
- Constants
- Variables
- func APIEnvVarsToMap(envs []api.EnvVar) map[string]string
- func AddToEnvList(env []string, key string, value string, overwrite bool) []string
- func EnsureProg(prog, downloadURL, minVersion, versionArg string) (string, error)
- 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 InstallProg(url, path string) 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 RunProg(prog string, outputLimit, maxRetries int, args ...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 ¶
View Source
const (
NamespaceSeparator = '_'
)
Variables ¶
View Source
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 EnsureProg ¶
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 InstallProg ¶
func LookupUser ¶
func ParseImageSpec ¶
Parse the image spec and extract the registry server and the repo name. Example image specs:
ECS: ACCOUNT.dkr.ecr.REGION.amazonaws.com/imagename:tag Docker Hub: imagename:tag or owner/imagename:tag
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)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.