mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-04 02:56:18 +00:00
runtime: tracing: Fix logger passed in newContainer
Change logger in Trace call in newContainer from sandbox.Logger() to nil. Passing nil will cause an error to be logged by kataTraceLogger instead of the sandbox logger, which will avoid having the log message report it as part of the sandbox subsystem when it is part of the container subsystem. The kataTraceLogger will not log it as related to the container subsystem, but since the container logger has not been created at this point, and we already use the kataTraceLogger in other instances where a subsystem's logger has not been created yet, this PR makes the call consistent with other code. Backport of #2666 Fixes #2667 Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
This commit is contained in:
parent
cfd539dc6c
commit
b3e620dbcf
@ -753,7 +753,7 @@ func (c *Container) initConfigResourcesMemory() {
|
|||||||
|
|
||||||
// newContainer creates a Container structure from a sandbox and a container configuration.
|
// newContainer creates a Container structure from a sandbox and a container configuration.
|
||||||
func newContainer(ctx context.Context, sandbox *Sandbox, contConfig *ContainerConfig) (*Container, error) {
|
func newContainer(ctx context.Context, sandbox *Sandbox, contConfig *ContainerConfig) (*Container, error) {
|
||||||
span, ctx := katatrace.Trace(ctx, sandbox.Logger(), "newContainer", sandbox.tracingTags())
|
span, ctx := katatrace.Trace(ctx, nil, "newContainer", sandbox.tracingTags())
|
||||||
defer span.End()
|
defer span.End()
|
||||||
|
|
||||||
if !contConfig.valid() {
|
if !contConfig.valid() {
|
||||||
|
Loading…
Reference in New Issue
Block a user