Skip to content

Commit

Permalink
Rename EmptyLib
Browse files Browse the repository at this point in the history
Signed-off-by: Wenjie Ma <[email protected]>
  • Loading branch information
euclidgame committed Aug 3, 2023
1 parent 01e59fd commit c7b37f0
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl RabbitmqReconcileState {
pub struct RabbitmqReconciler {}

#[verifier(external)]
impl Reconciler<RabbitmqCluster, RabbitmqReconcileState, EmptyType, EmptyType, EmptyLib> for RabbitmqReconciler {
impl Reconciler<RabbitmqCluster, RabbitmqReconcileState, EmptyType, EmptyType, EmptyAPI> for RabbitmqReconciler {
fn reconcile_init_state(&self) -> RabbitmqReconcileState {
reconcile_init_state()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl SimpleReconcileState {
pub struct SimpleReconciler {}

#[verifier(external)]
impl Reconciler<CustomResource, SimpleReconcileState, EmptyType, EmptyType, EmptyLib> for SimpleReconciler {
impl Reconciler<CustomResource, SimpleReconcileState, EmptyType, EmptyType, EmptyAPI> for SimpleReconciler {
fn reconcile_init_state(&self) -> SimpleReconcileState {
reconcile_init_state()
}
Expand Down
8 changes: 4 additions & 4 deletions src/external_api/exec.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2022 VMware, Inc.
// SPDX-License-Identifier: MIT
use crate::external_api::spec::*;
use crate::external_api::spec::EmptyTypeView;
use crate::pervasive_ext::to_view::*;
use vstd::{prelude::*, view::*};

Expand All @@ -17,10 +17,10 @@ pub trait ExternalAPI<Input: ToView, Output: ToView> {

// An empty library that implements External Library.
// This can be used by those controllers that don't rely on a third-party library.
// Users can define a reconciler as Reconciler<xx, xx, EmptyType, EmptyType, EmptyLib>.
pub struct EmptyLib {}
// Users can define a reconciler as Reconciler<xx, xx, EmptyType, EmptyType, EmptyAPI>.
pub struct EmptyAPI {}

impl ExternalAPI<EmptyType, EmptyType> for EmptyLib {
impl ExternalAPI<EmptyType, EmptyType> for EmptyAPI {
fn transition(input: EmptyType) -> Option<EmptyType> {
Option::None
}
Expand Down
2 changes: 1 addition & 1 deletion src/rabbitmq_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ async fn main() -> Result<()> {
println!("{}", serde_yaml::to_string(&deps_hack::RabbitmqCluster::crd())?);
} else if cmd == String::from("run") {
println!("running rabbitmq-controller");
run_controller::<deps_hack::RabbitmqCluster, RabbitmqCluster, RabbitmqReconciler, RabbitmqReconcileState, EmptyType, EmptyType, EmptyLib>().await?;
run_controller::<deps_hack::RabbitmqCluster, RabbitmqCluster, RabbitmqReconciler, RabbitmqReconcileState, EmptyType, EmptyType, EmptyAPI>().await?;
println!("controller terminated");
} else {
println!("wrong command; please use \"export\" or \"run\"");
Expand Down
2 changes: 1 addition & 1 deletion src/simple_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ async fn main() -> Result<()> {
println!("{}", serde_yaml::to_string(&deps_hack::SimpleCR::crd())?);
} else if cmd == String::from("run") {
println!("running simple-controller");
run_controller::<deps_hack::SimpleCR, CustomResource, SimpleReconciler, SimpleReconcileState, EmptyType, EmptyType, EmptyLib>().await?;
run_controller::<deps_hack::SimpleCR, CustomResource, SimpleReconciler, SimpleReconcileState, EmptyType, EmptyType, EmptyAPI>().await?;
println!("controller terminated");
} else {
println!("wrong command; please use \"export\" or \"run\"");
Expand Down

0 comments on commit c7b37f0

Please sign in to comment.