mirror of
https://github.com/project-zot/zot.git
synced 2026-06-16 04:17:55 +08:00
feat(pagination): move pagination and sorting image summary results after conversion (#1637)
fix(config): check for config media type when pushing to repodb Signed-off-by: Laurentiu Niculae <niculae.laurentiu1@gmail.com>
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"fmt"
|
||||
"io/fs"
|
||||
"os"
|
||||
"strings"
|
||||
"syscall"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
@@ -101,3 +102,13 @@ func MarshalThroughStruct(obj interface{}, throughStruct interface{}) ([]byte, e
|
||||
|
||||
return toJSON, nil
|
||||
}
|
||||
|
||||
func ContainsStringIgnoreCase(strSlice []string, str string) bool {
|
||||
for _, val := range strSlice {
|
||||
if strings.EqualFold(val, str) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
+2
-2
@@ -84,7 +84,7 @@ func GetImageLastUpdated(imageInfo ispec.Image) time.Time {
|
||||
return *timeStamp
|
||||
}
|
||||
|
||||
// GetRepoRefference returns the components of a repoName:tag or repoName@digest string. If the format is wrong
|
||||
// GetRepoReference returns the components of a repoName:tag or repoName@digest string. If the format is wrong
|
||||
// an error is returned.
|
||||
// The returned values have the following meaning:
|
||||
//
|
||||
@@ -95,7 +95,7 @@ func GetImageLastUpdated(imageInfo ispec.Image) time.Time {
|
||||
// - bool: value for the statement: "the reference is a tag"
|
||||
//
|
||||
// - error: error value.
|
||||
func GetRepoRefference(repo string) (string, string, bool, error) {
|
||||
func GetRepoReference(repo string) (string, string, bool, error) {
|
||||
repoName, digest, found := strings.Cut(repo, "@")
|
||||
|
||||
if !found {
|
||||
|
||||
Reference in New Issue
Block a user