Skip to content

Commit

Permalink
lxd/identities: lint error fix (identityCacheEntries needs to be pr…
Browse files Browse the repository at this point in the history
…e-allocated)

Signed-off-by: Gabriel Mougard <[email protected]>
  • Loading branch information
gabrielmougard committed Jan 10, 2025
1 parent f175821 commit c19f2af
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lxd/identities.go
Original file line number Diff line number Diff line change
Expand Up @@ -1885,7 +1885,8 @@ func updateIdentityCacheFromLocal(d *Daemon) error {
return fmt.Errorf("Failed reading certificates from local database: %w", err)
}

var identityCacheEntries []identity.CacheEntry
// identityCacheEntries needs to be pre-allocated.
identityCacheEntries := make([]identity.CacheEntry, 0)
for _, dbCert := range localServerCerts {
certBlock, _ := pem.Decode([]byte(dbCert.Certificate))
if certBlock == nil {
Expand Down

0 comments on commit c19f2af

Please sign in to comment.