Skip to content

Commit

Permalink
fix import checks
Browse files Browse the repository at this point in the history
  • Loading branch information
manicminer committed May 15, 2024
1 parent a195473 commit 348f48a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,11 @@ func (r PimActiveRoleAssignmentResource) Create() sdk.ResourceFunc {

id := parse.NewPimRoleAssignmentID(config.Scope, config.RoleDefinitionId, config.PrincipalId)

if schedule, err := findRoleAssignmentSchedule(ctx, schedulesClient, id); err != nil && schedule != nil {
schedule, err := findRoleAssignmentSchedule(ctx, schedulesClient, id)
if err != nil {
return err
}
if schedule != nil {
return metadata.ResourceRequiresImport(r.ResourceType(), id)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,11 @@ func (r PimEligibleRoleAssignmentResource) Create() sdk.ResourceFunc {

id := parse.NewPimRoleAssignmentID(config.Scope, config.RoleDefinitionId, config.PrincipalId)

if schedule, err := findRoleEligibilitySchedule(ctx, schedulesClient, id); err != nil && schedule != nil {
schedule, err := findRoleEligibilitySchedule(ctx, schedulesClient, id)
if err != nil {
return err
}
if schedule != nil {
return metadata.ResourceRequiresImport(r.ResourceType(), id)
}

Expand Down

0 comments on commit 348f48a

Please sign in to comment.