Skip to content

Commit ba26a1b

Browse files
authored
Merge pull request #12 from jetstack/fix_jwks_sa_update
Fix updating JWKS service accounts
2 parents bbdf92f + 7f3c7ed commit ba26a1b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

internal/provider/service_account_resource.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,13 @@ func (r *serviceAccountResource) Update(ctx context.Context, req resource.Update
258258
return
259259
}
260260
serviceAccount.JwksURI = plan.JwksURI.ValueString()
261-
serviceAccount.IssuerURL = plan.IssuerURL.ValueString()
261+
if state.IssuerURL.ValueString() != plan.IssuerURL.ValueString() {
262+
serviceAccount.IssuerURL = plan.IssuerURL.ValueString()
263+
}
262264
serviceAccount.Audience = plan.Audience.ValueString()
263-
serviceAccount.Subject = plan.Subject.ValueString()
265+
if state.Subject.ValueString() != plan.Subject.ValueString() {
266+
serviceAccount.Subject = plan.Subject.ValueString()
267+
}
264268
serviceAccount.AuthenticationType = "rsaKeyFederated"
265269

266270
apps := []string{}

0 commit comments

Comments
 (0)