Public release release-ea887c8f56cd
Source commit: ea887c8f56cd53985a1179b13e5f1b85c485f584 Public tree identity: sha256:b96a97aacdbc8fd4fc2ea20d0e1450280d46db3f24aabe1475e5fbe20e05f255
This commit is contained in:
parent
9223c54939
commit
2a0f7ded04
37 changed files with 3145 additions and 628 deletions
|
|
@ -13,7 +13,7 @@ use clusterflux_core::{
|
|||
};
|
||||
use thiserror::Error;
|
||||
|
||||
use crate::{Coordinator, CoordinatorError};
|
||||
use crate::{Coordinator, CoordinatorError, NodeScopeKey};
|
||||
|
||||
mod admin;
|
||||
mod artifacts;
|
||||
|
|
@ -154,8 +154,8 @@ pub enum CoordinatorServiceError {
|
|||
pub struct CoordinatorService {
|
||||
coordinator: Coordinator,
|
||||
store: RuntimeDurableStore,
|
||||
node_descriptors: BTreeMap<NodeId, NodeDescriptor>,
|
||||
node_last_seen_epoch_seconds: BTreeMap<NodeId, u64>,
|
||||
node_descriptors: BTreeMap<NodeScopeKey, NodeDescriptor>,
|
||||
node_last_seen_epoch_seconds: BTreeMap<NodeScopeKey, u64>,
|
||||
node_stale_after_seconds: u64,
|
||||
debug_freeze_timeout: std::time::Duration,
|
||||
enrollment_grants: BTreeMap<EnrollmentGrantKey, clusterflux_core::EnrollmentGrant>,
|
||||
|
|
@ -180,7 +180,7 @@ pub struct CoordinatorService {
|
|||
process_cancellations: BTreeSet<ProcessControlKey>,
|
||||
process_aborts: BTreeSet<ProcessControlKey>,
|
||||
agent_replay_nonces: BTreeMap<(TenantId, ProjectId, AgentId, String), u64>,
|
||||
node_replay_nonces: BTreeMap<(NodeId, String), u64>,
|
||||
node_replay_nonces: BTreeMap<(NodeScopeKey, String), u64>,
|
||||
panel_snapshots: BTreeMap<PanelStopKey, PanelState>,
|
||||
stopped_panels: BTreeSet<PanelStopKey>,
|
||||
panel_event_limits: BTreeMap<(TenantId, ProjectId, ProcessId, String), RateLimit>,
|
||||
|
|
@ -284,15 +284,10 @@ impl CoordinatorService {
|
|||
{
|
||||
let identity = self
|
||||
.coordinator
|
||||
.node_identity(node)
|
||||
.node_identity(tenant, project, node)
|
||||
.ok_or(CoordinatorError::UnknownNode)?;
|
||||
if &identity.tenant != tenant || &identity.project != project {
|
||||
return Err(CoordinatorError::Unauthorized(
|
||||
"node process-control request is outside its enrolled tenant/project scope"
|
||||
.to_owned(),
|
||||
)
|
||||
.into());
|
||||
}
|
||||
debug_assert_eq!(&identity.tenant, tenant);
|
||||
debug_assert_eq!(&identity.project, project);
|
||||
return Ok(());
|
||||
}
|
||||
self.coordinator
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue