Skip to content

Commit

Permalink
fix: use proper key formating as per stanza persister (#3879)
Browse files Browse the repository at this point in the history
* fix: use proper key formating as per stanza persister

* fix: lint
  • Loading branch information
VihasMakwana authored Dec 12, 2023
1 parent 6aa6467 commit 3e563ae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
5 changes: 3 additions & 2 deletions cmd/migratecheckpoint/log_library.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ type Fingerprint struct {
}

type Reader struct {
Fingerprint *Fingerprint
Offset int64
Fingerprint *Fingerprint
FileAttributes map[string]any
Offset int64
}

type journaldCursor struct {
Expand Down
11 changes: 6 additions & 5 deletions cmd/migratecheckpoint/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (m *Migrator) MigrateContainerPos(lines []string) {
defer client.Close()
_, buf := m.ConvertFilePos(lines)

err = client.Set("$.file_input.knownFiles", buf.Bytes())
err = client.Set("file_input.knownFiles", buf.Bytes())
if err != nil {
log.Printf("error storing container checkpoints: %v", err)
}
Expand All @@ -110,7 +110,7 @@ func (m *Migrator) MigrateCustomPos(matches []string) {
if err != nil {
log.Printf("error creating a new DB client for host file checkpoints: %v", err)
}
err = client.Set("$.file_input.knownFiles", buf.Bytes())
err = client.Set("file_input.knownFiles", buf.Bytes())
if err != nil {
log.Printf("error storing host file checkpoints: %v", err)
}
Expand Down Expand Up @@ -141,7 +141,7 @@ func (m *Migrator) MigrateJournaldPos(matches []string) {
if err != nil {
log.Printf("error creating a new DB client for journald checkpoints: %v", err)
}
err = client.Set("$.journald_input.lastReadCursor", []byte(cursor.Cursor))
err = client.Set("journald_input.lastReadCursor", []byte(cursor.Cursor))
if err != nil {
log.Printf("error storing journald checkpoints: %v", err)
}
Expand Down Expand Up @@ -218,8 +218,9 @@ func convertToOtel(path string, hexPos string) (*Reader, error) {
}

reader := &Reader{
Fingerprint: fp,
Offset: offset,
Fingerprint: fp,
Offset: offset,
FileAttributes: map[string]any{},
}
return reader, nil
}

0 comments on commit 3e563ae

Please sign in to comment.