Skip to content

Commit

Permalink
socket sink: ignore unix_mode on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
jpovixwm committed Nov 26, 2024
1 parent 09dd31b commit b648cfe
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ The `socket` sink now supports the `unix_mode` configuration option that specifi
- `Stream` (default) - Stream-oriented (`SOCK_STREAM`)
- `Datagram` - Datagram-oriented (`SOCK_DGRAM`)

This option only applies when `mode = "unix"`.
This option only applies when `mode = "unix"`, and is unavailable on macOS, where `SOCK_STREAM` is always used for Unix sockets.

authors: jpovixwm
4 changes: 4 additions & 0 deletions src/sinks/util/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ pub struct UnixSinkConfig {
pub path: PathBuf,

/// The Unix socket mode to use.
///
/// Unavailable on macOS, where the mode is always `Stream`.
#[cfg_attr(target_os = "macos", serde(skip))]
#[serde(default = "default_unix_mode")]
unix_mode: UnixMode,
}
Expand Down Expand Up @@ -406,6 +409,7 @@ mod tests {
assert_eq!(input_lines, receiver.await);
}

#[cfg_attr(target_os = "macos", ignore)]
#[tokio::test]
async fn basic_unix_datagram_sink() {
let num_lines = 1000;
Expand Down
6 changes: 5 additions & 1 deletion website/cue/reference/components/sinks/base/socket.cue
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,11 @@ base: components: sinks: socket: configuration: {
}
}
unix_mode: {
description: "The Unix socket mode to use."
description: """
The Unix socket mode to use.
Unavailable on macOS, where the mode is always `Stream`.
"""
relevant_when: "mode = \"unix\""
required: false
type: string: {
Expand Down

0 comments on commit b648cfe

Please sign in to comment.