rancher / terraform-provider-rancher2

Terraform Rancher2 provider
https://www.terraform.io/docs/providers/rancher2/
Mozilla Public License 2.0
263 stars 228 forks source link

[SURE-8832] fix: add check for external rules while updating roleTemplate #1389

Closed pratikjagrut closed 2 months ago

pratikjagrut commented 2 months ago

Issue: https://github.com/rancher/terraform-provider-rancher2/issues/1381

Problem

JIRA issue: https://jira.suse.com/browse/SURE-8832 When attempting to update a RoleTemplate using the rancher2 tf provider v4.2.0 you will get the following error:

Error: Bad response statusCode [400]. Status [400 Bad Request]. Body: [baseType=error,
code=BadRequest, message=admission webhook "rancher.cattle.io.roletemplates.management.cattle.io" 
denied the request: ExternalRules can't be set in RoleTemplates with external=false] from 
[https://example.com/v3/roleTemplates/rt-mb28r]

Solution

Testing

Engineering Testing

Manual Testing

The fix was tested using the reproduction steps, and the issue was resolved.

Automated Testing

QA Testing Considerations

Regressions Considerations

matttrach commented 2 months ago

@pratikjagrut would you mind signing your commit? Then I will get this merged into the proper branches.

pratikjagrut commented 2 months ago

@pratikjagrut would you mind signing your commit? Then I will get this merged into the proper branches.

@matttrach I've signed the commit.

matttrach commented 2 months ago

I will backport this to release/v5 and release/v4 in separate PRs.