Skip to content
This repository has been archived by the owner on Nov 3, 2024. It is now read-only.

Commit

Permalink
bug: fix runtime panic
Browse files Browse the repository at this point in the history
Don't hold a copy of the object because the caller may modify it while we
try to DeepCopy it on read
  • Loading branch information
ibuildthecloud committed Oct 17, 2024
1 parent 440a5c6 commit 096ce85
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/runtime/cached.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func (c *cacheClient) store(obj kclient.Object) {
namespace: obj.GetNamespace(),
name: obj.GetName(),
}] = objectValue{
Object: obj,
Object: obj.DeepCopyObject().(kclient.Object),
Inserted: time.Now(),
}
c.recentLock.Unlock()
Expand Down

0 comments on commit 096ce85

Please sign in to comment.