-
Notifications
You must be signed in to change notification settings - Fork 106
argocd_repository_credentials: ID is set to URL instead of ID #815
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't workingon-holdIssues or Pull Requests with this label will never be considered staleIssues or Pull Requests with this label will never be considered staleupstream-dependencyIssue depends on changes being made to upstream dependencies (e.g. `argoproj/argo-cd`)Issue depends on changes being made to upstream dependencies (e.g. `argoproj/argo-cd`)
Description
When creating an argocd_repository_credentials resource, there's no way to give it a proper name, which means Argo will create a secret called something like creds-012345678. Furthermore, the argocd_repository_credentials doesn't expose this generated name anywhere. The actual id field is set to URL instead.
This makes it hard to use the credentials with for instance the pull_request generator in an ApplicationSet, because it requires the actual name of the secret.
This can probably be solved in one of two ways:
- Let the user provide a well defined name for the
argocd_repository_credentialsresource; or - Return the generated id/name instead of the URL.
Terraform Version, ArgoCD Provider Version and ArgoCD Version
Terraform version: 1.11.3
ArgoCD provider version: 7.12.5
ArgoCD version: 3.3.0
Affected Resource(s)
- argocd_repository_credentials
Terraform Configuration Files
resource "argocd_repository_credentials" "gh-creds-platform-engineering" {
url = "https://acme.ghe.com/platform-engineering/"
githubapp_id = "1234"
githubapp_installation_id = "5678"
githubapp_enterprise_base_url = "https://acme.ghe.com/api/v3"
githubapp_private_key = jsondecode(data.aws_secretsmanager_secret_version.argocd_repo_creds.secret_string)["githubAppPrivateKey"]
}
# Inside argocd_application_set:
generator {
pull_request {
requeue_after_seconds = 120
github {
api = "https://api.acme.ghe.com"
owner = "platform-engineering"
repo = "backstage"
app_secret_name = "creds-152247523" # Need to hardcode secret reference here, because there's no way to get the correct ID (`argocd_repository_credentials.gh-creds-platform-engineering.id` returns `https://acme.ghe.com/platform-engineering/`)
}
}
}Steps to Reproduce
- Create an
argocd_repository_credentialslike above - Try to get the
idfrom the resource, likeargocd_repository_credentials.my_repo_creds.id
Expected Behavior
The id/name of the resource should be returned, e.g. creds-152247523.
Actual Behavior
The URL is returned instead, e.g. https://acme.ghe.com/platform-engineering/.
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingon-holdIssues or Pull Requests with this label will never be considered staleIssues or Pull Requests with this label will never be considered staleupstream-dependencyIssue depends on changes being made to upstream dependencies (e.g. `argoproj/argo-cd`)Issue depends on changes being made to upstream dependencies (e.g. `argoproj/argo-cd`)