Skip to content

Commit

Permalink
More
Browse files Browse the repository at this point in the history
Signed-off-by: Xudong Sun <[email protected]>
  • Loading branch information
marshtompsxd committed Feb 17, 2024
1 parent cbf39b4 commit f5ea1ad
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/executable_model/api_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,22 @@ fn valid_transition(obj: &DynamicObject, old_obj: &DynamicObject) -> (ret: bool)
}
}

fn object_transition_validity_check(obj: &DynamicObject, old_obj: &DynamicObject) -> (ret: Option<APIError>)
requires
model::unmarshallable_object::<K::V>(obj@),
model::unmarshallable_object::<K::V>(old_obj@),
[email protected] == [email protected],
model::valid_object::<K::V>(obj@),
model::valid_object::<K::V>(old_obj@),
ensures ret == model::object_transition_validity_check::<K::V>(obj@, old_obj@)
{
if !Self::valid_transition(obj, old_obj) {
Some(APIError::Invalid)
} else {
None
}
}

pub fn handle_get_request(req: &KubeGetRequest, s: &ApiServerState) -> (ret: KubeGetResponse)
ensures ret@ == model::handle_get_request(req@, s@)
{
Expand Down

0 comments on commit f5ea1ad

Please sign in to comment.