Skip to content

Conversation

haircommander
Copy link
Member

What type of PR is this?

/kind api-change

What this PR does / why we need it:

which could allow cadvisor to choose not to report network metrics

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Add HostNetwork field to the `/info` endpoint to inform cadvisor whether a container is in the host network or not.

which could allow cadvisor to choose not to report network metrics

Signed-off-by: Peter Hunt <pehunt@redhat.com>
@haircommander haircommander requested a review from mrunalp as a code owner August 19, 2025 18:22
@openshift-ci openshift-ci bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Aug 19, 2025
@openshift-ci openshift-ci bot requested review from bitoku and klihub August 19, 2025 18:22
@openshift-ci openshift-ci bot added kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Aug 19, 2025
@haircommander
Copy link
Member Author

LogPath: ctr.LogPath(),
Sandbox: ctr.Sandbox(),
IPs: sb.IPs(),
HostNetwork: ptr.To(sb.HostNetwork()),
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this could potentially seg fault.

Should you use deref?

Copy link
Member Author

Choose a reason for hiding this comment

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

how would it segfault? HostNetwork() returns a bool, and ptr.To() just creates a pointer out of that returned bool

Copy link
Contributor

Choose a reason for hiding this comment

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

HostNetwork is a pointer to a bool though.

couldn't that be nil?

Copy link
Member Author

Choose a reason for hiding this comment

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

sb.HostNetwork() returns a bool, the HostNetwork we nest in the ContainerInfo field is a pointer. They're different

Copy link
Contributor

Choose a reason for hiding this comment

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

Why the use of a bool pointer here?

In kube we would use it for marshaling non default fields but I don't see a reason to have this here.

Copy link
Contributor

Choose a reason for hiding this comment

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

sb.HostNetwork() returns a bool, the HostNetwork we nest in the ContainerInfo field is a pointer. They're different

I see. Yea I got confused.

Copy link
Member

Choose a reason for hiding this comment

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

There's already a nil check for sb at lines 88-93

Copy link
Member Author

Choose a reason for hiding this comment

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

In kube we would use it for marshaling non default fields but I don't see a reason to have this here.

exactly this reason. Eventually cadvisor will consume this field, and we need to be able to differentiate between cri-o not supporting the field and the field being false.

@haircommander
Copy link
Member Author

critest failures reproduced here #9410 so unrelated

@sohankunkerkar
Copy link
Member

critest failures reproduced here #9410 so unrelated

Looks like the cri-tools CI is also broken with the same failure

Copy link

codecov bot commented Aug 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.00%. Comparing base (9254d7b) to head (21b03fd).
⚠️ Report is 74 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9411      +/-   ##
==========================================
- Coverage   66.98%   66.00%   -0.98%     
==========================================
  Files         198      202       +4     
  Lines       27308    27761     +453     
==========================================
+ Hits        18291    18325      +34     
- Misses       7508     7887     +379     
- Partials     1509     1549      +40     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 20, 2025
Copy link
Contributor

openshift-ci bot commented Aug 20, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: haircommander, saschagrunert

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [haircommander,saschagrunert]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 259e23f into cri-o:main Aug 20, 2025
67 of 76 checks passed
@haircommander
Copy link
Member Author

/cherry-pick release-1.33

@openshift-cherrypick-robot

@haircommander: new pull request created: #9413

In response to this:

/cherry-pick release-1.33

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants