Skip to content
Merged
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,19 @@
return err
}

// signed data contains secret reference to the enrollment token so we extract the cleartext value

Check failure on line 80 in internal/pkg/agent/application/actions/handlers/handler_action_migrate.go

View workflow job for this annotation

GitHub Actions / lint (macos-latest)

File is not properly formatted (goimports)
// out of action.Data and replace it after unmarshalling the signed data into action.Data
// see: https://github.com/elastic/fleet-server/blob/22f1f7a0474080d3f56c7148a6505cff0957f549/internal/pkg/secret/secret.go#L75
enrollmentToken := action.Data.EnrollmentToken

if signedData != nil {
if err := json.Unmarshal(signedData, &action.Data); err != nil {
return fmt.Errorf("failed to convert signed data to action data: %w", err)
}
}

action.Data.EnrollmentToken = enrollmentToken

if err := h.coord.Migrate(ctx, action, fleetgateway.RequestBackoff); err != nil {
// this should not happen, unmanaged agent should not receive the action
// defensive coding to avoid misbehavior
Expand Down
Loading