Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework Update() in apstra/resource_freeform_resource.go #839

Open
chrismarget-j opened this issue Aug 30, 2024 · 0 comments
Open

Rework Update() in apstra/resource_freeform_resource.go #839

chrismarget-j opened this issue Aug 30, 2024 · 0 comments

Comments

@chrismarget-j
Copy link
Collaborator

	// update the assignments if necessary
	if !plan.AssignedTo.Equal(state.AssignedTo) {
		var planAssignments []apstra.ObjectId
		resp.Diagnostics.Append(plan.AssignedTo.ElementsAs(ctx, &planAssignments, false)...)
		if resp.Diagnostics.HasError() {
			return
		}
		
		err = bp.UpdateResourceAssignments(ctx, apstra.ObjectId(plan.Id.ValueString()), planAssignments)
		if err != nil {
			resp.Diagnostics.AddError("error updating Resource Assignments", err.Error())
			return
		}
	}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant