Skip to content

Conversation

ffromani
Copy link
Contributor

@ffromani ffromani commented Nov 7, 2024

/kind cleanup

What this PR does / why we need it:

As emerged during the review of #128657 (comment) , golang stdlib now features helpers in maps and slices package we can use instead of reinventing in our codebase

Which issue(s) this PR fixes:

Fixes N/A

Special notes for your reviewer:

N/A

Does this PR introduce a user-facing change?

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Nov 7, 2024
@ffromani
Copy link
Contributor Author

ffromani commented Nov 7, 2024

WIP because I'd like to lookup for more instances and clean them up

@k8s-ci-robot k8s-ci-robot added area/kubelet sig/node Categorizes an issue or PR as relevant to SIG Node. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Nov 7, 2024
@SergeyKanzhelev
Copy link
Member

WIP because I'd like to lookup for more instances and clean them up

sure. Ping when ready.

}

// Clone creates a deep copy of the ContainerMap
func (cm ContainerMap) Clone() ContainerMap {
Copy link
Contributor

Choose a reason for hiding this comment

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

personally I'd drop this function entirely as it just uses a stdlib function anyway

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 thought about it. I'd argue that if we bothered to create a type around essentially a map, we should not break the abstraction, and if so we need the trivial Clone method.

Other (more far-fetching?) options:

  • dissolve ContainerMap and make use an actual map + helper functions
  • make ContainerMap more opaque, fully wrap it into a struct, to open the option in the future to add locks (spoiler: node: cm: don't share containerMap instances between managers #128657 was caused largely because I incorrectly remembered ContainerMap is more than such a thin wrapper. I confused it with pod_devices)

I'm open to conversation here.

@ffromani
Copy link
Contributor Author

/retest

@ffromani
Copy link
Contributor Author

ffromani commented Jan 8, 2025

/priority backlog

@k8s-ci-robot k8s-ci-robot added priority/backlog Higher priority than priority/awaiting-more-evidence. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Jan 8, 2025
@ffromani ffromani force-pushed the unshare-containermap-among-managers-cleanup branch from 12fc5d2 to 10e987e Compare January 8, 2025 17:17
@ffromani ffromani changed the title WIP: node: cm: use maps.Clone instead of reinvent it node: cm: use maps.Clone instead of reinvent it Jan 8, 2025
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 8, 2025
@ffromani
Copy link
Contributor Author

ffromani commented Jan 8, 2025

@haircommander / @SergeyKanzhelev ready for review

@haircommander
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 8, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: f1ae7e51b37fc764a285b87cb5d4c964deddbc12

@ffromani
Copy link
Contributor Author

ffromani commented Jan 8, 2025

/retest-required

@ffromani
Copy link
Contributor Author

/triage accepted

even though it's bad practice to self-triage issues, in this case it's pretty evident from the context so I'm just fixing labels post-fact

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jan 20, 2025
@ffromani
Copy link
Contributor Author

/assign @SergeyKanzhelev

@ffromani
Copy link
Contributor Author

ready and LGTM'd!

As pointed out in kubernetes#128657 (comment)

Signed-off-by: Francesco Romani <fromani@redhat.com>
@ffromani ffromani force-pushed the unshare-containermap-among-managers-cleanup branch from 10e987e to e766b04 Compare January 30, 2025 13:45
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 30, 2025
@ffromani
Copy link
Contributor Author

New changes are detected. LGTM label has been removed.

rebased on top of master, no code changes

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 30, 2025
@ffromani
Copy link
Contributor Author

/cc @swatisehgal

@haircommander
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 30, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 2b3e757414f8c5c3e608d7490808437ef2e0fc38

Copy link
Contributor

@swatisehgal swatisehgal left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ffromani, swatisehgal

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:

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

@k8s-ci-robot k8s-ci-robot merged commit 4e54a67 into kubernetes:master Jan 30, 2025
13 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.33 milestone Jan 30, 2025
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. area/kubelet cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/backlog Higher priority than priority/awaiting-more-evidence. release-note-none Denotes a PR that doesn't merit a release note. sig/node Categorizes an issue or PR as relevant to SIG Node. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Development

Successfully merging this pull request may close these issues.

5 participants