Skip to content

Commit

Permalink
feat: move to case as per ci feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
logan-bobo committed Jan 25, 2024
1 parent b1afea7 commit c0625e0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions internal/services/authorization/role_assignment_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,14 @@ func resourceArmRoleAssignmentCreate(d *pluginsdk.ResourceData, meta interface{}
condition := d.Get("condition").(string)
conditionVersion := d.Get("condition_version").(string)

if condition != "" && conditionVersion != "" {
switch {
case condition != "" && conditionVersion != "":
properties.RoleAssignmentProperties.Condition = utils.String(condition)
properties.RoleAssignmentProperties.ConditionVersion = utils.String(conditionVersion)
} else if condition != "" && conditionVersion == "" {
case condition != "" && conditionVersion == "":
properties.RoleAssignmentProperties.Condition = utils.String(condition)
properties.RoleAssignmentProperties.ConditionVersion = utils.String("2.0")
} else if condition == "" && conditionVersion != "" {
case condition == "" && conditionVersion != "":
return fmt.Errorf("`conditionVersion` should not be set without `condition`")
}

Expand Down

0 comments on commit c0625e0

Please sign in to comment.