Пример #1
0
// Resolve resolves variables in the resource
func (c *ComposeConfig) Resolve(env *execenv.ExecEnv) (Resource, error) {
	conf := *c
	var err error
	conf.Files, err = env.ResolveSlice(c.Files)
	if err != nil {
		return &conf, err
	}
	conf.Project, err = env.Resolve(c.Project)
	return &conf, err
}
Пример #2
0
// Resolve resolves variables in the resource
func (c *MountConfig) Resolve(env *execenv.ExecEnv) (Resource, error) {
	conf := *c
	var err error
	conf.Path, err = env.Resolve(c.Path)
	if err != nil {
		return &conf, err
	}
	conf.Bind, err = fs.ExpandUser(c.Bind)
	return &conf, err
}
Пример #3
0
// Resolve resolves variables in the config
func (c *EnvConfig) Resolve(env *execenv.ExecEnv) (Resource, error) {
	conf := *c
	var err error

	conf.Files, err = env.ResolveSlice(c.Files)
	if err != nil {
		return &conf, err
	}

	conf.Variables, err = env.ResolveSlice(c.Variables)
	return &conf, err
}
Пример #4
0
// Resolve resolves variables in the resource
func (c *ImageConfig) Resolve(env *execenv.ExecEnv) (Resource, error) {
	conf := *c
	var err error
	conf.Tags, err = env.ResolveSlice(c.Tags)
	if err != nil {
		return &conf, err
	}

	for key, value := range c.Args {
		conf.Args[key], err = env.Resolve(value)
		if err != nil {
			return &conf, err
		}
	}
	return &conf, nil
}
Пример #5
0
// Resolve resolves variables in the resource
func (c *JobConfig) Resolve(env *execenv.ExecEnv) (Resource, error) {
	conf := *c
	var err error
	conf.Env, err = env.ResolveSlice(c.Env)
	if err != nil {
		return &conf, err
	}
	conf.WorkingDir, err = env.Resolve(c.WorkingDir)
	if err != nil {
		return &conf, err
	}
	conf.User, err = env.Resolve(c.User)
	if err != nil {
		return &conf, err
	}
	conf.NetMode, err = env.Resolve(c.NetMode)
	return &conf, err
}