Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apmpackage: change secret_token to string #4575

Merged
merged 1 commit into from
Dec 23, 2020

Conversation

axw
Copy link
Member

@axw axw commented Dec 22, 2020

Motivation/summary

Fix the integration package secret_token setting, changing its type to "string" rather than "bool".

Checklist

- [ ] Update CHANGELOG.asciidoc
- [ ] Documentation has been updated

How to test these changes

  1. Install the package, and check that a text entry is shown for "Secret token" on the integration settings page in Fleet. Leave the setting empty.
  2. Assign the package to a policy, add an agent
  3. Observe that no secret token is required (e.g. via the healthcheck endpoint)
  4. Set a non-empty value for the secret token
  5. Restart elastic-agent
  6. Observe that a secret token is now requied

Related issues

Closes #4572

@axw
Copy link
Member Author

axw commented Dec 22, 2020

jenkins run the tests please

1 similar comment
@axw
Copy link
Member Author

axw commented Dec 23, 2020

jenkins run the tests please

@codecov-io
Copy link

Codecov Report

Merging #4575 (1a6f05e) into master (7903826) will increase coverage by 0.03%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #4575      +/-   ##
==========================================
+ Coverage   75.96%   75.99%   +0.03%     
==========================================
  Files         161      161              
  Lines        9789     9789              
==========================================
+ Hits         7436     7439       +3     
+ Misses       2353     2350       -3     
Impacted Files Coverage Δ
...ack/apm-server/aggregation/txmetrics/aggregator.go 93.80% <0.00%> (+0.44%) ⬆️
beater/jaeger/common.go 82.14% <0.00%> (+7.14%) ⬆️

@apmmachine
Copy link
Contributor

💔 Build Failed

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

Expand to view the summary

Build stats

  • Build Cause: axw commented: jenkins run the tests please

  • Start Time: 2020-12-23T02:26:06.699+0000

  • Duration: 47 min 32 sec

Test stats 🧪

Test Results
Failed 0
Passed 4471
Skipped 124
Total 4595

Steps errors 4

Expand to view the steps failures

Compress
  • Took 0 min 0 sec . View more details on here
  • Description: tar --exclude=coverage-files.tgz -czf coverage-files.tgz coverage
Run Linux tests
  • Took 7 min 1 sec . View more details on here
  • Description: ./.ci/scripts/linux-test.sh
Compress
  • Took 0 min 0 sec . View more details on here
  • Description: tar --exclude=system-tests-linux-files.tgz -czf system-tests-linux-files.tgz system-tests
Test Sync
  • Took 3 min 17 sec . View more details on here
  • Description: ./.ci/scripts/sync.sh

Log output

Expand to view the last 100 lines of log output

[2020-12-23T02:47:31.138Z]   Duration: 3m47.0416588s
[2020-12-23T02:47:31.138Z]   Coverage Report: C:\Users\jenkins\workspace\pm-server_apm-server-mbp_PR-4575\src\github.com\elastic\apm-server\build\TEST-go-unit.html
[2020-12-23T02:47:31.138Z]   JUnit Report:    C:\Users\jenkins\workspace\pm-server_apm-server-mbp_PR-4575\src\github.com\elastic\apm-server\build\TEST-go-unit.xml
[2020-12-23T02:47:31.138Z]   Output File:     C:\Users\jenkins\workspace\pm-server_apm-server-mbp_PR-4575\src\github.com\elastic\apm-server\build\TEST-go-unit.out
[2020-12-23T02:47:31.138Z] >> go test: Unit Test Passed
[2020-12-23T02:47:31.138Z] System testing 
[2020-12-23T02:47:34.439Z] warning: no packages being tested depend on matches for pattern github.com/elastic/apm-server/apmpackage/cmd/gen-package
[2020-12-23T02:47:34.439Z] warning: no packages being tested depend on matches for pattern github.com/elastic/apm-server/beater/beatertest
[2020-12-23T02:47:34.439Z] warning: no packages being tested depend on matches for pattern github.com/elastic/apm-server/cmd/pprofessor
[2020-12-23T02:47:34.439Z] warning: no packages being tested depend on matches for pattern github.com/elastic/apm-server/elasticsearch/estest
[2020-12-23T02:47:34.439Z] warning: no packages being tested depend on matches for pattern github.com/elastic/apm-server/model/modeldecoder/generator
[2020-12-23T02:47:34.439Z] warning: no packages being tested depend on matches for pattern github.com/elastic/apm-server/model/modeldecoder/generator/cmd
[2020-12-23T02:47:34.439Z] warning: no packages being tested depend on matches for pattern github.com/elastic/apm-server/model/modeldecoder/generator/generatortest
[2020-12-23T02:47:34.439Z] warning: no packages being tested depend on matches for pattern github.com/elastic/apm-server/model/modeldecoder/modeldecodertest
[2020-12-23T02:47:34.439Z] warning: no packages being tested depend on matches for pattern github.com/elastic/apm-server/processor/stream/package_tests
[2020-12-23T02:47:34.439Z] warning: no packages being tested depend on matches for pattern github.com/elastic/apm-server/sourcemap/test
[2020-12-23T02:47:34.439Z] warning: no packages being tested depend on matches for pattern github.com/elastic/apm-server/tests
[2020-12-23T02:47:34.439Z] warning: no packages being tested depend on matches for pattern github.com/elastic/apm-server/tests/loader
[2020-12-23T02:47:34.439Z] warning: no packages being tested depend on matches for pattern github.com/elastic/apm-server/tests/system/jaegergrpc
[2020-12-23T02:47:34.439Z] warning: no packages being tested depend on matches for pattern github.com/elastic/apm-server/validation
[2020-12-23T02:47:34.440Z] warning: no packages being tested depend on matches for pattern github.com/elastic/apm-server/x-pack/apm-server
[2020-12-23T02:47:34.440Z] warning: no packages being tested depend on matches for pattern github.com/elastic/apm-server/x-pack/apm-server/aggregation/spanmetrics
[2020-12-23T02:47:34.440Z] warning: no packages being tested depend on matches for pattern github.com/elastic/apm-server/x-pack/apm-server/aggregation/txmetrics
[2020-12-23T02:47:34.440Z] warning: no packages being tested depend on matches for pattern github.com/elastic/apm-server/x-pack/apm-server/cmd
[2020-12-23T02:47:34.440Z] warning: no packages being tested depend on matches for pattern github.com/elastic/apm-server/x-pack/apm-server/include
[2020-12-23T02:47:34.440Z] warning: no packages being tested depend on matches for pattern github.com/elastic/apm-server/x-pack/apm-server/sampling
[2020-12-23T02:47:34.440Z] warning: no packages being tested depend on matches for pattern github.com/elastic/apm-server/x-pack/apm-server/sampling/eventstorage
[2020-12-23T02:47:34.440Z] warning: no packages being tested depend on matches for pattern github.com/elastic/apm-server/x-pack/apm-server/sampling/pubsub
[2020-12-23T02:47:34.440Z] warning: no packages being tested depend on matches for pattern github.com/elastic/apm-server/x-pack/apm-server/sampling/pubsub/pubsubtest
[2020-12-23T02:47:34.440Z] 
[2020-12-23T02:49:56.017Z] Running python tests
[2020-12-23T02:49:57.930Z] 2020/12/23 02:49:57 exec: go list -m
[2020-12-23T02:49:57.930Z] >> python test: Unit Testing
[2020-12-23T02:50:02.130Z] ============================= test session starts =============================
[2020-12-23T02:50:02.130Z] platform win32 -- Python 3.8.1, pytest-6.0.1, py-1.9.0, pluggy-0.13.1
[2020-12-23T02:50:02.130Z] rootdir: C:\Users\jenkins\workspace\pm-server_apm-server-mbp_PR-4575\src\github.com\elastic\apm-server
[2020-12-23T02:50:02.130Z] plugins: rerunfailures-9.0, timeout-1.3.4
[2020-12-23T02:50:02.130Z] timeout: 90.0s
[2020-12-23T02:50:02.130Z] timeout method: thread
[2020-12-23T02:50:02.130Z] timeout func_only: False
[2020-12-23T02:50:02.130Z] collected 142 items
[2020-12-23T02:50:02.130Z] 
[2020-12-23T02:50:02.130Z] tests\system\test_apikey_cmd.py sssss                                    [  3%]
[2020-12-23T02:50:10.268Z] tests\system\test_auth.py ..sssssssss                                    [ 11%]
[2020-12-23T02:50:10.268Z] tests\system\test_export.py sss                                          [ 13%]
[2020-12-23T02:50:10.268Z] tests\system\test_integration.py ssssssssssssssssssssssss                [ 30%]
[2020-12-23T02:50:10.268Z] tests\system\test_integration_acm.py sssssssss                           [ 36%]
[2020-12-23T02:50:10.268Z] tests\system\test_integration_sourcemap.py ssssssssssssss                [ 46%]
[2020-12-23T02:50:10.268Z] tests\system\test_jaeger.py sssss                                        [ 50%]
[2020-12-23T02:50:10.268Z] tests\system\test_pipelines.py sssssss                                   [ 54%]
[2020-12-23T02:51:46.759Z] tests\system\test_requests.py ...........................                [ 73%]
[2020-12-23T02:51:46.759Z] tests\system\test_setup_index_management.py sssssssssssssss              [ 84%]
[2020-12-23T02:51:46.759Z] tests\system\test_tls.py ssssssssssssssssssssss                          [100%]
[2020-12-23T02:51:46.759Z] 
[2020-12-23T02:51:46.759Z] ============================== warnings summary ===============================
[2020-12-23T02:51:46.759Z] c:\users\jenkin~1.pac\appdata\local\temp\python-env\build\ve\windows\lib\site-packages\_pytest\junitxml.py:446
[2020-12-23T02:51:46.759Z]   c:\users\jenkin~1.pac\appdata\local\temp\python-env\build\ve\windows\lib\site-packages\_pytest\junitxml.py:446: PytestDeprecationWarning: The 'junit_family' default value will change to 'xunit2' in pytest 6.0. See:
[2020-12-23T02:51:46.759Z]     https://docs.pytest.org/en/stable/deprecations.html#junit-family-default-value-change-to-xunit2
[2020-12-23T02:51:46.759Z]   for more information.
[2020-12-23T02:51:46.759Z]     _issue_warning_captured(deprecated.JUNIT_XML_DEFAULT_FAMILY, config.hook, 2)
[2020-12-23T02:51:46.759Z] 
[2020-12-23T02:51:46.759Z] -- Docs: https://docs.pytest.org/en/stable/warnings.html
[2020-12-23T02:51:46.759Z] - generated xml file: C:\Users\jenkins\workspace\pm-server_apm-server-mbp_PR-4575\src\github.com\elastic\apm-server\build\TEST-python-unit.xml -
[2020-12-23T02:51:46.759Z] ============================ slowest 20 durations =============================
[2020-12-23T02:51:46.759Z] 8.13s call     tests/system/test_requests.py::RateLimitTest::test_rate_limit_small_hit
[2020-12-23T02:51:46.759Z] 7.89s call     tests/system/test_requests.py::ClientSideTest::test_ok
[2020-12-23T02:51:46.759Z] 7.69s call     tests/system/test_requests.py::CorsTest::test_ok
[2020-12-23T02:51:46.759Z] 4.94s call     tests/system/test_auth.py::TestAccessDefault::test_full_access
[2020-12-23T02:51:46.759Z] 3.68s call     tests/system/test_requests.py::CorsTest::test_preflight_bad_headers
[2020-12-23T02:51:46.759Z] 3.66s call     tests/system/test_requests.py::RateLimitTest::test_multiple_ips_rate_limit
[2020-12-23T02:51:46.759Z] 3.65s call     tests/system/test_requests.py::RateLimitTest::test_rate_limit
[2020-12-23T02:51:46.759Z] 3.64s call     tests/system/test_requests.py::RateLimitTest::test_rate_limit_hit
[2020-12-23T02:51:46.759Z] 3.64s call     tests/system/test_requests.py::RateLimitTest::test_multiple_ips_rate_limit_hit
[2020-12-23T02:51:46.759Z] 3.43s call     tests/system/test_auth.py::TestAccessWithSecretToken::test_backend_intake
[2020-12-23T02:51:46.759Z] 3.13s call     tests/system/test_requests.py::RateLimitTest::test_rate_limit_only_metadata
[2020-12-23T02:51:46.759Z] 2.87s call     tests/system/test_requests.py::CorsTest::test_bad_origin
[2020-12-23T02:51:46.759Z] 2.79s call     tests/system/test_requests.py::ClientSideTest::test_sourcemap_upload_fail
[2020-12-23T02:51:46.759Z] 2.76s call     tests/system/test_requests.py::Test::test_validation_fail
[2020-12-23T02:51:46.759Z] 2.76s call     tests/system/test_requests.py::Test::test_healthcheck
[2020-12-23T02:51:46.759Z] 2.74s call     tests/system/test_requests.py::Test::test_ok_verbose
[2020-12-23T02:51:46.759Z] 2.72s call     tests/system/test_requests.py::Test::test_rum_default_disabled
[2020-12-23T02:51:46.759Z] 2.71s call     tests/system/test_requests.py::Test::test_method_not_allowed
[2020-12-23T02:51:46.759Z] 2.71s call     tests/system/test_requests.py::Test::test_ok
[2020-12-23T02:51:46.759Z] 2.71s call     tests/system/test_requests.py::Test::test_not_existent
[2020-12-23T02:51:46.759Z] =========== 29 passed, 113 skipped, 1 warning in 102.61s (0:01:42) ============
[2020-12-23T02:51:46.759Z] >> python test: Unit Testing Complete
[2020-12-23T02:51:47.753Z] Post stage
[2020-12-23T02:51:47.778Z] Recording test results
[2020-12-23T03:12:33.729Z] [INFO] For detailed information see: https://apm-ci.elastic.co/job/apm-integration-tests-selector-mbp/job/master/12728/display/redirect
[2020-12-23T03:12:34.036Z] Copied 17 artifacts from "APM Integration Test MBP Selector » master" build number 12728
[2020-12-23T03:12:34.945Z] Post stage
[2020-12-23T03:12:34.956Z] Recording test results
[2020-12-23T03:12:37.629Z] Running on worker-1095690 in /var/lib/jenkins/workspace/pm-server_apm-server-mbp_PR-4575
[2020-12-23T03:12:37.722Z] [INFO] getVaultSecret: Getting secrets
[2020-12-23T03:12:38.113Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2020-12-23T03:12:40.425Z] + chmod 755 generate-build-data.sh
[2020-12-23T03:12:40.425Z] + ./generate-build-data.sh https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-server/apm-server-mbp/PR-4575/ https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-server/apm-server-mbp/PR-4575/runs/3 FAILURE 2792321
[2020-12-23T03:12:40.425Z] INFO: curl https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-server/apm-server-mbp/PR-4575/runs/3/steps/?limit=10000 -o steps-info.json
[2020-12-23T03:12:41.137Z] INFO: curl https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-server/apm-server-mbp/PR-4575/runs/3/tests/?status=FAILED -o tests-errors.json
[2020-12-23T03:12:41.838Z] INFO: curl https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-server/apm-server-mbp/PR-4575/runs/3/log/ -o pipeline-log.txt

@axw
Copy link
Member Author

axw commented Dec 23, 2020

System tests will fail until there's a new Kibana image (elastic/kibana#86716). Seeing as system tests won't be affected, I'll just merge.

@axw axw merged commit fd21932 into elastic:master Dec 23, 2020
@axw axw deleted the apmpackage-secrettoken-string branch December 23, 2020 05:32
@@ -31,7 +31,7 @@ policy_templates:
show_user: true
default: localhost:8200
- name: secret_token
type: bool
type: string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Secret token" setting should have string type
5 participants