Skip to content

controller/vm: CreateVM: log the HCS document - #2921

Open
Tingmao Wang (micromaomao) wants to merge 1 commit into
microsoft:mainfrom
micromaomao:lcow-v2-log-hcs
Open

controller/vm: CreateVM: log the HCS document#2921
Tingmao Wang (micromaomao) wants to merge 1 commit into
microsoft:mainfrom
micromaomao:lcow-v2-log-hcs

Conversation

@micromaomao

Copy link
Copy Markdown
Member

Assisted-by: GitHub-Copilot

Assisted-by: GitHub-Copilot
Signed-off-by: Tingmao Wang <tingmaowang@microsoft.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

HCS document serialization must be skipped when debug logging is disabled.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds debug logging of the generated HCS document during VM creation.

Changes:

  • Logs the HCS document before invoking vmmanager.Create.
  • Requires guarding serialization behind a debug-level check to avoid unnecessary overhead.
File summaries
File Description
internal/controller/vm/vm.go Adds HCS document logging; debug-disabled paths currently incur serialization cost.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

default:
return fmt.Errorf("cannot create VM: VM is in incorrect state %s", c.vmState)
}
log.G(ctx).WithField("hcs-document", log.Format(ctx, hcsDocument)).Debug("creating utility VM")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Worth the check!

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