Repository navigation
Go Modernize changes - #1996
Merged
Merged
Go Modernize changes#1996
Conversation
kvalliyurnatt
requested review from
abrarshivani,
cdesiniotis,
henry118,
karthikvetrivel,
rahulait,
rajathagasthya and
tariq1890
September 2, 2026 20:43
kvalliyurnatt
commented
Sep 2, 2026
| // Config is a versioned struct used to hold configuration information. | ||
| type Config struct { | ||
| Version string `json:"version" yaml:"version"` | ||
| Flags Flags `json:"flags,omitempty" yaml:"flags,omitempty"` |
Contributor
Author
There was a problem hiding this comment.
omitempty does not really work on structs because structs are not really empty, if we want omit a struct we would need to add omitzero here, but that would be a change in behavior so left out adding that
Member
There was a problem hiding this comment.
seems like we just uncovered a divergence between json/yaml behavior. but it's not something this PR introduces. not a blocker imo.
henry118
approved these changes
Sep 2, 2026
| // Config is a versioned struct used to hold configuration information. | ||
| type Config struct { | ||
| Version string `json:"version" yaml:"version"` | ||
| Flags Flags `json:"flags,omitempty" yaml:"flags,omitempty"` |
Member
There was a problem hiding this comment.
seems like we just uncovered a divergence between json/yaml behavior. but it's not something this PR introduces. not a blocker imo.
Signed-off-by: Karthikeyan Valliyurnatt <kvalliyurnat@nvidia.com>
Signed-off-by: Karthikeyan Valliyurnatt <kvalliyurnat@nvidia.com>
Signed-off-by: Karthikeyan Valliyurnatt <kvalliyurnat@nvidia.com>
kvalliyurnatt
force-pushed
the
go_modernize
branch
from
September 4, 2026 16:02
2e822e3 to
e78e574
Compare
Signed-off-by: Karthikeyan Valliyurnatt <kvalliyurnat@nvidia.com>
kvalliyurnatt
force-pushed
the
go_modernize
branch
from
September 4, 2026 16:06
a749073 to
39883b5
Compare
kvalliyurnatt
enabled auto-merge (squash)
September 4, 2026 16:10
tariq1890
added a commit
that referenced
this pull request
Sep 15, 2026
* fix: handle dangling symlink in config-manager updateSymlink Signed-off-by: yoonhyunwoo <yjs88zerg@gmail.com> (cherry picked from commit 1a69452) * fix: address review feedback on config-manager symlink handling Wrap errors with %w instead of %v/%s so callers can unwrap them, and drop the redundant quoting since logs are already emitted in JSON. Split TestUpdateSymlinkDanglingDestination into independent subtests that each set up their own state via a shared fixture helper, so either case passes when run in isolation rather than depending on execution order. Signed-off-by: Abrar Shivani <ashivani@nvidia.com> (cherry picked from commit 4855607) * perf(rm): replace per-iteration sort in greedyAlloc with a min-heap Follow-up on top of #1621, which introduced the shared greedyAlloc loop with a pluggable replicaComparator (distributed vs packed). The loop still sorts the full candidate slice inside the allocation loop, paying O(n log n) per iteration for n iterations and giving O(n² log n) overall. Since all annotated replicas from the same underlying physical device share the same sort key, sorting at the replica granularity is wasted work — only m (the number of distinct physical devices contributing candidates) needs to be reordered. Refactor greedyAlloc to bucket candidates by their underlying physical device into a small gpuAllocState per device, holding a shared *replicaCount, the pickedFrom counter, and the remaining candidate IDs. A gpuPriorityQueue defers to the caller-supplied replicaComparator on allocated() for primary ordering and to pickedFrom for the tie-break (unchanged semantics). Each iteration pops the best device, takes one of its remaining replicas, updates counters, and pushes it back if any remain. Total cost drops to O(n log m). Both allocation policies (distributed and packed) benefit; no behavior change — the existing test suite (TestDistributedAlloc, TestPackedAlloc, TestPackedVsDistributedContrast, TestDistributedAlloc_PartiallyAllocated_DistributesAcrossDistinctGPUs, etc.) passes unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-Authored-By: runatom-ai <258621014+runatom-ai@users.noreply.github.com> Signed-off-by: Jonathan Meiri <33288957+Meiri28@users.noreply.github.com> (cherry picked from commit c3b47c6) * test(rm): add BenchmarkGreedyAlloc Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-Authored-By: runatom-ai <258621014+runatom-ai@users.noreply.github.com> Signed-off-by: Jonathan Meiri <33288957+Meiri28@users.noreply.github.com> (cherry picked from commit 498aba4) * Go Modernize changes (#1996) * Go Modernize changes and add modernize to the lint rules --------- Signed-off-by: Karthikeyan Valliyurnatt <kvalliyurnat@nvidia.com> (cherry picked from commit ad5bc6c) * validate vGPU capability record lengths (#1994) (cherry picked from commit 4edf2b6) * include component-specific DaemonSet selector labels to avoid selector overlap Changes include: - opt-in Helm setting to include component-specific DaemonSet selector labels to avoid selector overlap across device-plugin, GFD, and MPS control daemon - disabled by default to avoid breaking upgrades (DaemonSet selectors are immutable and enabling requires DaemonSet recreation) Signed-off-by: Rahul Sharma <rahulsharm@nvidia.com> (cherry picked from commit 0e3ff25) --------- Signed-off-by: yoonhyunwoo <yjs88zerg@gmail.com> Signed-off-by: Abrar Shivani <ashivani@nvidia.com> Signed-off-by: Jonathan Meiri <33288957+Meiri28@users.noreply.github.com> Signed-off-by: Karthikeyan Valliyurnatt <kvalliyurnat@nvidia.com> Signed-off-by: Rahul Sharma <rahulsharm@nvidia.com> Co-authored-by: yoonhyunwoo <yjs88zerg@gmail.com> Co-authored-by: Abrar Shivani <ashivani@nvidia.com> Co-authored-by: Jonathan Meiri <33288957+Meiri28@users.noreply.github.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: runatom-ai <258621014+runatom-ai@users.noreply.github.com> Co-authored-by: Karthikeyan Valliyurnatt <135071014+kvalliyurnatt@users.noreply.github.com> Co-authored-by: Rahul Sharma <rahulsharm@nvidia.com>
dd-octo-sts Bot
pushed a commit
to DataDog/k8s-device-plugin
that referenced
this pull request
Sep 23, 2026
* Go Modernize changes and add modernize to the lint rules --------- Signed-off-by: Karthikeyan Valliyurnatt <kvalliyurnat@nvidia.com> (cherry picked from commit ad5bc6c)
Superkooka
added a commit
to Superkooka/infra-gitops
that referenced
this pull request
Oct 19, 2026
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [longhorn](https://github.com/longhorn/longhorn) ([source](https://github.com/longhorn/charts)) | minor | `1.12.1` → `1.13.0` | | [nvidia-device-plugin](https://github.com/NVIDIA/k8s-device-plugin) | patch | `0.20.0` → `0.20.1` | --- >⚠️ **Warning** > > Some dependencies could not be looked up. Check the [Dependency Dashboard](issues/6) for more information. --- ### Release Notes <details> <summary>longhorn/charts (longhorn)</summary> ### [`v1.13.0`](https://github.com/longhorn/charts/releases/tag/longhorn-1.13.0) [Compare Source](longhorn/charts@longhorn-1.12.1...longhorn-1.13.0) Longhorn is a distributed block storage system for Kubernetes. </details> <details> <summary>NVIDIA/k8s-device-plugin (nvidia-device-plugin)</summary> ### [`v0.20.1`](https://github.com/NVIDIA/k8s-device-plugin/blob/HEAD/CHANGELOG.md#v0201) [Compare Source](NVIDIA/k8s-device-plugin@v0.20.0...v0.20.1) - Add NodeFeature CR delete privileges ([#​2049](NVIDIA/k8s-device-plugin#2049)) - Include component-specific DaemonSet selector labels to avoid selector overlap ([#​1716](NVIDIA/k8s-device-plugin#1716)) - Validate vGPU capability record lengths ([#​1994](NVIDIA/k8s-device-plugin#1994)) - Go Modernize changes ([#​1996](NVIDIA/k8s-device-plugin#1996)) - Replace per-iteration sort in greedyAlloc with a min-heap ([#​1826](NVIDIA/k8s-device-plugin#1826)) - Handle dangling symlink in config-manager updateSymlink ([#​1982](NVIDIA/k8s-device-plugin#1982)) - Bump nvidia-container-toolkit to v1.20.1 ([#​2046](NVIDIA/k8s-device-plugin#2046)) - Bump go-nvml to v0.13.4-0 ([#​2013](NVIDIA/k8s-device-plugin#2013)) - Bump nvidia/distroless/go to v4.1.4 ([#​2029](NVIDIA/k8s-device-plugin#2029)) - Guard GFD PCI vendor capability parsing against bad lengths ([#​2027](NVIDIA/k8s-device-plugin#2027)) </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xNC4xMiIsInVwZGF0ZWRJblZlciI6IjQ0LjE0LjEyIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Reviewed-on: https://forge.superkooka.com/Superkooka/infra-gitops/pulls/35
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ran go fix ./... which now includes the go modernize fixes, also added
modernizeto the lint rules