Show image differences in pre-deploy overview

This commit is contained in:
3wc
2025-09-02 13:48:09 -04:00
parent fb9fdec498
commit 2d6abde85c
3 changed files with 137 additions and 30 deletions

View File

@ -39,10 +39,11 @@ func RemoveConfigs(cl *client.Client, ctx context.Context, configNames []string,
return nil
}
func GetConfigNameAndVersion(fullName string, stackName string) (string, string) {
func GetConfigNameAndVersion(fullName string, stackName string) (string, string, error) {
name := strings.TrimPrefix(fullName, stackName + "_")
if lastUnderscore := strings.LastIndex(name, "_"); lastUnderscore != -1 {
return name[0:lastUnderscore], name[lastUnderscore+1:]
return name[0:lastUnderscore], name[lastUnderscore+1:], nil
} else {
return "", "", errors.New(i18n.G("can't parse version from config '%s'", fullName))
}
return name, ""
}