Skip to content

Commit

Permalink
agent: default autoDiscover to enabled
Browse files Browse the repository at this point in the history
Updates the agent discovers handler to default capture `autoDiscover` to
enabled. If there is an existing capture spec, then its `autoDiscover` property
(or lack thereof) is used directly. But if discovering a new capture, then
`autoDiscover` will be enabled.
  • Loading branch information
psFried committed Sep 12, 2023
1 parent c2a97ae commit 9edcbc4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ expression: json!(out)
---
[
{
"autoDiscover": {
"addNewBindings": true,
"evolveIncompatibleCollections": false
},
"bindings": [
{
"resource": {
Expand Down
5 changes: 4 additions & 1 deletion crates/agent/src/discovers/specs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ pub fn merge_capture(
Vec::new(),
models::CaptureDef::default_interval(),
models::ShardTemplate::default(),
None,
Some(models::AutoDiscover {
add_new_bindings: true,
evolve_incompatible_collections: false,
}),
),
};

Expand Down
4 changes: 2 additions & 2 deletions crates/models/src/captures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ pub struct CaptureDef {
pub struct AutoDiscover {
/// Automatically add new bindings discovered from the source.
#[serde(default)]
add_new_bindings: bool,
pub add_new_bindings: bool,
/// Whether to automatically evolve collections and/or materialization
/// bindings to handle changes to collections that would otherwise be
/// incompatible with the existing catalog.
#[serde(default)]
evolve_incompatible_collections: bool,
pub evolve_incompatible_collections: bool,
}

/// An endpoint from which Flow will capture.
Expand Down
2 changes: 1 addition & 1 deletion crates/models/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ mod source;
mod tests;

pub use crate::labels::{Label, LabelSelector, LabelSet};
pub use captures::{CaptureBinding, CaptureDef, CaptureEndpoint};
pub use captures::{AutoDiscover, CaptureBinding, CaptureDef, CaptureEndpoint};
pub use catalogs::Catalog;
pub use collections::{CollectionDef, Projection};
pub use connector::ConnectorConfig;
Expand Down

0 comments on commit 9edcbc4

Please sign in to comment.