mirror of
https://github.com/hanzoai/cd.git
synced 2026-10-30 14:56:45 +00:00
Drops the Argo/ArgoCD prefix from our own const, type and field names (ArgoCDConfigMapName -> ConfigMapName, ArgoCDSettings -> Settings, ArgoCDServer -> Server, HeaderArgoCD* -> HeaderCD*, the argocd-manager RBAC names, the CLI-facing Env* aliases, and the three separately scoped ArgoCDNamespace test/CLI defaults) and reflows the surrounding comments and log/help text from Argo CD to Hanzo CD. Runtime string values are untouched (still hanzocd-*, argo-cd-cli, argo-cd, etc.) — renaming those is a live ConfigMap/Secret/service-name and OAuth-client-ID change that has to land with the manifests and Hanzo IAM/dex registration together, not silently inside a naming pass. argoproj.io, other real upstream API groups, GitHub issue/PR citations, and external URLs are untouched throughout. Verified with go build ./... and go vet ./... (both clean); go test ./util/... ./controller/... ./server/... has the identical 26/26 pre-existing failing packages before and after (root cause: an unrelated redis-removal regression, not this change — see report).
21 lines
444 B
Go
21 lines
444 B
Go
package plugin
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/hanzoai/cd/common"
|
|
)
|
|
|
|
// ParseSecretKey retrieves secret appSetName if different from common SecretName.
|
|
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.SecretName
|
|
tokenKey = key
|
|
}
|
|
return secretName, tokenKey
|
|
}
|