feat: remote recipes
This commit is contained in:
parent
1a3ec7a107
commit
d7a870b887
@ -14,7 +14,6 @@ import (
|
|||||||
"coopcloud.tech/abra/pkg/autocomplete"
|
"coopcloud.tech/abra/pkg/autocomplete"
|
||||||
"coopcloud.tech/abra/pkg/client"
|
"coopcloud.tech/abra/pkg/client"
|
||||||
"coopcloud.tech/abra/pkg/log"
|
"coopcloud.tech/abra/pkg/log"
|
||||||
"coopcloud.tech/abra/pkg/recipe"
|
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -209,24 +208,23 @@ var appCmdListCommand = cli.Command{
|
|||||||
Before: internal.SubCommandBefore,
|
Before: internal.SubCommandBefore,
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
app := internal.ValidateApp(c)
|
app := internal.ValidateApp(c)
|
||||||
r := recipe.Get(app.Recipe.Name)
|
|
||||||
|
|
||||||
if err := r.EnsureExists(); err != nil {
|
if err := app.Recipe.EnsureExists(); err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !internal.Chaos {
|
if !internal.Chaos {
|
||||||
if err := r.EnsureIsClean(); err != nil {
|
if err := app.Recipe.EnsureIsClean(); err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !internal.Offline {
|
if !internal.Offline {
|
||||||
if err := r.EnsureUpToDate(); err != nil {
|
if err := app.Recipe.EnsureUpToDate(); err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := r.EnsureLatest(); err != nil {
|
if err := app.Recipe.EnsureLatest(); err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,6 @@ import (
|
|||||||
"coopcloud.tech/abra/pkg/client"
|
"coopcloud.tech/abra/pkg/client"
|
||||||
"coopcloud.tech/abra/pkg/formatter"
|
"coopcloud.tech/abra/pkg/formatter"
|
||||||
"coopcloud.tech/abra/pkg/log"
|
"coopcloud.tech/abra/pkg/log"
|
||||||
"coopcloud.tech/abra/pkg/recipe"
|
|
||||||
abraService "coopcloud.tech/abra/pkg/service"
|
abraService "coopcloud.tech/abra/pkg/service"
|
||||||
stack "coopcloud.tech/abra/pkg/upstream/stack"
|
stack "coopcloud.tech/abra/pkg/upstream/stack"
|
||||||
dockerFormatter "github.com/docker/cli/cli/command/formatter"
|
dockerFormatter "github.com/docker/cli/cli/command/formatter"
|
||||||
@ -35,6 +34,9 @@ var appPsCommand = cli.Command{
|
|||||||
BashComplete: autocomplete.AppNameComplete,
|
BashComplete: autocomplete.AppNameComplete,
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
app := internal.ValidateApp(c)
|
app := internal.ValidateApp(c)
|
||||||
|
if err := app.Recipe.Ensure(false, false); err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
cl, err := client.New(app.Server)
|
cl, err := client.New(app.Server)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -74,8 +76,7 @@ var appPsCommand = cli.Command{
|
|||||||
|
|
||||||
// showPSOutput renders ps output.
|
// showPSOutput renders ps output.
|
||||||
func showPSOutput(app appPkg.App, cl *dockerClient.Client, deployedVersion, chaosVersion string) {
|
func showPSOutput(app appPkg.App, cl *dockerClient.Client, deployedVersion, chaosVersion string) {
|
||||||
r := recipe.Get(app.Recipe.Name)
|
composeFiles, err := app.Recipe.GetComposeFiles(app.Env)
|
||||||
composeFiles, err := r.GetComposeFiles(app.Env)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
return
|
return
|
||||||
|
@ -10,7 +10,6 @@ import (
|
|||||||
|
|
||||||
"coopcloud.tech/abra/cli/internal"
|
"coopcloud.tech/abra/cli/internal"
|
||||||
"coopcloud.tech/abra/pkg/autocomplete"
|
"coopcloud.tech/abra/pkg/autocomplete"
|
||||||
"coopcloud.tech/abra/pkg/config"
|
|
||||||
"coopcloud.tech/abra/pkg/formatter"
|
"coopcloud.tech/abra/pkg/formatter"
|
||||||
gitPkg "coopcloud.tech/abra/pkg/git"
|
gitPkg "coopcloud.tech/abra/pkg/git"
|
||||||
"coopcloud.tech/abra/pkg/log"
|
"coopcloud.tech/abra/pkg/log"
|
||||||
@ -391,7 +390,7 @@ func pushRelease(recipe recipe.Recipe, tagString string) error {
|
|||||||
if err := recipe.Push(internal.Dry); err != nil {
|
if err := recipe.Push(internal.Dry); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
url := fmt.Sprintf("%s/%s/src/tag/%s", config.REPOS_BASE_URL, recipe.Name, tagString)
|
url := fmt.Sprintf("%s/src/tag/%s", recipe.GitURL, tagString)
|
||||||
log.Infof("new release published: %s", url)
|
log.Infof("new release published: %s", url)
|
||||||
} else {
|
} else {
|
||||||
log.Info("no -p/--publish passed, not publishing")
|
log.Info("no -p/--publish passed, not publishing")
|
||||||
|
@ -433,8 +433,7 @@ func tryUpgrade(cl *dockerclient.Client, stackName, recipeName string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// upgrade performs all necessary steps to upgrade an app.
|
// upgrade performs all necessary steps to upgrade an app.
|
||||||
func upgrade(cl *dockerclient.Client, stackName, recipeName,
|
func upgrade(cl *dockerclient.Client, stackName, recipeName, upgradeVersion string) error {
|
||||||
upgradeVersion string) error {
|
|
||||||
env, err := getEnv(cl, stackName)
|
env, err := getEnv(cl, stackName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -85,8 +85,7 @@ func TestGetComposeFiles(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
r2 := recipe.Get(r.Name)
|
composeFiles, err := r.GetComposeFiles(test.appEnv)
|
||||||
composeFiles, err := r2.GetComposeFiles(test.appEnv)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
@ -107,8 +106,7 @@ func TestGetComposeFilesError(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
r2 := recipe.Get(r.Name)
|
_, err := r.GetComposeFiles(test.appEnv)
|
||||||
_, err := r2.GetComposeFiles(test.appEnv)
|
|
||||||
if err == nil {
|
if err == nil {
|
||||||
t.Fatalf("should have failed: %v", test.appEnv)
|
t.Fatalf("should have failed: %v", test.appEnv)
|
||||||
}
|
}
|
||||||
|
@ -113,8 +113,7 @@ func TestCheckEnv(t *testing.T) {
|
|||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
r2 := recipe.Get(r.Name)
|
envSample, err := r.SampleEnv()
|
||||||
envSample, err := r2.SampleEnv()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
@ -147,8 +146,7 @@ func TestCheckEnvError(t *testing.T) {
|
|||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
r2 := recipe.Get(r.Name)
|
envSample, err := r.SampleEnv()
|
||||||
envSample, err := r2.SampleEnv()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
@ -183,8 +181,7 @@ func TestEnvVarCommentsRemoved(t *testing.T) {
|
|||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
r2 := recipe.Get(r.Name)
|
envSample, err := r.SampleEnv()
|
||||||
envSample, err := r2.SampleEnv()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
|
|
||||||
"coopcloud.tech/abra/pkg/config"
|
|
||||||
"coopcloud.tech/abra/pkg/log"
|
"coopcloud.tech/abra/pkg/log"
|
||||||
"coopcloud.tech/abra/pkg/recipe"
|
"coopcloud.tech/abra/pkg/recipe"
|
||||||
recipePkg "coopcloud.tech/abra/pkg/recipe"
|
recipePkg "coopcloud.tech/abra/pkg/recipe"
|
||||||
@ -214,8 +213,7 @@ func LintComposeVersion(recipe recipe.Recipe) (bool, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func LintEnvConfigPresent(r recipe.Recipe) (bool, error) {
|
func LintEnvConfigPresent(r recipe.Recipe) (bool, error) {
|
||||||
r2 := recipe.Get(r.Name)
|
if _, err := os.Stat(r.SampleEnvPath); !os.IsNotExist(err) {
|
||||||
if _, err := os.Stat(r2.SampleEnvPath); !os.IsNotExist(err) {
|
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -241,10 +239,9 @@ func LintAppService(recipe recipe.Recipe) (bool, error) {
|
|||||||
// the recipe. This typically means that no domain is required to deploy and
|
// the recipe. This typically means that no domain is required to deploy and
|
||||||
// therefore no matching traefik deploy label will be present.
|
// therefore no matching traefik deploy label will be present.
|
||||||
func LintTraefikEnabledSkipCondition(r recipe.Recipe) (bool, error) {
|
func LintTraefikEnabledSkipCondition(r recipe.Recipe) (bool, error) {
|
||||||
r2 := recipe.Get(r.Name)
|
sampleEnv, err := r.SampleEnv()
|
||||||
sampleEnv, err := r2.SampleEnv()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, fmt.Errorf("Unable to discover .env.sample for %s", r2.Name)
|
return false, fmt.Errorf("Unable to discover .env.sample for %s", r.Name)
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, ok := sampleEnv["DOMAIN"]; !ok {
|
if _, ok := sampleEnv["DOMAIN"]; !ok {
|
||||||
@ -390,8 +387,7 @@ func LintHasPublishedVersion(recipe recipe.Recipe) (bool, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func LintMetadataFilledIn(r recipe.Recipe) (bool, error) {
|
func LintMetadataFilledIn(r recipe.Recipe) (bool, error) {
|
||||||
r2 := recipe.Get(r.Name)
|
features, category, err := recipe.GetRecipeFeaturesAndCategory(r)
|
||||||
features, category, err := recipe.GetRecipeFeaturesAndCategory(r2)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
@ -431,9 +427,7 @@ func LintAbraShVendors(recipe recipe.Recipe) (bool, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func LintHasRecipeRepo(recipe recipe.Recipe) (bool, error) {
|
func LintHasRecipeRepo(recipe recipe.Recipe) (bool, error) {
|
||||||
url := fmt.Sprintf("%s/%s.git", config.REPOS_BASE_URL, recipe.Name)
|
res, err := http.Get(recipe.GitURL)
|
||||||
|
|
||||||
res, err := http.Get(url)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
|
@ -39,17 +39,14 @@ func (r Recipe) Ensure(chaos bool, offline bool) error {
|
|||||||
|
|
||||||
// EnsureExists ensures that the recipe is locally cloned
|
// EnsureExists ensures that the recipe is locally cloned
|
||||||
func (r Recipe) EnsureExists() error {
|
func (r Recipe) EnsureExists() error {
|
||||||
recipeDir := path.Join(config.RECIPES_DIR, r.Name)
|
if _, err := os.Stat(r.Dir); os.IsNotExist(err) {
|
||||||
|
log.Debugf("%s does not exist, attemmpting to clone", r.Dir)
|
||||||
if _, err := os.Stat(recipeDir); os.IsNotExist(err) {
|
if err := gitPkg.Clone(r.Dir, r.GitURL); err != nil {
|
||||||
log.Debugf("%s does not exist, attemmpting to clone", recipeDir)
|
|
||||||
url := fmt.Sprintf("%s/%s.git", config.REPOS_BASE_URL, r.Name)
|
|
||||||
if err := gitPkg.Clone(recipeDir, url); err != nil {
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := gitPkg.EnsureGitRepo(recipeDir); err != nil {
|
if err := gitPkg.EnsureGitRepo(r.Dir); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,13 +57,11 @@ func (r Recipe) EnsureExists() error {
|
|||||||
func (r Recipe) EnsureVersion(version string) (bool, error) {
|
func (r Recipe) EnsureVersion(version string) (bool, error) {
|
||||||
isChaosCommit := false
|
isChaosCommit := false
|
||||||
|
|
||||||
recipeDir := path.Join(config.RECIPES_DIR, r.Name)
|
if err := gitPkg.EnsureGitRepo(r.Dir); err != nil {
|
||||||
|
|
||||||
if err := gitPkg.EnsureGitRepo(recipeDir); err != nil {
|
|
||||||
return isChaosCommit, err
|
return isChaosCommit, err
|
||||||
}
|
}
|
||||||
|
|
||||||
repo, err := git.PlainOpen(recipeDir)
|
repo, err := git.PlainOpen(r.Dir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return isChaosCommit, err
|
return isChaosCommit, err
|
||||||
}
|
}
|
||||||
@ -117,23 +112,21 @@ func (r Recipe) EnsureVersion(version string) (bool, error) {
|
|||||||
return isChaosCommit, nil
|
return isChaosCommit, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Debugf("successfully checked %s out to %s in %s", r.Name, tagRef.Short(), recipeDir)
|
log.Debugf("successfully checked %s out to %s in %s", r.Name, tagRef.Short(), r.Dir)
|
||||||
|
|
||||||
return isChaosCommit, nil
|
return isChaosCommit, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// EnsureIsClean makes sure that the recipe repository has no unstaged changes.
|
// EnsureIsClean makes sure that the recipe repository has no unstaged changes.
|
||||||
func (r Recipe) EnsureIsClean() error {
|
func (r Recipe) EnsureIsClean() error {
|
||||||
recipeDir := path.Join(config.RECIPES_DIR, r.Name)
|
isClean, err := gitPkg.IsClean(r.Dir)
|
||||||
|
|
||||||
isClean, err := gitPkg.IsClean(recipeDir)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("unable to check git clean status in %s: %s", recipeDir, err)
|
return fmt.Errorf("unable to check git clean status in %s: %s", r.Dir, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !isClean {
|
if !isClean {
|
||||||
msg := "%s (%s) has locally unstaged changes? please commit/remove your changes before proceeding"
|
msg := "%s (%s) has locally unstaged changes? please commit/remove your changes before proceeding"
|
||||||
return fmt.Errorf(msg, r.Name, recipeDir)
|
return fmt.Errorf(msg, r.Name, r.Dir)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
@ -4,6 +4,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"slices"
|
"slices"
|
||||||
@ -123,11 +124,28 @@ type Features struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Get(name string) Recipe {
|
func Get(name string) Recipe {
|
||||||
dir := path.Join(config.RECIPES_DIR, name)
|
gitURL := fmt.Sprintf("%s/%s.git", config.REPOS_BASE_URL, name)
|
||||||
|
sshURL := fmt.Sprintf(config.SSH_URL_TEMPLATE, name)
|
||||||
|
if strings.Contains(name, "/") {
|
||||||
|
u, err := url.Parse(name)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("invalid recipe: %s", err)
|
||||||
|
}
|
||||||
|
u.Scheme = "https"
|
||||||
|
gitURL = u.String() + ".git"
|
||||||
|
|
||||||
|
u.Scheme = "ssh"
|
||||||
|
u.User = url.User("git")
|
||||||
|
sshURL = u.String() + ".git"
|
||||||
|
}
|
||||||
|
|
||||||
|
dir := path.Join(config.RECIPES_DIR, escapeRecipeName(name))
|
||||||
|
|
||||||
return Recipe{
|
return Recipe{
|
||||||
Name: name,
|
Name: name,
|
||||||
Dir: dir,
|
Dir: dir,
|
||||||
SSHURL: fmt.Sprintf(config.SSH_URL_TEMPLATE, name),
|
GitURL: gitURL,
|
||||||
|
SSHURL: sshURL,
|
||||||
|
|
||||||
ComposePath: path.Join(dir, "compose.yml"),
|
ComposePath: path.Join(dir, "compose.yml"),
|
||||||
ReadmePath: path.Join(dir, "README.md"),
|
ReadmePath: path.Join(dir, "README.md"),
|
||||||
@ -139,6 +157,7 @@ func Get(name string) Recipe {
|
|||||||
type Recipe struct {
|
type Recipe struct {
|
||||||
Name string
|
Name string
|
||||||
Dir string
|
Dir string
|
||||||
|
GitURL string
|
||||||
SSHURL string
|
SSHURL string
|
||||||
|
|
||||||
ComposePath string
|
ComposePath string
|
||||||
@ -147,6 +166,12 @@ type Recipe struct {
|
|||||||
AbraShPath string
|
AbraShPath string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func escapeRecipeName(recipeName string) string {
|
||||||
|
recipeName = strings.ReplaceAll(recipeName, "/", "_")
|
||||||
|
recipeName = strings.ReplaceAll(recipeName, ".", "_")
|
||||||
|
return recipeName
|
||||||
|
}
|
||||||
|
|
||||||
// GetRecipesLocal retrieves all local recipe directories
|
// GetRecipesLocal retrieves all local recipe directories
|
||||||
func GetRecipesLocal() ([]string, error) {
|
func GetRecipesLocal() ([]string, error) {
|
||||||
var recipes []string
|
var recipes []string
|
||||||
|
@ -1,11 +1,60 @@
|
|||||||
package recipe
|
package recipe
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"path"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"coopcloud.tech/abra/pkg/config"
|
||||||
|
|
||||||
|
"github.com/google/go-cmp/cmp"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func TestGet(t *testing.T) {
|
||||||
|
cfg := config.LoadAbraConfig()
|
||||||
|
testcases := []struct {
|
||||||
|
name string
|
||||||
|
recipe Recipe
|
||||||
|
}{
|
||||||
|
{
|
||||||
|
name: "foo",
|
||||||
|
recipe: Recipe{
|
||||||
|
Name: "foo",
|
||||||
|
Dir: path.Join(cfg.GetAbraDir(), "/recipes/foo"),
|
||||||
|
GitURL: "https://git.coopcloud.tech/coop-cloud/foo.git",
|
||||||
|
SSHURL: "ssh://git@git.coopcloud.tech:2222/coop-cloud/foo.git",
|
||||||
|
ComposePath: path.Join(cfg.GetAbraDir(), "recipes/foo/compose.yml"),
|
||||||
|
ReadmePath: path.Join(cfg.GetAbraDir(), "recipes/foo/README.md"),
|
||||||
|
SampleEnvPath: path.Join(cfg.GetAbraDir(), "recipes/foo/.env.sample"),
|
||||||
|
AbraShPath: path.Join(cfg.GetAbraDir(), "recipes/foo/abra.sh"),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "mygit.org/myorg/cool-recipe",
|
||||||
|
recipe: Recipe{
|
||||||
|
Name: "mygit.org/myorg/cool-recipe",
|
||||||
|
Dir: path.Join(cfg.GetAbraDir(), "/recipes/mygit_org_myorg_cool-recipe"),
|
||||||
|
GitURL: "https://mygit.org/myorg/cool-recipe.git",
|
||||||
|
SSHURL: "ssh://git@mygit.org/myorg/cool-recipe.git",
|
||||||
|
ComposePath: path.Join(cfg.GetAbraDir(), "recipes/mygit_org_myorg_cool-recipe/compose.yml"),
|
||||||
|
ReadmePath: path.Join(cfg.GetAbraDir(), "recipes/mygit_org_myorg_cool-recipe/README.md"),
|
||||||
|
SampleEnvPath: path.Join(cfg.GetAbraDir(), "recipes/mygit_org_myorg_cool-recipe/.env.sample"),
|
||||||
|
AbraShPath: path.Join(cfg.GetAbraDir(), "recipes/mygit_org_myorg_cool-recipe/abra.sh"),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, tc := range testcases {
|
||||||
|
t.Run(tc.name, func(t *testing.T) {
|
||||||
|
t.Setenv("ABRA_DIR", "<abraDir>")
|
||||||
|
recipe := Get(tc.name)
|
||||||
|
if diff := cmp.Diff(tc.recipe, recipe); diff != "" {
|
||||||
|
t.Errorf("Recipe mismatch (-want +got):\n%s", diff)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestGetVersionLabelLocalDoesNotUseTimeoutLabel(t *testing.T) {
|
func TestGetVersionLabelLocalDoesNotUseTimeoutLabel(t *testing.T) {
|
||||||
offline := true
|
offline := true
|
||||||
|
|
||||||
|
@ -16,7 +16,6 @@ import (
|
|||||||
"coopcloud.tech/abra/pkg/config"
|
"coopcloud.tech/abra/pkg/config"
|
||||||
"coopcloud.tech/abra/pkg/envfile"
|
"coopcloud.tech/abra/pkg/envfile"
|
||||||
"coopcloud.tech/abra/pkg/log"
|
"coopcloud.tech/abra/pkg/log"
|
||||||
"coopcloud.tech/abra/pkg/recipe"
|
|
||||||
"coopcloud.tech/abra/pkg/upstream/stack"
|
"coopcloud.tech/abra/pkg/upstream/stack"
|
||||||
loader "coopcloud.tech/abra/pkg/upstream/stack"
|
loader "coopcloud.tech/abra/pkg/upstream/stack"
|
||||||
"github.com/decentral1se/passgen"
|
"github.com/decentral1se/passgen"
|
||||||
@ -246,8 +245,7 @@ type secretStatuses []secretStatus
|
|||||||
func PollSecretsStatus(cl *dockerClient.Client, app appPkg.App) (secretStatuses, error) {
|
func PollSecretsStatus(cl *dockerClient.Client, app appPkg.App) (secretStatuses, error) {
|
||||||
var secStats secretStatuses
|
var secStats secretStatuses
|
||||||
|
|
||||||
r := recipe.Get(app.Recipe.Name)
|
composeFiles, err := app.Recipe.GetComposeFiles(app.Env)
|
||||||
composeFiles, err := r.GetComposeFiles(app.Env)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return secStats, err
|
return secStats, err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user