mirror of
https://github.com/hanzoai/deploy.git
synced 2026-10-07 08:44:50 +00:00
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: crenshaw-dev <[email protected]>
21 lines
465 B
Go
21 lines
465 B
Go
package plugin
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/argoproj/argo-cd/v3/common"
|
|
)
|
|
|
|
// ParseSecretKey retrieves secret appSetName if different from common ArgoCDSecretName.
|
|
func ParseSecretKey(key string) (secretName string, tokenKey string) {
|
|
if strings.Contains(key, ":") {
|
|
parts := strings.Split(key, ":")
|
|
secretName = parts[0][1:]
|
|
tokenKey = "$" + parts[1]
|
|
} else {
|
|
secretName = common.ArgoCDSecretName
|
|
tokenKey = key
|
|
}
|
|
return secretName, tokenKey
|
|
}
|