-
Notifications
You must be signed in to change notification settings - Fork 523
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: fix cluster privilege #6396
Conversation
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
🤖 GitHub commentsTo re-run your PR in the CI, just comment with:
|
(cherry picked from commit df09c94)
(cherry picked from commit df09c94)
I ran the Fleet system tests and they all passed: $ go test -v -run \.\*Fleet .
2021/11/04 17:12:37 INFO: starting stack containers...
apm-server_elasticsearch_1 is up-to-date
apm-server_package-registry_1 is up-to-date
apm-server_kibana_1 is up-to-date
apm-server_fleet-server_1 is up-to-date
2021/11/04 17:12:37 INFO: setting up fleet...
2021/11/04 17:12:38 INFO: running system tests...
=== RUN TestFleetIntegration
2021/11/04 17:12:58 Building image elastic-agent-systemtest:8.1.0-2fdb91c4-SNAPSHOT...
2021/11/04 17:12:58 Building apm-server...
2021/11/04 17:12:59 Built /Users/marclop/repos/elastic/apm-server/build/apm-server-linux
2021/11/04 17:13:02 Built image elastic-agent-systemtest:8.1.0-2fdb91c4-SNAPSHOT
2021/11/04 17:13:02 Starting container id: 345ddb8e55be image: quay.io/testcontainers/ryuk:0.2.3
2021/11/04 17:13:02 Waiting for container id 345ddb8e55be image: quay.io/testcontainers/ryuk:0.2.3
2021/11/04 17:13:02 Container is ready id: 345ddb8e55be image: quay.io/testcontainers/ryuk:0.2.3
2021/11/04 17:13:02 Starting container id: a4b8555932af image: elastic-agent-systemtest:8.1.0-2fdb91c4-SNAPSHOT
2021/11/04 17:13:03 Waiting for container id a4b8555932af image: elastic-agent-systemtest:8.1.0-2fdb91c4-SNAPSHOT
2021/11/04 17:13:09 Container is ready id: a4b8555932af image: elastic-agent-systemtest:8.1.0-2fdb91c4-SNAPSHOT
--- PASS: TestFleetIntegration (38.63s)
=== RUN TestFleetIntegrationAnonymousAuth
2021/11/04 17:13:26 Building image elastic-agent-systemtest:8.1.0-2fdb91c4-SNAPSHOT...
2021/11/04 17:13:29 Built image elastic-agent-systemtest:8.1.0-2fdb91c4-SNAPSHOT
2021/11/04 17:13:29 Starting container id: 5aa69172ac33 image: elastic-agent-systemtest:8.1.0-2fdb91c4-SNAPSHOT
2021/11/04 17:13:30 Waiting for container id 5aa69172ac33 image: elastic-agent-systemtest:8.1.0-2fdb91c4-SNAPSHOT
2021/11/04 17:13:35 Container is ready id: 5aa69172ac33 image: elastic-agent-systemtest:8.1.0-2fdb91c4-SNAPSHOT
--- PASS: TestFleetIntegrationAnonymousAuth (23.06s)
=== RUN TestFleetPackageNonMultiple
--- PASS: TestFleetPackageNonMultiple (9.14s)
PASS
ok github.com/elastic/apm-server/systemtest 72.697s Using
package main
import (
"context"
"log"
"time"
"go.elastic.co/apm"
)
func main() {
tx := apm.DefaultTracer.StartTransaction("apm-server-7.16.0", "type")
ctx := apm.ContextWithTransaction(context.Background(), tx)
span, ctx := apm.StartSpan(ctx, "capture-error", "type")
span.Duration = time.Second
span.End()
tx.Duration = 2 * time.Second
tx.End()
apm.DefaultTracer.Flush(nil)
log.Printf("sent %+v\n", apm.DefaultTracer.Stats())
log.Println("done")
}
GET traces-*/_search
{
"_source": [false],
"fields": [
"transaction.name",
"span.name"
],
"query": {
"bool": {
"should": [
{
"match": {
"transaction.type": "type"
}
},
{
"match": {
"span.type": "type"
}
}
]
}
}
} {
"took" : 1,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 2,
"relation" : "eq"
},
"max_score" : 0.2876821,
"hits" : [
{
"_index" : ".ds-traces-apm-default-2021.11.04-000001",
"_type" : "_doc",
"_id" : "G9dE6nwBY0MW94dhbIdS",
"_score" : 0.2876821,
"_source" : { },
"fields" : {
"span.name" : [
"capture-error"
]
}
},
{
"_index" : ".ds-traces-apm-default-2021.11.04-000001",
"_type" : "_doc",
"_id" : "HNdE6nwBY0MW94dhbIdS",
"_score" : 0.2876821,
"_source" : { },
"fields" : {
"transaction.name" : [
"apm-server-7.16.0"
]
}
}
]
}
} |
This pull request is now in conflicts. Could you fix it @axw? 🙏
|
Motivation/summary
The Fleet system tests are failing with this error message in the apm-server logs:
Per elastic/elastic-agent#145, the privilege we need is
cluster:monitor/main
, notmonitor/main
.Checklist
- [ ] Update CHANGELOG.asciidoc- [ ] Documentation has been updatedHow to test these changes
Cherry-pick #6395, check that the Fleet system tests pass.
Related issues
None