-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feature(4890): added shouldUpgrade function in the upgrade cli file * feature(4890): added shouldUpgrade check into the upgrade command * feature(4890): ran gofmt * feature(4890): added a "force" flag, marked it as hidden * feature(4890): removed dpkg, rpm and container logic * feature(4890): ran gofmt * feature(4890): updated the function signature of the upgrade command, updated tests, added new tests * feature(4890): update comments * feature(4890): added changelog fragment * feature(4890): added fatal log in case there is an error while marking force flag as hidden * feature(4890): added error checks in tests * feature(4890): updated the summary in the changelog fragment * feature(4890): removed the shorthand flag for the force flag * feature(4890): updated synchronization in the tests * Update internal/pkg/agent/cmd/upgrade_test.go Co-authored-by: Paolo Chilà <paolo.chila@elastic.co> * feature(4890): using streams err output instead of defaulting to stderr * feature(4890): use EXPECT instead of On * feature(4890): moved unconfirmed upgrade error to a package var * feature(4890): removed confirmation from upgrade check for when force flag is set * Update internal/pkg/agent/cmd/upgrade.go Co-authored-by: Paolo Chilà <paolo.chila@elastic.co> * Update internal/pkg/agent/cmd/upgrade.go Co-authored-by: Paolo Chilà <paolo.chila@elastic.co> * feature(4890): fix errors * Update internal/pkg/agent/cmd/upgrade.go Co-authored-by: Craig MacKenzie <craig.mackenzie@elastic.co> * feature(4890): update test * fearure(4890): replace ageninfo with state call - updated agentinfo proto - updated relevant generated code - implemented state call in the upgrade cmd * feature(4890): updated proto, client and server implementation * feature(4890): fix struct tag * feature(4890): added skip-verify checks * feature(4890): ran addLicenseHeaders * feature(4890): ran mage clean * feature(4890): fix typo * feature(4890): added timeout to connection * feature(4890): changed condition check order * feature(4890): fix unit tests * feature(4890): refactored tests, using mock client * Update internal/pkg/agent/cmd/upgrade.go Co-authored-by: Andrzej Stencel <andrzej.stencel@elastic.co> * feature(4890): use lower case "f" in error messages to be more consistent * feature(4890): remove duplicate line * feature(4890): ran mage controlProto with correct protoc version --------- Co-authored-by: Paolo Chilà <paolo.chila@elastic.co> Co-authored-by: Craig MacKenzie <craig.mackenzie@elastic.co> Co-authored-by: Andrzej Stencel <andrzej.stencel@elastic.co> (cherry picked from commit 8579474) Co-authored-by: Kaan Yalti <kaan.yalti@elastic.co>
- Loading branch information
1 parent
22ad8f7
commit 8e61536
Showing
10 changed files
with
556 additions
and
216 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
changelog/fragments/1729971565-detect-fail-early-fleet-managed-cli-upgrade.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Kind can be one of: | ||
# - breaking-change: a change to previously-documented behavior | ||
# - deprecation: functionality that is being removed in a later release | ||
# - bug-fix: fixes a problem in a previous version | ||
# - enhancement: extends functionality but does not break or fix existing behavior | ||
# - feature: new functionality | ||
# - known-issue: problems that we are aware of in a given version | ||
# - security: impacts on the security of a product or a user’s deployment. | ||
# - upgrade: important information for someone upgrading from a prior version | ||
# - other: does not fit into any of the other categories | ||
kind: enhancement | ||
|
||
# Change summary; a 80ish characters long description of the change. | ||
summary: Detect and fail-early cli upgrades if agent is fleet-managed | ||
|
||
# Long description; in case the summary is not enough to describe the change | ||
# this field accommodate a description without length limits. | ||
# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment. | ||
description: This change brings restrictions on the upgrade cli command. If an agent is fleet-managed and is running in unprivileged mode, users won't be able to upgrade the agent using the cli. If an agent is fleet-managed and is running privileged, users will only be able to upgrade the agent using the cli if they provide --force flag. | ||
|
||
# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc. | ||
component: "elastic-agent" | ||
|
||
# PR URL; optional; the PR number that added the changeset. | ||
# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added. | ||
# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number. | ||
# Please provide it if you are adding a fragment for a different PR. | ||
pr: https://github.com/elastic/elastic-agent/pull/5864 | ||
# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of). | ||
# If not present is automatically filled by the tooling with the issue linked to the PR number. | ||
#issue: https://github.com/owner/repo/1234 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.