Skip to content

Commit

Permalink
agent: Accept registration entries with RevisionNumber 0 (#5680)
Browse files Browse the repository at this point in the history
When using the SyncAuthorizedEntries API we verify that the
RevisionNumber of the entries is at least 1. Unfortunately,
the RevisionNumber as assigned by spire-server starts at 0,
leading to the following error:
```
WARN[0004] Received malformed entry revision from SPIRE server; are the server and agent versions compatible?  entry_id=f1a26ecf-1043-4905-b5d9-789e60f88695 revision_number=0 subsystem_name=manager
````

I'm guessing the check is there in the unlikely case of a wrap-around,
so I'm keeping it and verifying that the RevisionNumber is positive.

Signed-off-by: Sorin Dumitru <sdumitru@bloomberg.net>
  • Loading branch information
sorindumitru authored Dec 5, 2024
1 parent a0dd78b commit 683f59a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/agent/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ func (c *client) streamAndSyncEntries(ctx context.Context, entryClient entryv1.E
// on entry revisions.
processEntryRevisions := func(entryRevisions []*entryv1.EntryRevision) {
for _, entryRevision := range entryRevisions {
if entryRevision.Id == "" || entryRevision.RevisionNumber <= 0 {
if entryRevision.Id == "" || entryRevision.RevisionNumber < 0 {
c.c.Log.WithFields(logrus.Fields{
telemetry.RegistrationID: entryRevision.Id,
telemetry.RevisionNumber: entryRevision.RevisionNumber,
Expand Down

0 comments on commit 683f59a

Please sign in to comment.