working commit

This commit is contained in:
2026-02-23 10:43:54 +02:00
parent b6efc19f7a
commit 96b24c6b63
4 changed files with 12 additions and 12 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ mstored$(EXEEXT): $(mstored_SOURCES) $(EXTRA_mstored_SOURCES)
env CGO_ENABLED=1 $(GO) build $(GOFLAGS) -o mstored$(EXEEXT) $(mstored_SOURCES) env CGO_ENABLED=1 $(GO) build $(GOFLAGS) -o mstored$(EXEEXT) $(mstored_SOURCES)
run: $(mstored_SOURCES) run: $(mstored_SOURCES)
cd cmd/mstored && env CGO_ENABLED=1 $(GO) run . cd cmd/mstored && env CGO_ENABLED=1 $(GO) run . --asDaemon=false
CWD=$(shell pwd) CWD=$(shell pwd)
+1 -1
View File
@@ -1062,7 +1062,7 @@ mstored$(EXEEXT): $(mstored_SOURCES) $(EXTRA_mstored_SOURCES)
env CGO_ENABLED=1 $(GO) build $(GOFLAGS) -o mstored$(EXEEXT) $(mstored_SOURCES) env CGO_ENABLED=1 $(GO) build $(GOFLAGS) -o mstored$(EXEEXT) $(mstored_SOURCES)
run: $(mstored_SOURCES) run: $(mstored_SOURCES)
cd cmd/mstored && env CGO_ENABLED=1 $(GO) run . cd cmd/mstored && env CGO_ENABLED=1 $(GO) run . --asDaemon=false
format: format:
@dirs=$$($(FIND) $(CWD)/app $(CWD)/cmd $(CWD)/pkg $(CWD)/test \ @dirs=$$($(FIND) $(CWD)/app $(CWD)/cmd $(CWD)/pkg $(CWD)/test \
+7 -7
View File
@@ -476,13 +476,13 @@ type ListManifestsParams struct {
N int64 N int64
} }
type ListManifestsResult struct { type ListManifestsResult struct {
Catalog []string `json:"repositories"` Repositories []string `json:"repositories"`
} }
func (oper *Operator) ListManifests(ctx context.Context, params *ListManifestsParams) (*ListManifestsResult, int, error) { func (oper *Operator) ListManifests(ctx context.Context, params *ListManifestsParams) (*ListManifestsResult, int, error) {
var err error var err error
res := &ListManifestsResult{ res := &ListManifestsResult{
Catalog: make([]string, 0), Repositories: make([]string, 0),
} }
refMap := make(map[string]bool) refMap := make(map[string]bool)
descrs, err := oper.mdb.ListAllManifests(ctx) descrs, err := oper.mdb.ListAllManifests(ctx)
@@ -490,14 +490,14 @@ func (oper *Operator) ListManifests(ctx context.Context, params *ListManifestsPa
return res, http.StatusInternalServerError, err return res, http.StatusInternalServerError, err
} }
for _, descr := range descrs { for _, descr := range descrs {
_, yet := refMap[descr.Reference] _, already := refMap[descr.Name]
if !yet { if !already {
refMap[descr.Reference] = true refMap[descr.Name] = true
} }
} }
for key, _ := range refMap { for key, _ := range refMap {
res.Catalog = append(res.Catalog, key) res.Repositories = append(res.Repositories, key)
} }
slices.Sort(res.Catalog) slices.Sort(res.Repositories)
return res, http.StatusOK, err return res, http.StatusOK, err
} }
+3 -3
View File
@@ -380,7 +380,7 @@ type CatalogImagesParams struct {
} }
type CatalogImagesResult struct { type CatalogImagesResult struct {
CatalogImages []string `json:"imageConfig"` Repositories []string `json:"repositories"`
} }
func (util *ImageUtil) CatalogImages(cmd *cobra.Command, args []string) { func (util *ImageUtil) CatalogImages(cmd *cobra.Command, args []string) {
@@ -392,7 +392,7 @@ func (util *ImageUtil) CatalogImages(cmd *cobra.Command, args []string) {
func (util *ImageUtil) catalogImages(common *CommonImageParams, params *CatalogImagesParams) (*CatalogImagesResult, error) { func (util *ImageUtil) catalogImages(common *CommonImageParams, params *CatalogImagesParams) (*CatalogImagesResult, error) {
var err error var err error
res := &CatalogImagesResult{ res := &CatalogImagesResult{
CatalogImages: make([]string, 0), Repositories: make([]string, 0),
} }
ctx := context.Background() ctx := context.Background()
@@ -408,6 +408,6 @@ func (util *ImageUtil) catalogImages(common *CommonImageParams, params *CatalogI
if err != nil { if err != nil {
return res, err return res, err
} }
res.CatalogImages = opres res.Repositories = opres
return res, err return res, err
} }