firewalldb: canonicalize action timestamps to UTC

Normalize action timestamp handling to UTC during KV and SQL
marshalling so migration validation behaves consistently on
Postgres backends outside UTC.

This also allows the action time comparison helper to use the
same timezone normalization approach as the other migration
paths.
This commit is contained in:
Viktor Torstensson 2026-05-18 12:25:20 +02:00
parent 7b3916596f
commit d9d5432a10
No known key found for this signature in database
GPG key ID: 961CC8259AE675D4
2 changed files with 3 additions and 3 deletions

View file

@ -421,7 +421,7 @@ func unmarshalAction(ctx context.Context, db SQLActionQueries,
RPCMethod: dbAction.RpcMethod,
RPCParamsJson: dbAction.RpcParamsJson,
},
AttemptedAt: dbAction.CreatedAt,
AttemptedAt: dbAction.CreatedAt.UTC(),
State: ActionState(dbAction.ActionState),
ErrorReason: dbAction.ErrorReason.String,
}, nil

View file

@ -1264,7 +1264,7 @@ func paramsFromAction(action *Action,
StructuredJsonData: []byte(action.StructuredJsonData),
RpcMethod: action.RPCMethod,
RpcParamsJson: action.RPCParamsJson,
CreatedAt: action.AttemptedAt,
CreatedAt: action.AttemptedAt.UTC(),
ActionState: int16(action.State),
ErrorReason: sqldb.SQLStr(action.ErrorReason),
}
@ -1484,7 +1484,7 @@ func marshalDBAction(ctx context.Context, sqlTx *sqlcmig6.Queries,
RPCMethod: dbAction.RpcMethod,
RPCParamsJson: dbAction.RpcParamsJson,
},
AttemptedAt: dbAction.CreatedAt,
AttemptedAt: dbAction.CreatedAt.UTC(),
State: ActionState(dbAction.ActionState),
ErrorReason: dbAction.ErrorReason.String,
}, nil