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

logdog: switch to use apiclient cli to get settings #3946

Merged
merged 1 commit into from
May 6, 2024

Conversation

jmt-lab
Copy link
Contributor

@jmt-lab jmt-lab commented May 6, 2024

Issue number: 3784

Closes #3784

Description of changes:

  • Adjusted logdog to get settings via cli apiclient get
  • Changed shape to be managed with serde_json::Value
  • Used a normalize, denormalize methodology to flatten the object to maintain stripping of secrets

Testing done:

  • Tested and launched, validated that all secrets were removed after generating bottlerocket-logs.tar.gz

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

@jmt-lab jmt-lab requested review from bcressey and webern May 6, 2024 16:24
sources/logdog/src/error.rs Show resolved Hide resolved
sources/logdog/src/log_request.rs Outdated Show resolved Hide resolved
sources/logdog/src/log_request.rs Outdated Show resolved Hide resolved
sources/logdog/src/log_request.rs Outdated Show resolved Hide resolved
This changes logdog to fetch settings using the apiclient. This creates two breaking changes.
First logdog will now include sections such as 'os' in the log. This provides more information
in the log. Secondly instead of removing the existence of secret settings their values are replaced
with REDACTED. This allows the user to see the setting was there while maintaining the scrubbing of
secrets.
@jmt-lab
Copy link
Contributor Author

jmt-lab commented May 6, 2024

Updated commit message with description of the breaking change

use datastore::deserialization::from_map;
use datastore::serialization::to_pairs;
use glob::{glob, Pattern};
use glob::glob;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can drop the glob dependency it looks like?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wish but it is used in another method i used udeps to validate

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its used by handle_glob_request

@jmt-lab jmt-lab merged commit 7eee5a2 into bottlerocket-os:develop May 6, 2024
33 checks passed
@jmt-lab jmt-lab deleted the ootb/logdog branch May 6, 2024 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OOTB: Remove conditional compilation from logdog
3 participants