fix(edge/stacks): use default namespace when none is specified in manifest (#125)

release/2.24
LP B 2 weeks ago committed by GitHub
parent b2eb4388fd
commit 707fc91a32

@ -62,7 +62,7 @@ services:
require.True(t, containerExists(composeContainerName))
waitResult := <-w.WaitForStatus(ctx, projectName, libstack.StatusCompleted, "")
waitResult := <-w.WaitForStatus(ctx, projectName, libstack.StatusCompleted)
require.Empty(t, waitResult.ErrorMsg)
require.Equal(t, libstack.StatusCompleted, waitResult.Status)

@ -111,7 +111,7 @@ func aggregateStatuses(services []service) (libstack.Status, string) {
}
func (c *ComposeDeployer) WaitForStatus(ctx context.Context, name string, status libstack.Status, _ string) <-chan libstack.WaitResult {
func (c *ComposeDeployer) WaitForStatus(ctx context.Context, name string, status libstack.Status) <-chan libstack.WaitResult {
waitResultCh := make(chan libstack.WaitResult)
waitResult := libstack.WaitResult{Status: status}
@ -135,7 +135,6 @@ func (c *ComposeDeployer) WaitForStatus(ctx context.Context, name string, status
defer cancelFunc()
containerSummaries, err = composeService.Ps(psCtx, name, api.PsOptions{All: true})
return err
}); err != nil {
log.Debug().

@ -66,7 +66,7 @@ func TestComposeProjectStatus(t *testing.T) {
time.Sleep(5 * time.Second)
status, statusMessage, err := waitForStatus(w, ctx, projectName, libstack.StatusRunning, "")
status, statusMessage, err := waitForStatus(w, ctx, projectName, libstack.StatusRunning)
if err != nil {
t.Fatalf("[test: %s] Failed to get compose project status: %v", testCase.TestName, err)
}
@ -86,7 +86,7 @@ func TestComposeProjectStatus(t *testing.T) {
time.Sleep(20 * time.Second)
status, statusMessage, err = waitForStatus(w, ctx, projectName, libstack.StatusRemoved, "")
status, statusMessage, err = waitForStatus(w, ctx, projectName, libstack.StatusRemoved)
if err != nil {
t.Fatalf("[test: %s] Failed to get compose project status: %v", testCase.TestName, err)
}
@ -102,11 +102,11 @@ func TestComposeProjectStatus(t *testing.T) {
}
}
func waitForStatus(deployer libstack.Deployer, ctx context.Context, stackName string, requiredStatus libstack.Status, stackFileLocation string) (libstack.Status, string, error) {
func waitForStatus(deployer libstack.Deployer, ctx context.Context, stackName string, requiredStatus libstack.Status) (libstack.Status, string, error) {
ctx, cancel := context.WithTimeout(ctx, 1*time.Minute)
defer cancel()
statusCh := deployer.WaitForStatus(ctx, stackName, requiredStatus, stackFileLocation)
statusCh := deployer.WaitForStatus(ctx, stackName, requiredStatus)
result := <-statusCh
if result.ErrorMsg == "" {
return result.Status, "", nil

@ -16,7 +16,7 @@ type Deployer interface {
Pull(ctx context.Context, filePaths []string, options Options) error
Run(ctx context.Context, filePaths []string, serviceName string, options RunOptions) error
Validate(ctx context.Context, filePaths []string, options Options) error
WaitForStatus(ctx context.Context, name string, status Status, stackFileLocation string) <-chan WaitResult
WaitForStatus(ctx context.Context, name string, status Status) <-chan WaitResult
Config(ctx context.Context, filePaths []string, options Options) ([]byte, error)
}

Loading…
Cancel
Save