Merge 9caf29a19af0fe638f484f53d3bef52ac38894ba into 67691e410db7a50b07a64858820b14de9aa91314
This commit is contained in:
commit
5700c78944
@ -7,6 +7,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
@ -34,12 +35,25 @@ func Unqualified(n Name) error {
|
|||||||
// spot in logs.
|
// spot in logs.
|
||||||
const MissingPart = "!MISSING!"
|
const MissingPart = "!MISSING!"
|
||||||
|
|
||||||
const (
|
var (
|
||||||
defaultHost = "registry.ollama.ai"
|
defaultHost = "registry.ollama.ai"
|
||||||
defaultNamespace = "library"
|
defaultNamespace = "library"
|
||||||
defaultTag = "latest"
|
defaultTag = "latest"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
// Overwrite default Host/Namespace/Tag if they are set in the env
|
||||||
|
if host := os.Getenv("REGISTRY_DEFAULT_HOST"); host != "" {
|
||||||
|
defaultHost = host
|
||||||
|
}
|
||||||
|
if namespace := os.Getenv("REGISTRY_DEFAULT_NAMESPACE"); namespace != "" {
|
||||||
|
defaultNamespace = namespace
|
||||||
|
}
|
||||||
|
if tag := os.Getenv("REGISTRY_DEFAULT_TAG"); tag != "" {
|
||||||
|
defaultTag = tag
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// DefaultName returns a name with the default values for the host, namespace,
|
// DefaultName returns a name with the default values for the host, namespace,
|
||||||
// and tag parts. The model and digest parts are empty.
|
// and tag parts. The model and digest parts are empty.
|
||||||
//
|
//
|
||||||
|
Loading…
x
Reference in New Issue
Block a user