Skip to content

Commit

Permalink
Use operator-rs Duration (#292)
Browse files Browse the repository at this point in the history
  • Loading branch information
Techassi authored Oct 16, 2023
1 parent 8cb5909 commit 53af467
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
5 changes: 3 additions & 2 deletions rust/operator-binary/src/history/history_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use stackable_operator::{
builder::{ConfigMapBuilder, ContainerBuilder, ObjectMetaBuilder, PodBuilder, VolumeBuilder},
cluster_resources::{ClusterResourceApplyStrategy, ClusterResources},
commons::product_image_selection::ResolvedProductImage,
duration::Duration,
k8s_openapi::{
api::{
apps::v1::{StatefulSet, StatefulSetSpec},
Expand Down Expand Up @@ -45,8 +46,8 @@ use stackable_spark_k8s_crd::{
s3logdir::S3LogDir,
tlscerts,
};
use std::collections::HashMap;
use std::{collections::BTreeMap, sync::Arc};
use std::{collections::HashMap, time::Duration};

use snafu::{OptionExt, ResultExt, Snafu};
use stackable_operator::builder::resources::ResourceRequirementsBuilder;
Expand Down Expand Up @@ -283,7 +284,7 @@ pub async fn reconcile(shs: Arc<SparkHistoryServer>, ctx: Arc<Ctx>) -> Result<Ac
}

pub fn error_policy(_obj: Arc<SparkHistoryServer>, _error: &Error, _ctx: Arc<Ctx>) -> Action {
Action::requeue(Duration::from_secs(5))
Action::requeue(*Duration::from_secs(5))
}

fn build_config_map(
Expand Down
6 changes: 3 additions & 3 deletions rust/operator-binary/src/pod_driver_controller.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use stackable_operator::{
client::Client, k8s_openapi::api::core::v1::Pod, kube::runtime::controller::Action,
client::Client, duration::Duration, k8s_openapi::api::core::v1::Pod,
kube::runtime::controller::Action,
};
use stackable_spark_k8s_crd::{
constants::POD_DRIVER_CONTROLLER_NAME, SparkApplication, SparkApplicationStatus,
};
use std::sync::Arc;
use std::time::Duration;

use snafu::{OptionExt, ResultExt, Snafu};
use stackable_operator::logging::controller::ReconcilerError;
Expand Down Expand Up @@ -95,5 +95,5 @@ pub async fn reconcile(pod: Arc<Pod>, client: Arc<Client>) -> Result<Action> {
}

pub fn error_policy(_obj: Arc<Pod>, _error: &Error, _ctx: Arc<Client>) -> Action {
Action::requeue(Duration::from_secs(5))
Action::requeue(*Duration::from_secs(5))
}
5 changes: 2 additions & 3 deletions rust/operator-binary/src/spark_k8s_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ use crate::Ctx;
use std::{
collections::{BTreeMap, HashMap},
sync::Arc,
time::Duration,
vec,
};

use stackable_operator::product_config::writer::to_java_properties_string;
use stackable_operator::{duration::Duration, product_config::writer::to_java_properties_string};
use stackable_spark_k8s_crd::{
constants::*, s3logdir::S3LogDir, tlscerts, RoleConfig, SparkApplication, SparkApplicationRole,
SparkContainer, SubmitConfig,
Expand Down Expand Up @@ -863,5 +862,5 @@ fn security_context() -> PodSecurityContext {
}

pub fn error_policy(_obj: Arc<SparkApplication>, _error: &Error, _ctx: Arc<Ctx>) -> Action {
Action::requeue(Duration::from_secs(5))
Action::requeue(*Duration::from_secs(5))
}

0 comments on commit 53af467

Please sign in to comment.