Add debug log for to-be-applied k8s objects#774
Open
nscuro wants to merge 1 commit intosmithy-security:mainfrom
Open
Add debug log for to-be-applied k8s objects#774nscuro wants to merge 1 commit intosmithy-security:mainfrom
nscuro wants to merge 1 commit intosmithy-security:mainfrom
Conversation
nscuro
commented
Mar 17, 2025
| return errors.Errorf("%s/%s: could not convert runtime object into unstructured data: %w", namespace, name, err) | ||
| } | ||
|
|
||
| slog.Debug("applying object", "namespace", namespace, "forceConflicts", forceConflicts, "object", lazyObjectLogValue{obj}) |
Contributor
Author
There was a problem hiding this comment.
I just used slog here without having a broader understanding how Smithy propagates desired log levels. Happy to make changes so it aligns better with how Smithy approaches logging.
There was a problem hiding this comment.
I think that we might move this internally and remove it from the OSS this week - do you mind if we hold the change for now?
Allows for easier debugging when applying of objects fails, e.g. because the k8s API server rejects them for unknown reasons. Wraps the object in a struct to allow for lazy evaluation as per https://pkg.go.dev/log/slog#hdr-Performance_considerations. Signed-off-by: nscuro <nscuro@protonmail.com>
3acd9d6 to
eb9ed0c
Compare
Pull Request Test Coverage Report for Build 13898238558Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 13898411148Details
💛 - Coveralls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allows for easier debugging when applying of objects fails, e.g. because the k8s API server rejects them for unknown reasons.
Wraps the object in a struct to allow for lazy evaluation as per https://pkg.go.dev/log/slog#hdr-Performance_considerations.