terraform-provider-argocd
terraform-provider-argocd copied to clipboard
fix(argocd_cluster): use cluster list api to avoid 403 issues with cluster get api at cluster read time
This PR fixes https://github.com/argoproj-labs/terraform-provider-argocd/issues/266
Coded it with below comment in mind, meaning it is backward compatible: https://github.com/argoproj-labs/terraform-provider-argocd/issues/266#issuecomment-1739138091
- code does a
Getas usual first (legacy code) - if it fails with a
PermissionDeniederror (i.e.403) the fix is triggered (in a backward compatible way for servers <v2.8, see below) In that case a call is issued to theListapi, reusing some code used for create cluster existence checks (that already uses thisListapi). Noe that this code is able to filter the cluster in the resulting list if not yet done by the ArgoCD server (servers filtering onListapi does not work if <v2.8, see comments in linked issue and/or in the code ccomments)
Also added a non-regression test to validate a server-side deletion of the cluster triggers the fix.
@onematchfox PR is ready to be reviewed :)
any chance to have this released as new version of the provider? This seems to be a blocker when using the provider with recent ArgoCD versions
This pr is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 10 days.
...
This pr is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 10 days.
...
This pr is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 10 days.
...
This pr is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 10 days.
...
This pr is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 10 days.
.
@onematchfox anything needed from your side?
Thanks @w4rgrum for your patience and contributing this!
We will soon release a new version with this fix, but want to wait for #472 before doing so.