func injectEnvironmentVariable(envVars []string, p *project.Project) { for _, conf := range p.Configs { existing := conf.Environment.Slice() envVars = append(envVars, existing...) conf.Environment = project.NewMaporEqualSlice(envVars) } }
func autoformat(cfg *config.CloudConfig) (*config.CloudConfig, error) { if len(cfg.Rancher.State.Autoformat) == 0 || util.ResolveDevice(cfg.Rancher.State.Dev) != "" { return cfg, nil } AUTOFORMAT := "AUTOFORMAT=" + strings.Join(cfg.Rancher.State.Autoformat, " ") FORMATZERO := "FORMATZERO=" + fmt.Sprint(cfg.Rancher.State.FormatZero) t := *cfg t.Rancher.Autoformat["autoformat"].Environment = project.NewMaporEqualSlice([]string{AUTOFORMAT, FORMATZERO}) log.Info("Running Autoformat services") _, err := compose.RunServiceSet("autoformat", &t, t.Rancher.Autoformat) return &t, err }