Add if statements
@@ -104,13 +104,11 @@ func resourceResourceAuthorizationRead(d *schema.ResourceData, m interface{}) er
}
flattenAuthorizedResource(d, &(*resourceRefs)[0], projectID, definitionID)
- return nil
- }
+ } else {
// flatten structure provided by user-configuration and not read from ado
flattenAuthorizedResource(d, authorizedResource, projectID, definitionID)
- return nil
}
-
+ } else {
resourceRefs, err := clients.BuildClient.GetDefinitionResources(ctx, build.GetDefinitionResourcesArgs{
Project: &projectID,
DefinitionId: &definitionID,
@@ -129,6 +127,8 @@ func resourceResourceAuthorizationRead(d *schema.ResourceData, m interface{}) er
// flatten structure provided by user-configuration and not read from ado
flattenAuthorizedResource(d, authorizedResource, projectID, definitionID)
+ }
+
return nil
}
