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

enhancement(administration config): New --skip-healthchecks option for vector validate #19691

Merged
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
5 changes: 5 additions & 0 deletions changelog.d/validate_skip_healthchecks.enhancement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
New Option `--skip-healthchecks` for `vector validate` validates config
including VRL, but skips health checks for sinks.

Useful to validate configuration before deploying it remotely.
authors: MartinEmrich
7 changes: 5 additions & 2 deletions src/validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ pub struct Opts {
#[arg(long)]
pub no_environment: bool,

/// Disables health checks during validation.
#[arg(long)]
pub skip_healthchecks: bool,

/// Fail validation on warnings that are probably a mistake in the configuration
/// or are recommended to be fixed.
#[arg(short, long)]
Expand Down Expand Up @@ -178,8 +182,7 @@ async fn validate_environment(opts: &Opts, config: &Config, fmt: &mut Formatter)
} else {
return false;
};

validate_healthchecks(opts, config, &diff, &mut pieces, fmt).await
opts.skip_healthchecks || validate_healthchecks(opts, config, &diff, &mut pieces, fmt).await
}

async fn validate_components(
Expand Down
12 changes: 12 additions & 0 deletions website/content/en/docs/administration/validating.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,18 @@ These environment checks can be disabled using the [`--no-environment`][no_envir
vector validate --no-environment /etc/vector/vector.yaml
```

#### Skipping health checks

To validate the vector configuration even if the health-checked endpoints are not reachable
(for example, from a local workstation), but still run all the other environment checks, use
the [`--skip-healthchecks`][skip_healthchecks] flag:

```bash
vector validate --skip-healthchecks /etc/vector/vector.yaml
```

**Note:** The configured `data_dir` must still be writeable.

[components]: /components
[no_environment]: /docs/reference/cli/#validate-no-environment
[sinks]: /sinks
Expand Down
6 changes: 6 additions & 0 deletions website/cue/reference/cli.cue
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,12 @@ cli: {
checks and health checks
"""
}
"skip-healthchecks": {
_short: "ne"
description: """
Disables health checks during validation.
"""
}
"deny-warnings": {
_short: "d"
description: "Fail validation on warnings"
Expand Down
Loading