mirror of
https://github.com/Quiq/docker-registry-ui.git
synced 2025-09-09 17:08:54 +00:00
Add -purge-from-repos="repo1,repo2,..." and -disable-count-tags options
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"os"
|
||||
"reflect"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
@@ -58,3 +59,15 @@ func ItemInSlice(item string, slice []string) bool {
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Sprit repo path by namespace and repo name
|
||||
func SplitRepoPath(repoPath string) (string, string) {
|
||||
namespace := "library"
|
||||
repo := repoPath
|
||||
if strings.Contains(repoPath, "/") {
|
||||
f := strings.SplitN(repoPath, "/", 2)
|
||||
namespace = f[0]
|
||||
repo = f[1]
|
||||
}
|
||||
return namespace, repo
|
||||
}
|
||||
|
Reference in New Issue
Block a user