refactor: tidy up a little
This commit is contained in:
@ -3,6 +3,7 @@ package client
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"strings"
|
||||
|
||||
"coopcloud.tech/abra/pkg/i18n"
|
||||
"github.com/docker/docker/api/types/filters"
|
||||
@ -37,3 +38,11 @@ func RemoveConfigs(cl *client.Client, ctx context.Context, configNames []string,
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func GetConfigNameAndVersion(fullName string, stackName string) (string, string) {
|
||||
name := strings.TrimPrefix(fullName, stackName + "_")
|
||||
if lastUnderscore := strings.LastIndex(name, "_"); lastUnderscore != -1 {
|
||||
return name[0:lastUnderscore], name[lastUnderscore+1:]
|
||||
}
|
||||
return name, ""
|
||||
}
|
||||
|
Reference in New Issue
Block a user