Skip to main content

seed_active_deadline_seconds

Function seed_active_deadline_seconds 

Source
pub fn seed_active_deadline_seconds(seed: &SeedSpec) -> i64
Expand description

The activeDeadlineSeconds a seeding bootstrap Job gets: the repository’s own spec.seed.failurePolicy.activeDeadlineSeconds, else DEFAULT_SEED_BOOTSTRAP_DEADLINE_SECS.

Pure + shared so the controller (which builds the Job) and any diagnostic explaining a long-running seed agree on the number.

use kopiur_api::seed::{DEFAULT_SEED_BOOTSTRAP_DEADLINE_SECS, seed_active_deadline_seconds};
let mut seed = SeedSpec {
    from,
    sync: None,
    migrate: None,
    allow_empty_source: false,
    failure_policy: None,
    credential_projection: None,
};
assert_eq!(seed_active_deadline_seconds(&seed), DEFAULT_SEED_BOOTSTRAP_DEADLINE_SECS);

seed.failure_policy = Some(FailurePolicy {
    backoff_limit: None,
    active_deadline_seconds: Some(3600),
    pod_startup_deadline_seconds: None,
});
assert_eq!(seed_active_deadline_seconds(&seed), 3600);