Conversation
3dcce8d to
444311e
Compare
|
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane) |
cmacknz
left a comment
There was a problem hiding this comment.
Code LGTM, is there a test that can be added to ensure this works?
|
This pull request is now in conflicts. Could you fix it? 🙏 |
@cmacknz Request and responses messages are generated with cproto and the server operation implementation is pretty simple. I suppose that this could be tested in an integration test (a new or an existing one) but that would seem overkill. |
91e7b92 to
9fd3ea4
Compare
|
Adding a check for available rollbacks in an existing integration test works for me. I wouldn't write a new integration test for this if unit testing isn't convenient. For example we could list rollbacks right before manually triggering one in the block below for example and that would cover this and seems straight forward: elastic-agent/testing/integration/ess/upgrade_rollback_test.go Lines 401 to 406 in 10d1902 |
fa37784 to
e74b496
Compare
|
This pull request is now in conflicts. Could you fix it? 🙏 |
1e10b16 to
c17a254
Compare
|
@pchila sorry for my shenanigans with force pushing to fix the commit history 😢 . I think I correctly fixed the Beats submodule conflict with my latest commit. |
* add new messages and operation * List available rollbacks from CLI * Add output flag for human, json, yaml * assert list rollback command in standalone manual rollback tests * bump beats * fixup! assert list rollback command in standalone manual rollback tests * fixup! fixup! assert list rollback command in standalone manual rollback tests --------- Co-authored-by: Eric Beahan <eric.beahan@elastic.co> (cherry picked from commit 876106c)
* add new messages and operation * List available rollbacks from CLI * Add output flag for human, json, yaml * assert list rollback command in standalone manual rollback tests * bump beats * fixup! assert list rollback command in standalone manual rollback tests * fixup! fixup! assert list rollback command in standalone manual rollback tests --------- (cherry picked from commit 876106c) Co-authored-by: Paolo Chilà <paolo.chila@elastic.co> Co-authored-by: Eric Beahan <eric.beahan@elastic.co>
* add new messages and operation * List available rollbacks from CLI * Add output flag for human, json, yaml * assert list rollback command in standalone manual rollback tests * bump beats * fixup! assert list rollback command in standalone manual rollback tests * fixup! fixup! assert list rollback command in standalone manual rollback tests --------- Co-authored-by: Eric Beahan <eric.beahan@elastic.co>
…ead of MY_POD_IP (#12205) * Update OTel collector gateway to use 0.0.0.0 instead of MY_POD_IP This allows the gateway to listen on all network interfaces for traffic, this follows the same pattern that the daemon collector uses. This prevents warnings being logged in k8s * Add changelog for OTel gateway endpoint update * Update gateway collector binding address to use specific K8s OTEL_K8S_POD_IP This is done as using 0.0.0.0 can be more risky in the case of DDOS attacks, see https://opentelemetry.io/docs/security/config-best-practices/#protect-against-denial-of-service-attacks * Update OTel gateway otlp endpoint to be OTEL_K8S_POD_IP in k8s tests * Update changelog with OTEL_K8S_POD_IP for kube-stack gateway OTLP update * Revert update to k8s integration test for OTel gateway These tests are automatically updated from upstream * docs: update security url to link to central policy (#12241) * docs: update security url to link to central policy * docs: update security url to link to central policy * [main][Automation] Update elastic/beats to eff88abc6dc8 (#12237) Co-authored-by: swiatekm <93588780+swiatekm@users.noreply.github.com> Co-authored-by: Mikołaj Świątek <mail@mikolajswiatek.com> * Update elastic-agent-libs 0.31.0 -> 0.32.0 (#12240) Co-authored-by: Mikołaj Świątek <mail@mikolajswiatek.com> * List available rollbacks (#11751) * add new messages and operation * List available rollbacks from CLI * Add output flag for human, json, yaml * assert list rollback command in standalone manual rollback tests * bump beats * fixup! assert list rollback command in standalone manual rollback tests * fixup! fixup! assert list rollback command in standalone manual rollback tests --------- Co-authored-by: Eric Beahan <eric.beahan@elastic.co> * [main][Automation] Update elastic/beats to 990735bb782a (#12252) Co-authored-by: swiatekm <93588780+swiatekm@users.noreply.github.com> --------- Co-authored-by: Mikołaj Świątek <mail@mikolajswiatek.com> Co-authored-by: Paul McCann <paul.mccann@elastic.co> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: swiatekm <93588780+swiatekm@users.noreply.github.com> Co-authored-by: Michal Pristas <michal.pristas@elastic.co> Co-authored-by: Paolo Chilà <paolo.chila@elastic.co> Co-authored-by: Eric Beahan <eric.beahan@elastic.co>
…ead of MY_POD_IP (#12205) * Update OTel collector gateway to use 0.0.0.0 instead of MY_POD_IP This allows the gateway to listen on all network interfaces for traffic, this follows the same pattern that the daemon collector uses. This prevents warnings being logged in k8s * Add changelog for OTel gateway endpoint update * Update gateway collector binding address to use specific K8s OTEL_K8S_POD_IP This is done as using 0.0.0.0 can be more risky in the case of DDOS attacks, see https://opentelemetry.io/docs/security/config-best-practices/#protect-against-denial-of-service-attacks * Update OTel gateway otlp endpoint to be OTEL_K8S_POD_IP in k8s tests * Update changelog with OTEL_K8S_POD_IP for kube-stack gateway OTLP update * Revert update to k8s integration test for OTel gateway These tests are automatically updated from upstream * docs: update security url to link to central policy (#12241) * docs: update security url to link to central policy * docs: update security url to link to central policy * [main][Automation] Update elastic/beats to eff88abc6dc8 (#12237) Co-authored-by: swiatekm <93588780+swiatekm@users.noreply.github.com> Co-authored-by: Mikołaj Świątek <mail@mikolajswiatek.com> * Update elastic-agent-libs 0.31.0 -> 0.32.0 (#12240) Co-authored-by: Mikołaj Świątek <mail@mikolajswiatek.com> * List available rollbacks (#11751) * add new messages and operation * List available rollbacks from CLI * Add output flag for human, json, yaml * assert list rollback command in standalone manual rollback tests * bump beats * fixup! assert list rollback command in standalone manual rollback tests * fixup! fixup! assert list rollback command in standalone manual rollback tests --------- Co-authored-by: Eric Beahan <eric.beahan@elastic.co> * [main][Automation] Update elastic/beats to 990735bb782a (#12252) Co-authored-by: swiatekm <93588780+swiatekm@users.noreply.github.com> --------- Co-authored-by: Mikołaj Świątek <mail@mikolajswiatek.com> Co-authored-by: Paul McCann <paul.mccann@elastic.co> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: swiatekm <93588780+swiatekm@users.noreply.github.com> Co-authored-by: Michal Pristas <michal.pristas@elastic.co> Co-authored-by: Paolo Chilà <paolo.chila@elastic.co> Co-authored-by: Eric Beahan <eric.beahan@elastic.co> (cherry picked from commit 6ae71f4)
…ead of MY_POD_IP (#12205) * Update OTel collector gateway to use 0.0.0.0 instead of MY_POD_IP This allows the gateway to listen on all network interfaces for traffic, this follows the same pattern that the daemon collector uses. This prevents warnings being logged in k8s * Add changelog for OTel gateway endpoint update * Update gateway collector binding address to use specific K8s OTEL_K8S_POD_IP This is done as using 0.0.0.0 can be more risky in the case of DDOS attacks, see https://opentelemetry.io/docs/security/config-best-practices/#protect-against-denial-of-service-attacks * Update OTel gateway otlp endpoint to be OTEL_K8S_POD_IP in k8s tests * Update changelog with OTEL_K8S_POD_IP for kube-stack gateway OTLP update * Revert update to k8s integration test for OTel gateway These tests are automatically updated from upstream * docs: update security url to link to central policy (#12241) * docs: update security url to link to central policy * docs: update security url to link to central policy * [main][Automation] Update elastic/beats to eff88abc6dc8 (#12237) Co-authored-by: swiatekm <93588780+swiatekm@users.noreply.github.com> Co-authored-by: Mikołaj Świątek <mail@mikolajswiatek.com> * Update elastic-agent-libs 0.31.0 -> 0.32.0 (#12240) Co-authored-by: Mikołaj Świątek <mail@mikolajswiatek.com> * List available rollbacks (#11751) * add new messages and operation * List available rollbacks from CLI * Add output flag for human, json, yaml * assert list rollback command in standalone manual rollback tests * bump beats * fixup! assert list rollback command in standalone manual rollback tests * fixup! fixup! assert list rollback command in standalone manual rollback tests --------- Co-authored-by: Eric Beahan <eric.beahan@elastic.co> * [main][Automation] Update elastic/beats to 990735bb782a (#12252) Co-authored-by: swiatekm <93588780+swiatekm@users.noreply.github.com> --------- Co-authored-by: Mikołaj Świątek <mail@mikolajswiatek.com> Co-authored-by: Paul McCann <paul.mccann@elastic.co> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: swiatekm <93588780+swiatekm@users.noreply.github.com> Co-authored-by: Michal Pristas <michal.pristas@elastic.co> Co-authored-by: Paolo Chilà <paolo.chila@elastic.co> Co-authored-by: Eric Beahan <eric.beahan@elastic.co> (cherry picked from commit 6ae71f4)
…ead of MY_POD_IP (#12205) * Update OTel collector gateway to use 0.0.0.0 instead of MY_POD_IP This allows the gateway to listen on all network interfaces for traffic, this follows the same pattern that the daemon collector uses. This prevents warnings being logged in k8s * Add changelog for OTel gateway endpoint update * Update gateway collector binding address to use specific K8s OTEL_K8S_POD_IP This is done as using 0.0.0.0 can be more risky in the case of DDOS attacks, see https://opentelemetry.io/docs/security/config-best-practices/#protect-against-denial-of-service-attacks * Update OTel gateway otlp endpoint to be OTEL_K8S_POD_IP in k8s tests * Update changelog with OTEL_K8S_POD_IP for kube-stack gateway OTLP update * Revert update to k8s integration test for OTel gateway These tests are automatically updated from upstream * docs: update security url to link to central policy (#12241) * docs: update security url to link to central policy * docs: update security url to link to central policy * [main][Automation] Update elastic/beats to eff88abc6dc8 (#12237) Co-authored-by: swiatekm <93588780+swiatekm@users.noreply.github.com> Co-authored-by: Mikołaj Świątek <mail@mikolajswiatek.com> * Update elastic-agent-libs 0.31.0 -> 0.32.0 (#12240) Co-authored-by: Mikołaj Świątek <mail@mikolajswiatek.com> * List available rollbacks (#11751) * add new messages and operation * List available rollbacks from CLI * Add output flag for human, json, yaml * assert list rollback command in standalone manual rollback tests * bump beats * fixup! assert list rollback command in standalone manual rollback tests * fixup! fixup! assert list rollback command in standalone manual rollback tests --------- Co-authored-by: Eric Beahan <eric.beahan@elastic.co> * [main][Automation] Update elastic/beats to 990735bb782a (#12252) Co-authored-by: swiatekm <93588780+swiatekm@users.noreply.github.com> --------- Co-authored-by: Mikołaj Świątek <mail@mikolajswiatek.com> Co-authored-by: Paul McCann <paul.mccann@elastic.co> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: swiatekm <93588780+swiatekm@users.noreply.github.com> Co-authored-by: Michal Pristas <michal.pristas@elastic.co> Co-authored-by: Paolo Chilà <paolo.chila@elastic.co> Co-authored-by: Eric Beahan <eric.beahan@elastic.co> (cherry picked from commit 6ae71f4)
…ead of MY_POD_IP (#12205) (#12256) * Update OTel collector gateway to use 0.0.0.0 instead of MY_POD_IP This allows the gateway to listen on all network interfaces for traffic, this follows the same pattern that the daemon collector uses. This prevents warnings being logged in k8s * Add changelog for OTel gateway endpoint update * Update gateway collector binding address to use specific K8s OTEL_K8S_POD_IP This is done as using 0.0.0.0 can be more risky in the case of DDOS attacks, see https://opentelemetry.io/docs/security/config-best-practices/#protect-against-denial-of-service-attacks * Update OTel gateway otlp endpoint to be OTEL_K8S_POD_IP in k8s tests * Update changelog with OTEL_K8S_POD_IP for kube-stack gateway OTLP update * Revert update to k8s integration test for OTel gateway These tests are automatically updated from upstream * docs: update security url to link to central policy (#12241) * docs: update security url to link to central policy * docs: update security url to link to central policy * [main][Automation] Update elastic/beats to eff88abc6dc8 (#12237) * Update elastic-agent-libs 0.31.0 -> 0.32.0 (#12240) * List available rollbacks (#11751) * add new messages and operation * List available rollbacks from CLI * Add output flag for human, json, yaml * assert list rollback command in standalone manual rollback tests * bump beats * fixup! assert list rollback command in standalone manual rollback tests * fixup! fixup! assert list rollback command in standalone manual rollback tests --------- * [main][Automation] Update elastic/beats to 990735bb782a (#12252) --------- (cherry picked from commit 6ae71f4) Co-authored-by: Dónal O'Sullivan <92297851+osullivandonal@users.noreply.github.com> Co-authored-by: Mikołaj Świątek <mail@mikolajswiatek.com> Co-authored-by: Paul McCann <paul.mccann@elastic.co> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: swiatekm <93588780+swiatekm@users.noreply.github.com> Co-authored-by: Michal Pristas <michal.pristas@elastic.co> Co-authored-by: Paolo Chilà <paolo.chila@elastic.co> Co-authored-by: Eric Beahan <eric.beahan@elastic.co>
…ead of MY_POD_IP (#12205) (#12257) * Update OTel collector gateway to use 0.0.0.0 instead of MY_POD_IP This allows the gateway to listen on all network interfaces for traffic, this follows the same pattern that the daemon collector uses. This prevents warnings being logged in k8s * Add changelog for OTel gateway endpoint update * Update gateway collector binding address to use specific K8s OTEL_K8S_POD_IP This is done as using 0.0.0.0 can be more risky in the case of DDOS attacks, see https://opentelemetry.io/docs/security/config-best-practices/#protect-against-denial-of-service-attacks * Update OTel gateway otlp endpoint to be OTEL_K8S_POD_IP in k8s tests * Update changelog with OTEL_K8S_POD_IP for kube-stack gateway OTLP update * Revert update to k8s integration test for OTel gateway These tests are automatically updated from upstream * docs: update security url to link to central policy (#12241) * docs: update security url to link to central policy * docs: update security url to link to central policy * [main][Automation] Update elastic/beats to eff88abc6dc8 (#12237) * Update elastic-agent-libs 0.31.0 -> 0.32.0 (#12240) * List available rollbacks (#11751) * add new messages and operation * List available rollbacks from CLI * Add output flag for human, json, yaml * assert list rollback command in standalone manual rollback tests * bump beats * fixup! assert list rollback command in standalone manual rollback tests * fixup! fixup! assert list rollback command in standalone manual rollback tests --------- * [main][Automation] Update elastic/beats to 990735bb782a (#12252) --------- (cherry picked from commit 6ae71f4) Co-authored-by: Dónal O'Sullivan <92297851+osullivandonal@users.noreply.github.com> Co-authored-by: Mikołaj Świątek <mail@mikolajswiatek.com> Co-authored-by: Paul McCann <paul.mccann@elastic.co> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: swiatekm <93588780+swiatekm@users.noreply.github.com> Co-authored-by: Michal Pristas <michal.pristas@elastic.co> Co-authored-by: Paolo Chilà <paolo.chila@elastic.co> Co-authored-by: Eric Beahan <eric.beahan@elastic.co>
…ead of MY_POD_IP (#12205) (#12255) * Update OTel collector gateway to use 0.0.0.0 instead of MY_POD_IP This allows the gateway to listen on all network interfaces for traffic, this follows the same pattern that the daemon collector uses. This prevents warnings being logged in k8s * Add changelog for OTel gateway endpoint update * Update gateway collector binding address to use specific K8s OTEL_K8S_POD_IP This is done as using 0.0.0.0 can be more risky in the case of DDOS attacks, see https://opentelemetry.io/docs/security/config-best-practices/#protect-against-denial-of-service-attacks * Update OTel gateway otlp endpoint to be OTEL_K8S_POD_IP in k8s tests * Update changelog with OTEL_K8S_POD_IP for kube-stack gateway OTLP update * Revert update to k8s integration test for OTel gateway These tests are automatically updated from upstream * docs: update security url to link to central policy (#12241) * docs: update security url to link to central policy * docs: update security url to link to central policy * [main][Automation] Update elastic/beats to eff88abc6dc8 (#12237) * Update elastic-agent-libs 0.31.0 -> 0.32.0 (#12240) * List available rollbacks (#11751) * add new messages and operation * List available rollbacks from CLI * Add output flag for human, json, yaml * assert list rollback command in standalone manual rollback tests * bump beats * fixup! assert list rollback command in standalone manual rollback tests * fixup! fixup! assert list rollback command in standalone manual rollback tests --------- * [main][Automation] Update elastic/beats to 990735bb782a (#12252) --------- (cherry picked from commit 6ae71f4) Co-authored-by: Dónal O'Sullivan <92297851+osullivandonal@users.noreply.github.com> Co-authored-by: Mikołaj Świątek <mail@mikolajswiatek.com> Co-authored-by: Paul McCann <paul.mccann@elastic.co> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: swiatekm <93588780+swiatekm@users.noreply.github.com> Co-authored-by: Michal Pristas <michal.pristas@elastic.co> Co-authored-by: Paolo Chilà <paolo.chila@elastic.co> Co-authored-by: Eric Beahan <eric.beahan@elastic.co>
What does this PR do?
Add
elastic-agent upgrade list-rollbackssubcommand to show whether there are versions of agent that can be used to trigger a manual rollback withelastic-agent upgrade --rollback <version>Available rollbacks are listed by version and include versioned home and TTL for each.
Output is available in either 'human', 'json' or 'yaml' format
Output looks similar to this
vagrant@elastic-agent-dev:/vagrant/build/distributions$ sudo elastic-agent upgrade list-rollbacks ── 9.4.0-SNAPSHOT ├─ VersionedHome: data/elastic-agent-9.4.0-SNAPSHOT-facbd1 └─ ValidUntil: 2026-01-12T12:54:30Z vagrant@elastic-agent-dev:/vagrant/build/distributions$ sudo elastic-agent upgrade list-rollbacks -o yaml - version: 9.4.0-SNAPSHOT versioned_home: data/elastic-agent-9.4.0-SNAPSHOT-facbd1 valid_until: 2026-01-12T12:54:30Z vagrant@elastic-agent-dev:/vagrant/build/distributions$ sudo elastic-agent upgrade list-rollbacks -o json [ { "version": "9.4.0-SNAPSHOT", "versioned_home": "data/elastic-agent-9.4.0-SNAPSHOT-facbd1", "valid_until": "2026-01-12T12:54:30Z" } ]Why is it important?
Checklist
./changelog/fragmentsusing the changelog toolDisruptive User Impact
How to test this PR locally
agent.upgrade.rollback.window: "2h"toelastic-agent.ymlconfig fileelastic-agent upgrade list-rollbackssubcommandvagrant@elastic-agent-dev:/vagrant/build/distributions/elastic-agent-9.4.0-SNAPSHOT-linux-x86_64$ sudo elastic-agent upgrade list-rollbacks ── 9.4.0-SNAPSHOT ├─ VersionedHome: data/elastic-agent-9.4.0-SNAPSHOT-facbd1 └─ ValidUntil: 2026-01-12T14:31:09Z vagrant@elastic-agent-dev:/vagrant/build/distributions/elastic-agent-9.4.0-SNAPSHOT-linux-x86_64$ sudo elastic-agent upgrade list-rollbacks -o json [ { "version": "9.4.0-SNAPSHOT", "versioned_home": "data/elastic-agent-9.4.0-SNAPSHOT-facbd1", "valid_until": "2026-01-12T14:31:09Z" } ] vagrant@elastic-agent-dev:/vagrant/build/distributions/elastic-agent-9.4.0-SNAPSHOT-linux-x86_64$ sudo elastic-agent upgrade list-rollbacks -o yaml - version: 9.4.0-SNAPSHOT versioned_home: data/elastic-agent-9.4.0-SNAPSHOT-facbd1 valid_until: 2026-01-12T14:31:09Z vagrant@elastic-agent-dev:/vagrant/build/distributions/elastic-agent-9.4.0-SNAPSHOT-linux-x86_64$ sudo elastic-agent upgrade list-rollbacks -o human ── 9.4.0-SNAPSHOT ├─ VersionedHome: data/elastic-agent-9.4.0-SNAPSHOT-facbd1 └─ ValidUntil: 2026-01-12T14:31:09Z vagrant@elastic-agent-dev:/vagrant/build/distributions/elastic-agent-9.4.0-SNAPSHOT-linux-x86_64$ sudo elastic-agent upgrade list-rollbacks -o wrong unsupported output format "wrong": defaulting to "human" ── 9.4.0-SNAPSHOT ├─ VersionedHome: data/elastic-agent-9.4.0-SNAPSHOT-facbd1 └─ ValidUntil: 2026-01-12T14:31:09ZRelated issues
--list-rollbacksoption toelastic-agent upgradesubcommand #6888Questions to ask yourself