Skip to content

Commit

Permalink
fixes from comments
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
  • Loading branch information
crenshaw-dev committed Aug 22, 2023
1 parent 3e619e3 commit feccd26
Show file tree
Hide file tree
Showing 154 changed files with 171 additions and 170 deletions.
6 changes: 3 additions & 3 deletions cmd/argocd/commands/admin/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ type ClusterWithInfo struct {
Namespaces []string
}

func loadClusters(ctx context.Context, kubeClient *kubernetes.Clientset, appClient *versioned.Clientset, replicas int, namespace string, portForwardRedis bool, cacheSrc func() (*appstatecache.Cache, error), shard int, redisName string, redisHaHaproxyName string) ([]ClusterWithInfo, error) {
func loadClusters(ctx context.Context, kubeClient *kubernetes.Clientset, appClient *versioned.Clientset, replicas int, namespace string, portForwardRedis bool, cacheSrc func() (*appstatecache.Cache, error), shard int, redisName string, redisHaProxyName string) ([]ClusterWithInfo, error) {
settingsMgr := settings.NewSettingsManager(ctx, kubeClient, namespace)

argoDB := db.NewDB(namespace, settingsMgr, kubeClient)
Expand All @@ -80,10 +80,10 @@ func loadClusters(ctx context.Context, kubeClient *kubernetes.Clientset, appClie
var cache *appstatecache.Cache
if portForwardRedis {
overrides := clientcmd.ConfigOverrides{}
redisHaHaproxyPodLabelSelector := common.LabelKeyAppName + "=" + redisHaHaproxyName
redisHaProxyPodLabelSelector := common.LabelKeyAppName + "=" + redisHaProxyName
redisPodLabelSelector := common.LabelKeyAppName + "=" + redisName
port, err := kubeutil.PortForward(6379, namespace, &overrides,
redisHaHaproxyPodLabelSelector, redisPodLabelSelector)
redisHaProxyPodLabelSelector, redisPodLabelSelector)
if err != nil {
return nil, err
}
Expand Down
22 changes: 11 additions & 11 deletions cmd/argocd/commands/headless/headless.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,25 @@ import (
)

type forwardCacheClient struct {
namespace string
context string
init sync.Once
client cache.CacheClient
compression cache.RedisCompressionType
err error
redisHaHaProxyName string
redisName string
namespace string
context string
init sync.Once
client cache.CacheClient
compression cache.RedisCompressionType
err error
redisHaProxyName string
redisName string
}

func (c *forwardCacheClient) doLazy(action func(client cache.CacheClient) error) error {
c.init.Do(func() {
overrides := clientcmd.ConfigOverrides{
CurrentContext: c.context,
}
redisHaHaproxyPodLabelSelector := common.LabelKeyAppName + "=" + c.redisHaHaProxyName
redisHaProxyPodLabelSelector := common.LabelKeyAppName + "=" + c.redisHaProxyName
redisPodLabelSelector := common.LabelKeyAppName + "=" + c.redisName
redisPort, err := kubeutil.PortForward(6379, c.namespace, &overrides,
redisHaHaproxyPodLabelSelector, redisPodLabelSelector)
redisHaProxyPodLabelSelector, redisPodLabelSelector)
if err != nil {
c.err = err
return
Expand Down Expand Up @@ -208,7 +208,7 @@ func StartLocalServer(ctx context.Context, clientOpts *apiclient.ClientOptions,
if err != nil {
return fmt.Errorf("error running miniredis: %w", err)
}
appstateCache := appstatecache.NewCache(cache.NewCache(&forwardCacheClient{namespace: namespace, context: ctxStr, compression: compression, redisHaHaProxyName: clientOpts.RedisHaProxyName, redisName: clientOpts.RedisName}), time.Hour)
appstateCache := appstatecache.NewCache(cache.NewCache(&forwardCacheClient{namespace: namespace, context: ctxStr, compression: compression, redisHaProxyName: clientOpts.RedisHaProxyName, redisName: clientOpts.RedisName}), time.Hour)
srv := server.NewServer(ctx, server.ArgoCDServerOpts{
EnableGZip: false,
Namespace: namespace,
Expand Down
2 changes: 1 addition & 1 deletion cmd/argocd/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func NewCommand() *cobra.Command {
command.PersistentFlags().BoolVar(&clientOpts.Core, "core", false, "If set to true then CLI talks directly to Kubernetes instead of talking to Argo CD API server")
command.PersistentFlags().StringVar(&clientOpts.ServerName, "server-name", env.StringFromEnv(common.EnvServerName, common.DefaultServerName), fmt.Sprintf("Name of the Argo CD API server; set this or %s when the server's name label differs from the default, for example when installing via the Helm chart", common.EnvServerName))
command.PersistentFlags().StringVar(&clientOpts.AppControllerName, "controller-name", env.StringFromEnv(common.EnvAppControllerName, common.DefaultApplicationControllerName), fmt.Sprintf("Name of the Argo CD Application controller; set this or %s when the controller's name label differs from the default, for example when installing via the Helm chart", common.EnvAppControllerName))
command.PersistentFlags().StringVar(&clientOpts.RedisHaProxyName, "redis-ha-haproxy-name", env.StringFromEnv(common.EnvRedisHaHaproxyName, common.DefaultRedisHaHaproxyName), fmt.Sprintf("Name of the Redis HA Proxy; set this or %s when the HA Proxy's name label differs from the default, for example when installing via the Helm chart", common.EnvRedisHaHaproxyName))
command.PersistentFlags().StringVar(&clientOpts.RedisHaProxyName, "redis-haproxy-name", env.StringFromEnv(common.EnvRedisHaProxyName, common.DefaultRedisHaProxyName), fmt.Sprintf("Name of the Redis HA Proxy; set this or %s when the HA Proxy's name label differs from the default, for example when installing via the Helm chart", common.EnvRedisHaProxyName))
command.PersistentFlags().StringVar(&clientOpts.RedisName, "redis-name", env.StringFromEnv(common.EnvRedisName, common.DefaultRedisName), fmt.Sprintf("Name of the Redis deployment; set this or %s when the Redis's name label differs from the default, for example when installing via the Helm chart", common.EnvRedisName))
command.PersistentFlags().StringVar(&clientOpts.RepoServerName, "repo-server-name", env.StringFromEnv(common.EnvRepoServerName, common.DefaultRepoServerName), fmt.Sprintf("Name of the Argo CD Repo server; set this or %s when the server's name label differs from the default, for example when installing via the Helm chart", common.EnvRepoServerName))

Expand Down
11 changes: 6 additions & 5 deletions common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ const (
// LabelKeyAppInstance is the label key to use to uniquely identify the instance of an application
// The Argo CD application name is used as the instance name
LabelKeyAppInstance = "app.kubernetes.io/instance"
// LabelKeyAppName is the name of the Kubernetes application
// LabelKeyAppName is the label key to use to uniquely identify the name of the Kubernetes application
LabelKeyAppName = "app.kubernetes.io/name"
// LabelKeyLegacyApplicationName is the legacy label (v0.10 and below) and is superseded by 'app.kubernetes.io/instance'
LabelKeyLegacyApplicationName = "applications.argoproj.io/app-name"
Expand Down Expand Up @@ -243,8 +243,8 @@ const (
EnvAppControllerName = "ARGOCD_APPLICATION_CONTROLLER_NAME"
// EnvRedisName is the pod selector labels of the Argo CD redis component.
EnvRedisName = "ARGOCD_REDIS_NAME"
// EnvRedisHaHaproxyName is the pod selector labels of the Argo CD Redis HA proxy component.
EnvRedisHaHaproxyName = "ARGOCD_REDIS_HAPROXY_NAME"
// EnvRedisHaProxyName is the pod selector labels of the Argo CD Redis HA proxy component.
EnvRedisHaProxyName = "ARGOCD_REDIS_HAPROXY_NAME"
)

// Config Management Plugin related constants
Expand Down Expand Up @@ -280,13 +280,14 @@ const (
DefaultGitRetryFactor = int64(2)
)

// Constants represent the pod selector labels of the ArgoCD component names
// Constants represent the pod selector labels of the Argo CD component names. These values are determined by the
// installation manifests.
const (
DefaultServerName = "argocd-server"
DefaultRepoServerName = "argocd-repo-server"
DefaultApplicationControllerName = "argocd-application-controller"
DefaultRedisName = "argocd-redis"
DefaultRedisHaHaproxyName = "argocd-redis-ha-haproxy"
DefaultRedisHaProxyName = "argocd-redis-ha-haproxy"
)

// GetGnuPGHomePath retrieves the path to use for GnuPG home directory, which is either taken from GNUPGHOME environment or a default value
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/commands/argocd.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ argocd [flags]
--plaintext Disable TLS
--port-forward Connect to a random argocd-server port using port forwarding
--port-forward-namespace string Namespace name which should be used for port forwarding
--redis-ha-haproxy-name string Name of the Redis HA Proxy; set this or ARGOCD_REDIS_HAPROXY_NAME when the HA Proxy's name label differs from the default, for example when installing via the Helm chart (default "argocd-redis-ha-haproxy")
--redis-haproxy-name string Name of the Redis HA Proxy; set this or ARGOCD_REDIS_HAPROXY_NAME when the HA Proxy's name label differs from the default, for example when installing via the Helm chart (default "argocd-redis-ha-haproxy")
--redis-name string Name of the Redis deployment; set this or ARGOCD_REDIS_NAME when the Redis's name label differs from the default, for example when installing via the Helm chart (default "argocd-redis")
--repo-server-name string Name of the Argo CD Repo server; set this or ARGOCD_REPO_SERVER_NAME when the server's name label differs from the default, for example when installing via the Helm chart (default "argocd-repo-server")
--server string Argo CD server address
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/commands/argocd_account.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ argocd account [flags]
--plaintext Disable TLS
--port-forward Connect to a random argocd-server port using port forwarding
--port-forward-namespace string Namespace name which should be used for port forwarding
--redis-ha-haproxy-name string Name of the Redis HA Proxy; set this or ARGOCD_REDIS_HAPROXY_NAME when the HA Proxy's name label differs from the default, for example when installing via the Helm chart (default "argocd-redis-ha-haproxy")
--redis-haproxy-name string Name of the Redis HA Proxy; set this or ARGOCD_REDIS_HAPROXY_NAME when the HA Proxy's name label differs from the default, for example when installing via the Helm chart (default "argocd-redis-ha-haproxy")
--redis-name string Name of the Redis deployment; set this or ARGOCD_REDIS_NAME when the Redis's name label differs from the default, for example when installing via the Helm chart (default "argocd-redis")
--repo-server-name string Name of the Argo CD Repo server; set this or ARGOCD_REPO_SERVER_NAME when the server's name label differs from the default, for example when installing via the Helm chart (default "argocd-repo-server")
--server string Argo CD server address
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/commands/argocd_account_bcrypt.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ argocd account bcrypt [flags]
--plaintext Disable TLS
--port-forward Connect to a random argocd-server port using port forwarding
--port-forward-namespace string Namespace name which should be used for port forwarding
--redis-ha-haproxy-name string Name of the Redis HA Proxy; set this or ARGOCD_REDIS_HAPROXY_NAME when the HA Proxy's name label differs from the default, for example when installing via the Helm chart (default "argocd-redis-ha-haproxy")
--redis-haproxy-name string Name of the Redis HA Proxy; set this or ARGOCD_REDIS_HAPROXY_NAME when the HA Proxy's name label differs from the default, for example when installing via the Helm chart (default "argocd-redis-ha-haproxy")
--redis-name string Name of the Redis deployment; set this or ARGOCD_REDIS_NAME when the Redis's name label differs from the default, for example when installing via the Helm chart (default "argocd-redis")
--repo-server-name string Name of the Argo CD Repo server; set this or ARGOCD_REPO_SERVER_NAME when the server's name label differs from the default, for example when installing via the Helm chart (default "argocd-repo-server")
--server string Argo CD server address
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/commands/argocd_account_can-i.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Resources: [clusters projects applications applicationsets repositories certific
--plaintext Disable TLS
--port-forward Connect to a random argocd-server port using port forwarding
--port-forward-namespace string Namespace name which should be used for port forwarding
--redis-ha-haproxy-name string Name of the Redis HA Proxy; set this or ARGOCD_REDIS_HAPROXY_NAME when the HA Proxy's name label differs from the default, for example when installing via the Helm chart (default "argocd-redis-ha-haproxy")
--redis-haproxy-name string Name of the Redis HA Proxy; set this or ARGOCD_REDIS_HAPROXY_NAME when the HA Proxy's name label differs from the default, for example when installing via the Helm chart (default "argocd-redis-ha-haproxy")
--redis-name string Name of the Redis deployment; set this or ARGOCD_REDIS_NAME when the Redis's name label differs from the default, for example when installing via the Helm chart (default "argocd-redis")
--repo-server-name string Name of the Argo CD Repo server; set this or ARGOCD_REPO_SERVER_NAME when the server's name label differs from the default, for example when installing via the Helm chart (default "argocd-repo-server")
--server string Argo CD server address
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/commands/argocd_account_delete-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ argocd account delete-token --account <account-name> ID
--plaintext Disable TLS
--port-forward Connect to a random argocd-server port using port forwarding
--port-forward-namespace string Namespace name which should be used for port forwarding
--redis-ha-haproxy-name string Name of the Redis HA Proxy; set this or ARGOCD_REDIS_HAPROXY_NAME when the HA Proxy's name label differs from the default, for example when installing via the Helm chart (default "argocd-redis-ha-haproxy")
--redis-haproxy-name string Name of the Redis HA Proxy; set this or ARGOCD_REDIS_HAPROXY_NAME when the HA Proxy's name label differs from the default, for example when installing via the Helm chart (default "argocd-redis-ha-haproxy")
--redis-name string Name of the Redis deployment; set this or ARGOCD_REDIS_NAME when the Redis's name label differs from the default, for example when installing via the Helm chart (default "argocd-redis")
--repo-server-name string Name of the Argo CD Repo server; set this or ARGOCD_REPO_SERVER_NAME when the server's name label differs from the default, for example when installing via the Helm chart (default "argocd-repo-server")
--server string Argo CD server address
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/commands/argocd_account_generate-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ argocd account generate-token --account <account-name>
--plaintext Disable TLS
--port-forward Connect to a random argocd-server port using port forwarding
--port-forward-namespace string Namespace name which should be used for port forwarding
--redis-ha-haproxy-name string Name of the Redis HA Proxy; set this or ARGOCD_REDIS_HAPROXY_NAME when the HA Proxy's name label differs from the default, for example when installing via the Helm chart (default "argocd-redis-ha-haproxy")
--redis-haproxy-name string Name of the Redis HA Proxy; set this or ARGOCD_REDIS_HAPROXY_NAME when the HA Proxy's name label differs from the default, for example when installing via the Helm chart (default "argocd-redis-ha-haproxy")
--redis-name string Name of the Redis deployment; set this or ARGOCD_REDIS_NAME when the Redis's name label differs from the default, for example when installing via the Helm chart (default "argocd-redis")
--repo-server-name string Name of the Argo CD Repo server; set this or ARGOCD_REPO_SERVER_NAME when the server's name label differs from the default, for example when installing via the Helm chart (default "argocd-repo-server")
--server string Argo CD server address
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/commands/argocd_account_get-user-info.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ argocd account get-user-info [flags]
--plaintext Disable TLS
--port-forward Connect to a random argocd-server port using port forwarding
--port-forward-namespace string Namespace name which should be used for port forwarding
--redis-ha-haproxy-name string Name of the Redis HA Proxy; set this or ARGOCD_REDIS_HAPROXY_NAME when the HA Proxy's name label differs from the default, for example when installing via the Helm chart (default "argocd-redis-ha-haproxy")
--redis-haproxy-name string Name of the Redis HA Proxy; set this or ARGOCD_REDIS_HAPROXY_NAME when the HA Proxy's name label differs from the default, for example when installing via the Helm chart (default "argocd-redis-ha-haproxy")
--redis-name string Name of the Redis deployment; set this or ARGOCD_REDIS_NAME when the Redis's name label differs from the default, for example when installing via the Helm chart (default "argocd-redis")
--repo-server-name string Name of the Argo CD Repo server; set this or ARGOCD_REPO_SERVER_NAME when the server's name label differs from the default, for example when installing via the Helm chart (default "argocd-repo-server")
--server string Argo CD server address
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/commands/argocd_account_get.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ argocd account get --account <account-name>
--plaintext Disable TLS
--port-forward Connect to a random argocd-server port using port forwarding
--port-forward-namespace string Namespace name which should be used for port forwarding
--redis-ha-haproxy-name string Name of the Redis HA Proxy; set this or ARGOCD_REDIS_HAPROXY_NAME when the HA Proxy's name label differs from the default, for example when installing via the Helm chart (default "argocd-redis-ha-haproxy")
--redis-haproxy-name string Name of the Redis HA Proxy; set this or ARGOCD_REDIS_HAPROXY_NAME when the HA Proxy's name label differs from the default, for example when installing via the Helm chart (default "argocd-redis-ha-haproxy")
--redis-name string Name of the Redis deployment; set this or ARGOCD_REDIS_NAME when the Redis's name label differs from the default, for example when installing via the Helm chart (default "argocd-redis")
--repo-server-name string Name of the Argo CD Repo server; set this or ARGOCD_REPO_SERVER_NAME when the server's name label differs from the default, for example when installing via the Helm chart (default "argocd-repo-server")
--server string Argo CD server address
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/commands/argocd_account_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ argocd account list
--plaintext Disable TLS
--port-forward Connect to a random argocd-server port using port forwarding
--port-forward-namespace string Namespace name which should be used for port forwarding
--redis-ha-haproxy-name string Name of the Redis HA Proxy; set this or ARGOCD_REDIS_HAPROXY_NAME when the HA Proxy's name label differs from the default, for example when installing via the Helm chart (default "argocd-redis-ha-haproxy")
--redis-haproxy-name string Name of the Redis HA Proxy; set this or ARGOCD_REDIS_HAPROXY_NAME when the HA Proxy's name label differs from the default, for example when installing via the Helm chart (default "argocd-redis-ha-haproxy")
--redis-name string Name of the Redis deployment; set this or ARGOCD_REDIS_NAME when the Redis's name label differs from the default, for example when installing via the Helm chart (default "argocd-redis")
--repo-server-name string Name of the Argo CD Repo server; set this or ARGOCD_REPO_SERVER_NAME when the server's name label differs from the default, for example when installing via the Helm chart (default "argocd-repo-server")
--server string Argo CD server address
Expand Down
Loading

0 comments on commit feccd26

Please sign in to comment.