mirror of
https://github.com/argoproj/argo-cd
synced 2026-05-24 09:50:08 +00:00
114 lines
4.9 KiB
Go
114 lines
4.9 KiB
Go
package common
|
|
|
|
import (
|
|
rbacv1 "k8s.io/api/rbac/v1"
|
|
|
|
"github.com/argoproj/argo-cd/pkg/apis/application"
|
|
)
|
|
|
|
const (
|
|
// MetadataPrefix is the prefix used for our labels and annotations
|
|
MetadataPrefix = "argocd.argoproj.io"
|
|
|
|
// SecretTypeCluster indicates a secret type of cluster
|
|
SecretTypeCluster = "cluster"
|
|
|
|
// AuthCookieName is the HTTP cookie name where we store our auth token
|
|
AuthCookieName = "argocd.token"
|
|
// ResourcesFinalizerName is a number of application CRD finalizer
|
|
ResourcesFinalizerName = "resources-finalizer." + MetadataPrefix
|
|
|
|
// KubernetesInternalAPIServerAddr is address of the k8s API server when accessing internal to the cluster
|
|
KubernetesInternalAPIServerAddr = "https://kubernetes.default.svc"
|
|
|
|
// ManagedByAnnotation is annotation name which indicates that k8s resource is managed by an application.
|
|
ManagedByAnnotation = "managed-by"
|
|
// ManagedByArgoCDAnnotationValue is a 'managed-by' annotation value for resources managed by Argo CD
|
|
ManagedByArgoCDAnnotationValue = "argocd.argoproj.io"
|
|
)
|
|
|
|
const (
|
|
ArgoCDAdminUsername = "admin"
|
|
ArgoCDSecretName = "argocd-secret"
|
|
ArgoCDConfigMapName = "argocd-cm"
|
|
ArgoCDRBACConfigMapName = "argocd-rbac-cm"
|
|
)
|
|
|
|
const (
|
|
// DexAPIEndpoint is the endpoint where we serve the Dex API server
|
|
DexAPIEndpoint = "/api/dex"
|
|
// LoginEndpoint is Argo CD's shorthand login endpoint which redirects to dex's OAuth 2.0 provider's consent page
|
|
LoginEndpoint = "/auth/login"
|
|
// CallbackEndpoint is Argo CD's final callback endpoint we reach after OAuth 2.0 login flow has been completed
|
|
CallbackEndpoint = "/auth/callback"
|
|
// ArgoCDClientAppName is name of the Oauth client app used when registering our web app to dex
|
|
ArgoCDClientAppName = "Argo CD"
|
|
// ArgoCDClientAppID is the Oauth client ID we will use when registering our app to dex
|
|
ArgoCDClientAppID = "argo-cd"
|
|
// ArgoCDCLIClientAppName is name of the Oauth client app used when registering our CLI to dex
|
|
ArgoCDCLIClientAppName = "Argo CD CLI"
|
|
// ArgoCDCLIClientAppID is the Oauth client ID we will use when registering our CLI to dex
|
|
ArgoCDCLIClientAppID = "argo-cd-cli"
|
|
// EnvVarSSODebug is an environment variable to enable additional OAuth debugging in the API server
|
|
EnvVarSSODebug = "ARGOCD_SSO_DEBUG"
|
|
// EnvVarRBACDebug is an environment variable to enable additional RBAC debugging in the API server
|
|
EnvVarRBACDebug = "ARGOCD_RBAC_DEBUG"
|
|
// DefaultAppProjectName contains name of default app project. The default app project allows deploying application to any cluster.
|
|
DefaultAppProjectName = "default"
|
|
)
|
|
|
|
var (
|
|
// LabelKeyAppInstance refers to the application instance resource name
|
|
LabelKeyAppInstance = MetadataPrefix + "/app-instance"
|
|
|
|
// LabelKeySecretType contains the type of argocd secret (either 'cluster' or 'repo')
|
|
LabelKeySecretType = MetadataPrefix + "/secret-type"
|
|
|
|
// AnnotationConnectionStatus contains connection state status
|
|
AnnotationConnectionStatus = MetadataPrefix + "/connection-status"
|
|
// AnnotationConnectionMessage contains additional information about connection status
|
|
AnnotationConnectionMessage = MetadataPrefix + "/connection-message"
|
|
// AnnotationConnectionModifiedAt contains timestamp when connection state had been modified
|
|
AnnotationConnectionModifiedAt = MetadataPrefix + "/connection-modified-at"
|
|
|
|
// AnnotationHook contains the hook type of a resource
|
|
AnnotationHook = MetadataPrefix + "/hook"
|
|
// AnnotationHookDeletePolicy is the policy of deleting a hook
|
|
AnnotationHookDeletePolicy = MetadataPrefix + "/hook-delete-policy"
|
|
// AnnotationHelmHook is the helm hook annotation
|
|
AnnotationHelmHook = "helm.sh/hook"
|
|
|
|
// HelmHookCRDInstall is a value of crd helm hook
|
|
HelmHookCRDInstall = "crd-install"
|
|
|
|
// LabelKeyApplicationControllerInstanceID is the label which allows to separate application among multiple running application controllers.
|
|
LabelKeyApplicationControllerInstanceID = application.ApplicationFullName + "/controller-instanceid"
|
|
|
|
// LabelApplicationName is the label which indicates that resource belongs to application with the specified name
|
|
LabelApplicationName = application.ApplicationFullName + "/app-name"
|
|
|
|
// AnnotationKeyRefresh is the annotation key in the application which is updated with an
|
|
// arbitrary value (i.e. timestamp) on a git event, to force the controller to wake up and
|
|
// re-evaluate the application
|
|
AnnotationKeyRefresh = application.ApplicationFullName + "/refresh"
|
|
)
|
|
|
|
// ArgoCDManagerServiceAccount is the name of the service account for managing a cluster
|
|
const (
|
|
ArgoCDManagerServiceAccount = "argocd-manager"
|
|
ArgoCDManagerClusterRole = "argocd-manager-role"
|
|
ArgoCDManagerClusterRoleBinding = "argocd-manager-role-binding"
|
|
)
|
|
|
|
// ArgoCDManagerPolicyRules are the policies to give argocd-manager
|
|
var ArgoCDManagerPolicyRules = []rbacv1.PolicyRule{
|
|
{
|
|
APIGroups: []string{"*"},
|
|
Resources: []string{"*"},
|
|
Verbs: []string{"*"},
|
|
},
|
|
{
|
|
NonResourceURLs: []string{"*"},
|
|
Verbs: []string{"*"},
|
|
},
|
|
}
|