-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(argocd client): Add handling of argocd-api-plaintext option #274
Conversation
f0a27ae
to
81b1b2a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@grzesuav can you rrun the earthy so the doc will be updated to include the new parameters?
81b1b2a
to
538c98d
Compare
fixes zapier#168 Signed-off-by: Grzegorz Głąb <grzesuav@gmail.com>
Mergecat's ReviewClick to read mergecats review!😼 Mergecat review of pkg/config/config_test.go@@ -16,13 +16,15 @@ 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")
cfg, err := NewWithViper(v)
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)
} Feedback & Suggestions:
😼 Mergecat review of 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"` Feedback & Suggestions:
😼 Mergecat review of 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(). Feedback & Suggestions:
😼 Mergecat review of docs/usage.md@@ -36,8 +36,9 @@ The full list of supported environment variables is described below:
|Env Var|Description|Default Value|
|-----------|-------------|------|
-|`KUBECHECKS_ARGOCD_API_INSECURE`|Enable to use insecure connections to the ArgoCD API server.|`false`|
+|`KUBECHECKS_ARGOCD_API_INSECURE`|Enable to use insecure connections over TLS to the ArgoCD API server.|`false`|
|`KUBECHECKS_ARGOCD_API_NAMESPACE`|ArgoCD namespace where the application watcher will read Custom Resource Definitions (CRD) for Application and ApplicationSet resources.|`argocd`|
+|`KUBECHECKS_ARGOCD_API_PLAINTEXT`|Enable to use plaintext connections without TLS.|`false`|
|`KUBECHECKS_ARGOCD_API_SERVER_ADDR`|ArgoCD API Server Address.|`argocd-server`|
|`KUBECHECKS_ARGOCD_API_TOKEN`|ArgoCD API token.||
|`KUBECHECKS_ENABLE_CONFTEST`|Set to true to enable conftest policy checking of manifests.|`false`| Feedback & Suggestions:
😼 Mergecat review of 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 plaintext connections without TLS.")
stringFlag(flags, "kubernetes-type", "Kubernetes Type One of eks, or local. Defaults to local.",
newStringOpts().
withChoices("eks", "local"). Feedback & Suggestions:
Dependency ReviewClick to read mergecats review!No suggestions found |
@Greyeye done, thanks for pointer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
fixes #168