refactor(recipe): move GetComposeFiles to new struct

This commit is contained in:
2024-07-08 12:06:58 +02:00
parent ca1db33e97
commit 99da8d4e57
12 changed files with 70 additions and 64 deletions

View File

@ -357,7 +357,7 @@ func mergeAbraShEnv(recipeName string, env envfile.AppEnv) error {
}
// createDeployConfig merges and enriches the compose config for the deployment.
func createDeployConfig(recipeName string, stackName string, env envfile.AppEnv) (*composetypes.Config, stack.Deploy, error) {
func createDeployConfig(r recipe.Recipe2, stackName string, env envfile.AppEnv) (*composetypes.Config, stack.Deploy, error) {
env["STACK_NAME"] = stackName
deployOpts := stack.Deploy{
@ -367,7 +367,7 @@ func createDeployConfig(recipeName string, stackName string, env envfile.AppEnv)
Detach: false,
}
composeFiles, err := recipe.GetComposeFiles(recipeName, env)
composeFiles, err := r.GetComposeFiles(env)
if err != nil {
return nil, deployOpts, err
}
@ -382,7 +382,7 @@ func createDeployConfig(recipeName string, stackName string, env envfile.AppEnv)
// after the upgrade the deployment won't be in chaos state anymore
appPkg.SetChaosLabel(compose, stackName, false)
appPkg.SetRecipeLabel(compose, stackName, recipeName)
appPkg.SetRecipeLabel(compose, stackName, r.Name)
appPkg.SetUpdateLabel(compose, stackName, env)
return compose, deployOpts, nil
@ -455,7 +455,7 @@ func upgrade(cl *dockerclient.Client, stackName, recipeName,
return err
}
compose, deployOpts, err := createDeployConfig(recipeName, stackName, app.Env)
compose, deployOpts, err := createDeployConfig(r, stackName, app.Env)
if err != nil {
return err
}