allow pushing/pulling to insecure registries (#157)

This commit is contained in:
Patrick Devine
2023-07-21 15:42:19 -07:00
committed by GitHub
parent f5f0da06d9
commit 9f6e97865c
5 changed files with 86 additions and 39 deletions

View File

@@ -93,7 +93,13 @@ func PullModelHandler(c *gin.Context) {
ch <- r
}
if err := PullModel(req.Name, req.Username, req.Password, fn); err != nil {
regOpts := &RegistryOptions{
Insecure: req.Insecure,
Username: req.Username,
Password: req.Password,
}
if err := PullModel(req.Name, regOpts, fn); err != nil {
ch <- gin.H{"error": err.Error()}
}
}()
@@ -115,7 +121,13 @@ func PushModelHandler(c *gin.Context) {
ch <- r
}
if err := PushModel(req.Name, req.Username, req.Password, fn); err != nil {
regOpts := &RegistryOptions{
Insecure: req.Insecure,
Username: req.Username,
Password: req.Password,
}
if err := PushModel(req.Name, regOpts, fn); err != nil {
ch <- gin.H{"error": err.Error()}
}
}()