Skip to content
This repository was archived by the owner on Sep 17, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cli/cmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"context"

"github.com/elastic/e2e-testing/cli/config"
"github.com/elastic/e2e-testing/cli/services"
"github.com/elastic/e2e-testing/internal/compose"
log "github.com/sirupsen/logrus"

"github.com/spf13/cobra"
Expand Down Expand Up @@ -63,7 +63,7 @@ func buildDeployServiceCommand(srv string) *cobra.Command {
Short: `Deploys a ` + srv + ` service`,
Long: `Deploys a ` + srv + ` service, adding it to a running profile, identified by its name`,
Run: func(cmd *cobra.Command, args []string) {
serviceManager := services.NewServiceManager()
serviceManager := compose.NewServiceManager()

env := map[string]string{}
env = config.PutServiceEnvironment(env, srv, versionToRun)
Expand All @@ -85,7 +85,7 @@ func buildUndeployServiceCommand(srv string) *cobra.Command {
Short: `Undeploys a ` + srv + ` service`,
Long: `Undeploys a ` + srv + ` service, removing it from a running profile, identified by its name`,
Run: func(cmd *cobra.Command, args []string) {
serviceManager := services.NewServiceManager()
serviceManager := compose.NewServiceManager()

env := map[string]string{}
env = config.PutServiceEnvironment(env, srv, versionToRun)
Expand Down
6 changes: 3 additions & 3 deletions cli/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"

"github.com/elastic/e2e-testing/cli/config"
"github.com/elastic/e2e-testing/cli/services"
"github.com/elastic/e2e-testing/internal/compose"
log "github.com/sirupsen/logrus"

"github.com/spf13/cobra"
Expand Down Expand Up @@ -63,7 +63,7 @@ func buildRunServiceCommand(srv string) *cobra.Command {
Short: `Runs a ` + srv + ` service`,
Long: `Runs a ` + srv + ` service, spinning up a Docker container for it and exposing its internal configuration so that you are able to connect to it in an easy manner`,
Run: func(cmd *cobra.Command, args []string) {
serviceManager := services.NewServiceManager()
serviceManager := compose.NewServiceManager()

env := config.PutServiceEnvironment(map[string]string{}, srv, versionToRun)

Expand Down Expand Up @@ -91,7 +91,7 @@ func buildRunProfileCommand(key string, profile config.Profile) *cobra.Command {
Short: `Runs the ` + profile.Name + ` profile`,
Long: `Runs the ` + profile.Name + ` profile, spinning up the Services that compound it`,
Run: func(cmd *cobra.Command, args []string) {
serviceManager := services.NewServiceManager()
serviceManager := compose.NewServiceManager()

env := map[string]string{
"profileVersion": versionToRun,
Expand Down
6 changes: 3 additions & 3 deletions cli/cmd/stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"context"

"github.com/elastic/e2e-testing/cli/config"
"github.com/elastic/e2e-testing/cli/services"
"github.com/elastic/e2e-testing/internal/compose"
log "github.com/sirupsen/logrus"

"github.com/spf13/cobra"
Expand Down Expand Up @@ -55,7 +55,7 @@ func buildStopServiceCommand(srv string) *cobra.Command {
Short: `Stops a ` + srv + ` service`,
Long: `Stops a ` + srv + ` service, stoppping its Docker container`,
Run: func(cmd *cobra.Command, args []string) {
serviceManager := services.NewServiceManager()
serviceManager := compose.NewServiceManager()

err := serviceManager.StopCompose(context.Background(), false, []string{srv})
if err != nil {
Expand All @@ -73,7 +73,7 @@ func buildStopProfileCommand(key string, profile config.Profile) *cobra.Command
Short: `Stops the ` + profile.Name + ` profile`,
Long: `Stops the ` + profile.Name + ` profile, stopping the Services that compound it`,
Run: func(cmd *cobra.Command, args []string) {
serviceManager := services.NewServiceManager()
serviceManager := compose.NewServiceManager()

err := serviceManager.StopCompose(context.Background(), true, []string{key})
if err != nil {
Expand Down
12 changes: 6 additions & 6 deletions cli/cmd/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
"strings"

"github.com/elastic/e2e-testing/cli/config"
git "github.com/elastic/e2e-testing/cli/internal"
io "github.com/elastic/e2e-testing/cli/internal"
"github.com/elastic/e2e-testing/cli/services"
git "github.com/elastic/e2e-testing/internal/git"
io "github.com/elastic/e2e-testing/internal/io"
"github.com/elastic/e2e-testing/internal/sanitizer"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"

Expand Down Expand Up @@ -197,7 +197,7 @@ func copyIntegrationsComposeFiles(beats git.Project, pattern string, target stri
}

type service interface{}
type compose struct {
type composeFile struct {
Version string `yaml:"version"`
Services map[string]service `yaml:"services"`
}
Expand All @@ -212,7 +212,7 @@ func sanitizeComposeFile(composeFilePath string, targetFilePath string) error {
return err
}

c := compose{}
c := composeFile{}
err = yaml.Unmarshal(bytes, &c)
if err != nil {
log.WithFields(log.Fields{
Expand Down Expand Up @@ -276,7 +276,7 @@ func sanitizeConfigurationFile(serviceName string, configFilePath string) error
// prepend modules header
content = "metricbeat.modules:\n" + content

serviceSanitizer := services.GetConfigSanitizer(serviceName)
serviceSanitizer := sanitizer.GetConfigSanitizer(serviceName)
content = serviceSanitizer.Sanitize(content)

log.WithFields(log.Fields{
Expand Down
6 changes: 3 additions & 3 deletions cli/cmd/sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"

"github.com/Flaque/filet"
io "github.com/elastic/e2e-testing/cli/internal"
"github.com/elastic/e2e-testing/internal/io"
"github.com/stretchr/testify/assert"
"gopkg.in/yaml.v2"
)
Expand All @@ -28,7 +28,7 @@ func TestSanitizeComposeFile_Multiple(t *testing.T) {
bytes, err := io.ReadFile(target)
assert.Nil(t, err)

c := compose{}
c := composeFile{}
err = yaml.Unmarshal(bytes, &c)
assert.Nil(t, err)

Expand Down Expand Up @@ -73,7 +73,7 @@ func TestSanitizeComposeFile_Single(t *testing.T) {
bytes, err := io.ReadFile(target)
assert.Nil(t, err)

c := compose{}
c := composeFile{}
err = yaml.Unmarshal(bytes, &c)
assert.Nil(t, err)

Expand Down
4 changes: 2 additions & 2 deletions cli/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"path/filepath"
"strings"

io "github.com/elastic/e2e-testing/cli/internal"
shell "github.com/elastic/e2e-testing/cli/shell"
io "github.com/elastic/e2e-testing/internal/io"
shell "github.com/elastic/e2e-testing/internal/shell"

packr "github.com/gobuffalo/packr/v2"
homedir "github.com/mitchellh/go-homedir"
Expand Down
2 changes: 1 addition & 1 deletion cli/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"strings"
"testing"

io "github.com/elastic/e2e-testing/cli/internal"
"github.com/elastic/e2e-testing/internal/io"

"github.com/Flaque/filet"
"github.com/sirupsen/logrus"
Expand Down
Loading