Skip to content

Ingored upgrade details after migration #5564

@michalpristas

Description

@michalpristas

When migrating agent that is in watching state we don't see any upgrade information on a new cluster

This is because in handleCheckin we check for action

func (ct *CheckinT) processUpgradeDetails(ctx context.Context, agent *model.Agent, details *UpgradeDetails) error {
	if details == nil {
		err := ct.markUpgradeComplete(ctx, agent)
		if err != nil {
			return err
		}
		return nil
	}

	// update docs with in progress details
	action, err := ct.verifyActionExists(ctx, vSpan, agent, details)
	if err != nil {
		return err
	}
	if action == nil {
		return nil
	}
...

agent is reporting upgrade details but as action does not exist we do nothing. UI uses upgrade details stored in a document to present proper upgrade label.

when we start reporting nil upgrade details we mark upgrade completed as function call is before action verification

second issue is when upgrade fails/rollback occurs we set some fields like upgrade_status on ack and upgrade details is handled within checkin. ack part will fail without action as well.

it should be enough to handle details during checkin, double processing is a bit confusing and we should probably get rid of it.
e.g upgrade_status is field that is probably not even used in fleet ui or fleet server.

proposal is to make action presence optional during checkin and update upgrade details every time we send it

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions