github.com/argoproj/argo-cd/v3@v3.2.1/applicationset/services/plugin/utils.go (about)

     1  package plugin
     2  
     3  import (
     4  	"strings"
     5  
     6  	"github.com/argoproj/argo-cd/v3/common"
     7  )
     8  
     9  // ParseSecretKey retrieves secret appSetName if different from common ArgoCDSecretName.
    10  func ParseSecretKey(key string) (secretName string, tokenKey string) {
    11  	if strings.Contains(key, ":") {
    12  		parts := strings.Split(key, ":")
    13  		secretName = parts[0][1:]
    14  		tokenKey = "$" + parts[1]
    15  	} else {
    16  		secretName = common.ArgoCDSecretName
    17  		tokenKey = key
    18  	}
    19  	return secretName, tokenKey
    20  }