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

fix: properly copy files from compose to elastic-package#1764

Merged
mdelapenya merged 1 commit intoelastic:masterfrom
mdelapenya:fix-kibana-profile-name
Nov 3, 2021
Merged

fix: properly copy files from compose to elastic-package#1764
mdelapenya merged 1 commit intoelastic:masterfrom
mdelapenya:fix-kibana-profile-name

Conversation

@mdelapenya
Copy link
Copy Markdown
Contributor

@mdelapenya mdelapenya commented Nov 3, 2021

What does this PR do?

This PR reverts the SRC/TARGET file paths used to check and copy the kibana configs from our compose config dir when copying that kibana config to a newly created elastic-package profile.

The src file, which the code checks its existence, must always follow the kibana.config.yml file name, and the target file, where the code copies the src file to, must always follow the elastic-package naming-schema for the config: kibana.config.8x.yml for master or kibana.config.default.yml.

Why is it important?

Whenever an scenario is using a profile different than default, as we do in the preconfigured-policies feature file, the code will incorrectly check for the existence under the compose config dir of a '8x' file, which does not exist, causing in the following error thrown by elastic-package:

[2021-11-03T05:48:41.518Z] time="2021-11-03T05:48:40Z" level=info msg="Running kibana with preconfigured-policies profile"
[2021-11-03T05:48:46.816Z] time="2021-11-03T05:48:46Z" level=error msg="Error executing command" args="[run github.com/elastic/elastic-package stack up --daemon --verbose --version 8.1.0-2fdb91c4-SNAPSHOT --services elasticsearch,fleet-server,kibana -p preconfigured-policies]" baseDir=. command=go env="map[kibanaDockerNamespace:kibana kibanaProfile:preconfigured-policies kibanaVersion:8.1.0-2fdb91c4-SNAPSHOT stackPlatform:linux/amd64 stackVersion:8.1.0-2fdb91c4-SNAPSHOT]" error="exit status 1" stderr="2021/11/03 05:48:46  WARN CommitHash is undefined, in both /var/lib/jenkins/workspace/master-1926-cab5847d-fcd3-40ed-8bc3-57f46e878e9f/.elastic-package/version and the compiled binary, config may be out of date.\n2021/11/03 05:48:46 DEBUG Enable verbose logging\n2021/11/03 05:48:46 DEBUG Distribution built without a version tag, can't determine release chronology. Please consider using official releases at https://github.com/elastic/elastic-package/releases\nBoot up the Elastic stack\nError: preconfigured-policies is not a valid profile, known profiles are: [default]\nexit status 1\n"

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have run the Unit tests (make unit-test), and they are passing locally
  • I have run the End-2-End tests for the suite I'm working on, and they are passing locally
  • I have noticed new Go dependencies (run make notice in the proper directory)

Related issues

Follow-ups

Backports must be fixed, as when backporting this PR to any maintenance branch, the elastic_package.go:L114 must be updated to kiban.config.default.yml.

@mdelapenya mdelapenya added Team:Automation Label for the Observability productivity team bug Something isn't working v7.15.0 v7.16.0 v8.0.0 labels Nov 3, 2021
@mdelapenya mdelapenya self-assigned this Nov 3, 2021
@mdelapenya mdelapenya requested a review from a team November 3, 2021 06:49
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2021-11-03T06:49:38.640+0000

  • Duration: 42 min 2 sec

  • Commit: 083d9db

Test stats 🧪

Test Results
Failed 0
Passed 248
Skipped 0
Total 248

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

Comment thread internal/deploy/elastic_package.go
@mdelapenya mdelapenya merged commit 293ba96 into elastic:master Nov 3, 2021
mergify Bot pushed a commit that referenced this pull request Nov 3, 2021
mergify Bot pushed a commit that referenced this pull request Nov 3, 2021
(cherry picked from commit 293ba96)

# Conflicts:
#	internal/deploy/elastic_package.go
mergify Bot pushed a commit that referenced this pull request Nov 3, 2021
@mdelapenya mdelapenya deleted the fix-kibana-profile-name branch November 3, 2021 09:09
mdelapenya added a commit that referenced this pull request Nov 3, 2021
(cherry picked from commit 293ba96)

Co-authored-by: Manuel de la Peña <mdelapenya@gmail.com>
mdelapenya added a commit that referenced this pull request Nov 3, 2021
…ic-package (#1766)

* fix: properly copy files from compose to elastic-package (#1764)

(cherry picked from commit 293ba96)

# Conflicts:
#	internal/deploy/elastic_package.go

* fix: resolve conflicts

Co-authored-by: Manuel de la Peña <mdelapenya@gmail.com>
mdelapenya added a commit that referenced this pull request Nov 3, 2021
…ic-package (#1767)

* fix: properly copy files from compose to elastic-package (#1764)

(cherry picked from commit 293ba96)

* fix: update target file for elastic-package

Co-authored-by: Manuel de la Peña <mdelapenya@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Something isn't working Team:Automation Label for the Observability productivity team v7.15.0 v7.16.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants