Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

cli: unable to run profile with attached services #944

Closed
adam-stokes opened this issue Mar 26, 2021 · 2 comments · Fixed by #957
Closed

cli: unable to run profile with attached services #944

adam-stokes opened this issue Mar 26, 2021 · 2 comments · Fixed by #957
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@adam-stokes
Copy link
Contributor

⏚ [adam:~/Projects/e2e-testing/cli] gh-fix-933 11s 130 ± op run profile fleet -s elastic-agent
fleet_elasticsearch_1 is up-to-date
fleet_package-registry_1 is up-to-date
fleet_kibana_1 is up-to-date
panic: runtime error: index out of range [1] with length 1

goroutine 1 [running]:
github.com/elastic/e2e-testing/cli/cmd.buildRunProfileCommand.func1(0xc00078a500, 0xc00069df20, 0x0, 0x2)
        /Users/adam/Projects/e2e-testing/cli/cmd/run.go:103 +0x7b5
github.com/spf13/cobra.(*Command).execute(0xc00078a500, 0xc00069dee0, 0x2, 0x2, 0xc00078a500, 0xc00069dee0)
        /Users/adam/go/pkg/mod/github.com/spf13/[email protected]/command.go:830 +0x29d
github.com/spf13/cobra.(*Command).ExecuteC(0x4ea8120, 0x8, 0x18, 0xc00069de60)
        /Users/adam/go/pkg/mod/github.com/spf13/[email protected]/command.go:914 +0x2fb
github.com/spf13/cobra.(*Command).Execute(...)
        /Users/adam/go/pkg/mod/github.com/spf13/[email protected]/command.go:864
github.com/elastic/e2e-testing/cli/cmd.Execute()
        /Users/adam/Projects/e2e-testing/cli/cmd/root.go:24 +0x42
main.main()
        /Users/adam/Projects/e2e-testing/cli/main.go:17 +0x20
@adam-stokes adam-stokes added bug Something isn't working good first issue Good for newcomers labels Mar 26, 2021
@adam-stokes adam-stokes self-assigned this Mar 26, 2021
@mdelapenya
Copy link
Contributor

Good catch! This bug is caused because we are not validating user inputs, and the split method is not covered against invalid values

services := strings.Split(servicesToRun, ",")

for _, srv := range services {
	arr := strings.Split(srv, ":")
	image := arr[0]
	tag := arr[1]
...

@mdelapenya
Copy link
Contributor

After fixing that, you'll notice that the elastic-agent docker image mounts a volume provided by the e2e side (look for elasticAgentConfigFile).

adam-stokes added a commit that referenced this issue Mar 29, 2021
Fixes #944

This adds a length check on the string split for verifying that the
<service/image name>:<tag> is defined when adding additional services to a
profile deployment.

Signed-off-by: Adam Stokes <[email protected]>
adam-stokes added a commit that referenced this issue Mar 29, 2021
Fixes #944

This adds a length check on the string split for verifying that the
<service/image name>:<tag> is defined when adding additional services to a
profile deployment.

Signed-off-by: Adam Stokes <[email protected]>
mdelapenya pushed a commit to mdelapenya/e2e-testing that referenced this issue Apr 22, 2021
…ic#957)

Fixes elastic#944

This adds a length check on the string split for verifying that the
<service/image name>:<tag> is defined when adding additional services to a
profile deployment.

Signed-off-by: Adam Stokes <[email protected]>
mdelapenya added a commit that referenced this issue Apr 22, 2021
* cli: enable loading default profiles turnkey (#943)

* cli: enable loading default profiles turnkey

Fixes #933
* update NOTICE
* Fix additional lint issues in ingest_manager_test
* Cleanup comment and trace log in GetComposeFile
* Provide better trace feedback if missing docker-compose
* Update cli/config/config.go
* chore: add back traces when extracting the files from the box (#946)
* fix: use a more comprehensive initialisation method for configs
   As go init() method is not deterministic, I found that the logger init was
   not called at the right time. With change we ensure that the Init is:
   1) called first
   2) existing it the config was already populated
* chore: add back traces when extracting the files from the box

Signed-off-by: Adam Stokes <[email protected]>
Co-authored-by: Manuel de la Peña <[email protected]>

* Add basic check on correct service is defined for profile runs (#957)

Fixes #944

This adds a length check on the string split for verifying that the
<service/image name>:<tag> is defined when adding additional services to a
profile deployment.

Signed-off-by: Adam Stokes <[email protected]>

* Update NOTICE (#969)

Adds additional overrides to pulling in the proper licenses

Signed-off-by: Adam Stokes <[email protected]>

* Build binaries via goreleaser (#977)

This handles building for all supported architectures including running packr
for embedding the binary files.

This allows us to easily extend our release process for tagging official cli
releases, building in various package formats and publishing to different
package registries

Signed-off-by: Adam Stokes <[email protected]>

* chore: simplify release process on Jenkins (#980)

* chore: archive releases in Jenkins UI

* chore: simplify release process on Jenkins

* chore: remove garbage

* chore: support retrying fetching the goreleaser script

It will also retry in the case the release command fails

* chore: set GITHUB_TOKEN

* chore: ensure workspace is clean in the worker

* chore: add release information for goreleaser

* Remove the agent config file parameters for stand alone (#983)

Signed-off-by: Adam Stokes <[email protected]>

Co-authored-by: Manuel de la Peña <[email protected]>

* fix: run unit tests after refactor (#1067)

* chore: remove unused files after refactor

* chore: run unit tests with new layout

* fix: run unit tests on CI

* chore: include unit tests for the e2e dir

* fix: move unit tests resources for installer tests

* fix: move more test resources for unit tests

* fix: abstract path calculation from OS

Co-authored-by: Adam Stokes <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants