terraform-provider-argocd icon indicating copy to clipboard operation
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

Open w4rgrum opened this issue 1 year ago • 12 comments
trafficstars

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 Get as usual first (legacy code)
  • if it fails with a PermissionDenied error (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 the List api, reusing some code used for create cluster existence checks (that already uses this List api). Noe that this code is able to filter the cluster in the resulting list if not yet done by the ArgoCD server (servers filtering on List api 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.

w4rgrum avatar Jun 12 '24 15:06 w4rgrum

@onematchfox PR is ready to be reviewed :)

w4rgrum avatar Jun 13 '24 14:06 w4rgrum

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

morhekil avatar Jun 24 '24 13:06 morhekil

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.

github-actions[bot] avatar Jul 09 '24 12:07 github-actions[bot]

...

onematchfox avatar Jul 10 '24 07:07 onematchfox

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.

github-actions[bot] avatar Jul 25 '24 12:07 github-actions[bot]

...

onematchfox avatar Jul 26 '24 14:07 onematchfox

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.

github-actions[bot] avatar Aug 23 '24 12:08 github-actions[bot]

...

onematchfox avatar Aug 25 '24 12:08 onematchfox

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.

github-actions[bot] avatar Sep 08 '24 12:09 github-actions[bot]

...

onematchfox avatar Sep 09 '24 08:09 onematchfox

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.

github-actions[bot] avatar Sep 23 '24 12:09 github-actions[bot]

.

onematchfox avatar Oct 01 '24 09:10 onematchfox

@onematchfox anything needed from your side?

mkilchhofer avatar Oct 21 '24 09:10 mkilchhofer

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.

the-technat avatar Oct 23 '24 15:10 the-technat