Skip to content

Conversation

@nscuro
Copy link
Contributor

@nscuro nscuro commented Mar 17, 2025

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.

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})
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 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.

Choose a reason for hiding this comment

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

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, no rush.

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>
@nscuro nscuro force-pushed the k8s-clientset-debug-log-object branch from 3acd9d6 to eb9ed0c Compare March 17, 2025 11:33
@coveralls
Copy link

Pull Request Test Coverage Report for Build 13898238558

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 40.963%

Totals Coverage Status
Change from base Build 13862297464: 0.0%
Covered Lines: 723
Relevant Lines: 1765

💛 - Coveralls

@coveralls
Copy link

Pull Request Test Coverage Report for Build 13898411148

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 40.963%

Totals Coverage Status
Change from base Build 13862297464: 0.0%
Covered Lines: 723
Relevant Lines: 1765

💛 - Coveralls

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.

3 participants