diff --git a/cmd/root.go b/cmd/root.go index 7df615a2..e68bd267 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -59,10 +59,11 @@ func init() { stringFlag(flags, "argocd-api-server-addr", "ArgoCD API Server Address.", newStringOpts(). withDefault("argocd-server")) - boolFlag(flags, "argocd-api-insecure", "Enable to use insecure connections to the ArgoCD API server.") + boolFlag(flags, "argocd-api-insecure", "Enable to use insecure connections over TLS to the ArgoCD API server.") stringFlag(flags, "argocd-api-namespace", "ArgoCD namespace where the application watcher will read Custom Resource Definitions (CRD) for Application and ApplicationSet resources.", newStringOpts(). withDefault("argocd")) + boolFlag(flags, "argocd-api-plaintext", "Enable to use connections with TLS disabled") stringFlag(flags, "kubernetes-type", "Kubernetes Type One of eks, or local. Defaults to local.", newStringOpts(). withChoices("eks", "local"). diff --git a/pkg/argo_client/client.go b/pkg/argo_client/client.go index b690dcbf..ac3af7c9 100644 --- a/pkg/argo_client/client.go +++ b/pkg/argo_client/client.go @@ -27,6 +27,7 @@ func NewArgoClient(cfg config.ServerConfig) (*ArgoClient, error) { AuthToken: cfg.ArgoCDToken, GRPCWebRootPath: cfg.ArgoCDPathPrefix, Insecure: cfg.ArgoCDInsecure, + PlainText: cfg.ArgoCDPlainText, } log.Info(). diff --git a/pkg/config/config.go b/pkg/config/config.go index 846419af..8aa7549a 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -22,6 +22,7 @@ type ServerConfig struct { ArgoCDPathPrefix string `mapstructure:"argocd-api-path-prefix"` ArgoCDInsecure bool `mapstructure:"argocd-api-insecure"` ArgoCDNamespace string `mapstructure:"argocd-api-namespace"` + ArgoCDPlainText bool `mapstructure:"argocd-api-plaintext"` KubernetesConfig string `mapstructure:"kubernetes-config"` KubernetesType string `mapstructure:"kubernetes-type"` KubernetesClusterID string `mapstructure:"kubernetes-clusterid"` diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index 88122fa1..2227f484 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -16,6 +16,7 @@ func TestNew(t *testing.T) { v := viper.New() v.Set("log-level", "info") v.Set("argocd-api-insecure", "true") + v.Set("argocd-api-plaintext", "true") v.Set("worst-conftest-state", "warning") v.Set("repo-refresh-interval", "10m") @@ -23,6 +24,7 @@ func TestNew(t *testing.T) { require.NoError(t, err) assert.Equal(t, zerolog.InfoLevel, cfg.LogLevel) assert.Equal(t, true, cfg.ArgoCDInsecure) + assert.Equal(t, true, cfg.ArgoCDPlainText) assert.Equal(t, pkg.StateWarning, cfg.WorstConfTestState, "worst states can be overridden") assert.Equal(t, time.Minute*10, cfg.RepoRefreshInterval) }