Skip to content

Commit

Permalink
feat: enable update tag update (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
CorrectRoadH authored Mar 13, 2024
1 parent a544d2c commit 84f7ad8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions route/v2/appstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/IceWhaleTech/CasaOS-AppManagement/codegen"
"github.com/IceWhaleTech/CasaOS-AppManagement/common"
"github.com/IceWhaleTech/CasaOS-AppManagement/pkg/config"
"github.com/IceWhaleTech/CasaOS-AppManagement/pkg/docker"
"github.com/IceWhaleTech/CasaOS-AppManagement/service"
"github.com/IceWhaleTech/CasaOS-Common/utils"
"github.com/IceWhaleTech/CasaOS-Common/utils/logger"
Expand Down Expand Up @@ -206,12 +207,11 @@ func (a *AppManagement) ComposeAppStableTag(ctx echo.Context, id codegen.StoreAp
for key, app := range *storeInfo.Apps {
if key == *storeInfo.Main {
// spilt by : ; example: linuxserver/jellyfin:10.8.13
// get the last one
tag := strings.Split(app.Image, ":")
_, tag := docker.ExtractImageAndTag(app.Image)

return ctx.JSON(http.StatusOK, codegen.ComposeAppStoreTagOK{
Data: &codegen.ComposeAppStoreTag{
Tag: tag[len(tag)-1],
Tag: tag,
},
})

Expand Down
6 changes: 4 additions & 2 deletions service/compose_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,10 @@ func (a *ComposeApp) IsUpdateAvailableWith(storeComposeApp *ComposeApp) bool {
mainAppImage, mainAppTag := docker.ExtractImageAndTag(mainApp.Image)

if mainAppTag == "latest" {
logger.Info("main app image tag is latest, thus no update available", zap.String("image", mainApp.Image))
return false
// logger.Info("main app image tag is latest, thus no update available", zap.String("image", mainApp.Image))
// return false
logger.Info("main app is latest, update to latest")
return true
}

storeMainApp := storeComposeApp.App(mainAppName)
Expand Down

0 comments on commit 84f7ad8

Please sign in to comment.