-
Notifications
You must be signed in to change notification settings - Fork 90
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
"use_local_config": conflicts with auth_token #290
Comments
fwiw removing diff --git a/argocd/provider.go b/argocd/provider.go
index ab2707c..11933a2 100644
--- a/argocd/provider.go
+++ b/argocd/provider.go
@@ -62,7 +62,6 @@ func Provider() *schema.Provider {
"config_path",
"core",
"password",
- "use_local_config",
"username",
},
},
@@ -132,7 +131,6 @@ func Provider() *schema.Provider {
"core",
"username",
"password",
- "auth_token",
},
},
"user_agent": {
@@ -172,7 +170,6 @@ func Provider() *schema.Provider {
Optional: true,
Description: "Use the authentication settings found in the local config file. Useful when you have previously logged in using SSO. Conflicts with `auth_token`, `username` and `password`.",
ConflictsWith: []string{
- "auth_token",
"core",
"password",
"username",
@@ -184,7 +181,6 @@ func Provider() *schema.Provider {
DefaultFunc: schema.EnvDefaultFunc("ARGOCD_CONFIG_PATH", nil),
Description: "Override the default config path of `$HOME/.config/argocd/config`. Only relevant when `use_local_config`. Can be set through the `ARGOCD_CONFIG_PATH` environment variable.",
ConflictsWith: []string{
- "auth_token",
"core",
"password",
"username", |
@sapslaj I agree this behaviour is a bit strange. Unfortunately, Terraform's |
@onematchfox Aww man I forgot about For anyone else who encounters this issue, here's the minimum config that does work: terraform {
required_version = "~> 1.4.5"
required_providers {
argocd = {
source = "oboukili/argocd"
version = "~> 5.4.0"
}
}
}
variable "argocd_use_local_config" {
type = bool
default = null # <- note the `null`
}
provider "argocd" {
use_local_config = var.argocd_use_local_config
}
resource "argocd_cluster" "placeholder" {
config {}
} Setting |
Terraform Version, ArgoCD Provider Version and ArgoCD Version
Affected Resource(s)
Terraform Configuration Files
Debug Output
Panic Output
N/A
Steps to Reproduce
Using above config:
ARGOCD_AUTH_TOKEN
However,
argocd login
ARGOCD_CONTEXT
TF_VAR_argocd_use_local_config="true"
Expected Behavior
Setting
use_local_config = false
should not conflict with using an auth token.Actual Behavior
Two errors:
"auth_token": conflicts with use_local_config
"use_local_config": conflicts with auth_token
Attempting to only use environment variables (e.g. not setting
use_local_config
at all) also results in errors when trying to useARGOCD_CONTEXT
:Important Factoids
For background, I'm attempting to make this provider work both on local machines as well as via CI. CI uses an auth token while local machines can use the Argo CD CLI with
argocd login --sso
. Argo CD is set up with SSO via Okta but there is a non-SSO service account with an API token just for CI. Argo CD is available via VPN on our network so from the provider's perspective the server address is always directly accessible.A workaround is to have a
override.tf
when running locally:This is undesirable because it needs to be done for every instance where the provider is being used.
The provider changes introduced in v5.3.0 / #268 don't appear to be related. The same issue happens on v5.2.0 of the provider.
References
Community Note
The text was updated successfully, but these errors were encountered: