Skip to content

Commit

Permalink
argocd_project: fix roles updates for newly added roles (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
oboukili committed Jan 27, 2021
1 parent 5dc7a8c commit 5fb1481
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions argocd/resource_argocd_project.go
Expand Up @@ -148,6 +148,13 @@ func resourceArgoCDProjectUpdate(d *schema.ResourceData, meta interface{}) error
for _, r := range roles {
pr, i, err := p.GetRoleByName(r.Name)
if err != nil {
switch i {
default:
// i == -1 means the role does not exist
// and was recently added within Terraform tf files
case -1:
continue
}
return err
}
projectRequest.Project.Spec.Roles[i].JWTTokens = pr.JWTTokens
Expand Down

0 comments on commit 5fb1481

Please sign in to comment.