Skip to content

Commit

Permalink
Update AgentKind enum variants
Browse files Browse the repository at this point in the history
- Update review-database to 0.32.0
- Rename previous enum variants to align with review-database
- Add `TimeSeriesGenerator` variant

Close: #351
  • Loading branch information
danbi2990 authored Nov 13, 2024
1 parent 7d9edf0 commit 808a3c9
Show file tree
Hide file tree
Showing 8 changed files with 253 additions and 235 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@ Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- Added the `TimeSeriesGenerator` variant to the `AgentKind` enum.

### Changed

- Modified `applyNode` GraphQL API logic to prevent notifying agents that are
operating with local configuration.
- Updated `updateNodeDraft` GraphQL API to no longer require `config` in
`NodeDraftInput::agents`.
- Updated review-database to 0.32.0.
- Renamed `AgentKind` enum variants to align with review-database.

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ num-traits = "0.2"
reqwest = { version = "0.12", default-features = false, features = [
"rustls-tls-native-roots",
] }
review-database = { git = "https://github.com/petabi/review-database.git", tag = "0.31.0" }
review-database = { git = "https://github.com/petabi/review-database.git", tag = "0.32.0" }
roxy = { git = "https://github.com/aicers/roxy.git", tag = "0.3.0" }
rustls = { version = "0.23", default-features = false, features = [
"ring",
Expand Down
13 changes: 8 additions & 5 deletions src/graphql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -593,22 +593,25 @@ impl AgentManager for MockAgentManager {
&self,
_networks: &HostNetworkGroup,
) -> Result<Vec<String>, anyhow::Error> {
Ok(vec!["hog@hostA".to_string()])
Ok(vec!["semi-supervised@hostA".to_string()])
}
async fn broadcast_allow_networks(
&self,
_networks: &HostNetworkGroup,
) -> Result<Vec<String>, anyhow::Error> {
Ok(vec!["hog@hostA".to_string(), "hog@hostB".to_string()])
Ok(vec![
"semi-supervised@hostA".to_string(),
"semi-supervised@hostB".to_string(),
])
}
async fn broadcast_block_networks(
&self,
_networks: &HostNetworkGroup,
) -> Result<Vec<String>, anyhow::Error> {
Ok(vec![
"hog@hostA".to_string(),
"hog@hostB".to_string(),
"hog@hostC".to_string(),
"semi-supervised@hostA".to_string(),
"semi-supervised@hostB".to_string(),
"semi-supervised@hostC".to_string(),
])
}
async fn online_apps_by_host_id(
Expand Down
8 changes: 4 additions & 4 deletions src/graphql/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1297,8 +1297,8 @@ mod tests {
description: "This is the sensor node",
hostname: "sensor1",
agents: [{
key: "piglet"
kind: PIGLET
key: "sensor"
kind: SENSOR
status: ENABLED
}]
giganto: null
Expand All @@ -1323,8 +1323,8 @@ mod tests {
}
agents: [
{
key: "piglet",
kind: "PIGLET",
key: "sensor",
kind: "SENSOR",
status: "ENABLED"
}
],
Expand Down
7 changes: 4 additions & 3 deletions src/graphql/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,10 @@ impl TryFrom<&NicInput> for Nic {
#[derive(Clone, Deserialize, PartialEq, Serialize, Copy, Eq, Enum)]
#[graphql(remote = "database::AgentKind")]
pub enum AgentKind {
Reconverge,
Piglet,
Hog,
Unsupervised,
Sensor,
SemiSupervised,
TimeSeriesGenerator,
}

#[derive(Clone, PartialEq, Deserialize, Serialize, Enum, Copy, Eq)]
Expand Down
Loading

0 comments on commit 808a3c9

Please sign in to comment.