BonnyPlug.AdmissionReview.Request.check_immutable

You're seeing just the function check_immutable, go back to BonnyPlug.AdmissionReview.Request module for more information.
Link to this function

check_immutable(admission_review, field)

View Source

Specs

Verifies that a given field has not been mutated.

Examples

iex> admission_review = %BonnyPlug.AdmissionReview{request: %{"object" => %{"spec" => %{"immutable" => "value"}}, "oldObject" => %{"spec" => %{"immutable" => "value"}}}, response: %{}}
...> BonnyPlug.AdmissionReview.Request.check_immutable(admission_review, ["spec", "immutable"])
%BonnyPlug.AdmissionReview{request: %{"object" => %{"spec" => %{"immutable" => "value"}}, "oldObject" => %{"spec" => %{"immutable" => "value"}}}, response: %{}}

iex> admission_review = %BonnyPlug.AdmissionReview{request: %{"object" => %{"spec" => %{"immutable" => "new_value"}}, "oldObject" => %{"spec" => %{"immutable" => "value"}}}, response: %{}}
...> BonnyPlug.AdmissionReview.Request.check_immutable(admission_review, ["spec", "immutable"])
%BonnyPlug.AdmissionReview{request: %{"object" => %{"spec" => %{"immutable" => "new_value"}}, "oldObject" => %{"spec" => %{"immutable" => "value"}}}, response: %{"allowed" => false, "status" => %{"code" => 400, "message" => "The field .spec.immutable is immutable."}}}