feat: show proposed secret version changes during deploy

This commit is contained in:
3wc
2025-09-09 17:34:06 -04:00
parent 07cafd371c
commit c67fc57902
6 changed files with 94 additions and 29 deletions

View File

@ -3,7 +3,6 @@ package client
import (
"context"
"errors"
"strings"
"coopcloud.tech/abra/pkg/i18n"
"github.com/docker/docker/api/types/filters"
@ -38,12 +37,3 @@ func RemoveConfigs(cl *client.Client, ctx context.Context, configNames []string,
}
return nil
}
// GetConfigNameAndVersion parses a full config name like `app_example_com_someconf_v1` to extract name and version, ("someconf", "v1")
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:], nil
}
return "", "", errors.New(i18n.G("can't parse version from config '%s'", fullName))
}