mirror of
https://github.com/ollama/ollama.git
synced 2025-05-11 10:26:53 +02:00
manifest: Store layers inside manifests consistently as values.
Commit 1829fb61
("manifest: Fix crash on startup when trying to clean up
unused files (#5840)") changed the config layer stored in manifests
from a pointer to a value. This was done in order to avoid potential
nil pointer dereferences after it is deserialized from JSON in the
event that the field is missing.
This changes the Layers slice to also be stored by value. This enables
consistency in handling across the two objects.
This commit is contained in:
parent
97ec8cfd4e
commit
7edaf6e7e8
6 changed files with 33 additions and 33 deletions
|
@ -26,7 +26,7 @@ import (
|
|||
var blobUploadManager sync.Map
|
||||
|
||||
type blobUpload struct {
|
||||
*Layer
|
||||
Layer
|
||||
|
||||
Total int64
|
||||
Completed atomic.Int64
|
||||
|
@ -362,7 +362,7 @@ func (p *progressWriter) Rollback() {
|
|||
p.written = 0
|
||||
}
|
||||
|
||||
func uploadBlob(ctx context.Context, mp ModelPath, layer *Layer, opts *registryOptions, fn func(api.ProgressResponse)) error {
|
||||
func uploadBlob(ctx context.Context, mp ModelPath, layer Layer, opts *registryOptions, fn func(api.ProgressResponse)) error {
|
||||
requestURL := mp.BaseURL()
|
||||
requestURL = requestURL.JoinPath("v2", mp.GetNamespaceRepository(), "blobs", layer.Digest)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue