Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update AgentKind enum variants #352

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

## [0.23.0] - 2024-10-23

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 @@
&self,
_networks: &HostNetworkGroup,
) -> Result<Vec<String>, anyhow::Error> {
Ok(vec!["hog@hostA".to_string()])
Ok(vec!["semi-supervised@hostA".to_string()])

Check warning on line 596 in src/graphql.rs

View check run for this annotation

Codecov / codecov/patch

src/graphql.rs#L596

Added line #L596 was not covered by tests
}
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(),
])

Check warning on line 605 in src/graphql.rs

View check run for this annotation

Codecov / codecov/patch

src/graphql.rs#L602-L605

Added lines #L602 - L605 were not covered by tests
}
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(),

Check warning on line 614 in src/graphql.rs

View check run for this annotation

Codecov / codecov/patch

src/graphql.rs#L612-L614

Added lines #L612 - L614 were not covered by tests
])
}
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 collector node",
hostname: "collector1",
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