-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Xudong Sun <[email protected]>
- Loading branch information
1 parent
cbf39b4
commit f5ea1ad
Showing
1 changed file
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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@) | ||
{ | ||
|