Skip to content

Commit 45565b1

Browse files
committed
Merge branch 'fix/golangci-v2.12-lint'
2 parents d45b486 + 3600c32 commit 45565b1

4 files changed

Lines changed: 9 additions & 7 deletions

File tree

‎internal/infra/k8s/watch.go‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,8 @@ func WatchGPUNodes(ctx context.Context, clientset kubernetes.Interface) (<-chan
307307
return clientset.CoreV1().Nodes().Watch(ctx, opts)
308308
},
309309
)
310-
openers := []func(context.Context) (watch.Interface, error){nodeOpener}
310+
openers := make([]func(context.Context) (watch.Interface, error), 0, 1+len(gpuPodSelectors))
311+
openers = append(openers, nodeOpener)
311312
openers = append(openers, gpuPodWatchOpeners(clientset)...)
312313
return watchTrigger(ctx, DebounceWindow, openers...)
313314
}
@@ -320,10 +321,8 @@ func WatchGPUWorkloads(ctx context.Context, clientset kubernetes.Interface) (<-c
320321
// WatchDedicatedAIClusters triggers on DAC CR changes (both API
321322
// versions) plus GPU pod changes (pods drive replica stats).
322323
func WatchDedicatedAIClusters(ctx context.Context, client dynamic.Interface, clientset kubernetes.Interface) (<-chan struct{}, error) {
323-
openers := []func(context.Context) (watch.Interface, error){
324-
crWatchOpener(client, dacV1GVR),
325-
crWatchOpener(client, dacV2GVR),
326-
}
324+
openers := make([]func(context.Context) (watch.Interface, error), 0, 2+len(gpuPodSelectors))
325+
openers = append(openers, crWatchOpener(client, dacV1GVR), crWatchOpener(client, dacV2GVR))
327326
openers = append(openers, gpuPodWatchOpeners(clientset)...)
328327
return watchTrigger(ctx, DebounceWindow, openers...)
329328
}

‎internal/infra/terraform/terraform.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ func getServiceTenancy(object cty.Value, realm string) *models.ServiceTenancy {
330330
case "home_region":
331331
result.HomeRegion = value.AsString()
332332
case "regions":
333-
var regions []string
333+
regions := make([]string, 0, len(value.AsValueSlice()))
334334
for _, region := range value.AsValueSlice() {
335335
regions = append(regions, region.AsString())
336336
}

‎internal/ui/tui/model_view.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func (m *Model) statusView() string {
8080
statsText.WriteString(" ")
8181
}
8282
}
83-
statsText.WriteString(fmt.Sprintf("[%d/%d]", m.table.Cursor()+1, len(m.table.Rows())))
83+
fmt.Fprintf(&statsText, "[%d/%d]", m.table.Cursor()+1, len(m.table.Rows()))
8484
statsCell := m.theme.Stats.Render(statsText.String())
8585

8686
loadingCell := ""

‎internal/ui/tui/table_utils.go‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@ func itemKeyFrom(category domain.Category, row table.Row) models.ItemKey {
186186
// the ModelArtifactMap's parent BaseModel key — see
187187
// columns/model_artifact.go. Treating it as a scoped key
188188
// disambiguates artifacts that share a Name across BaseModels.
189+
if len(row) < 2 {
190+
return nil
191+
}
189192
return models.ScopedItemKey{Scope: row[1], Name: row[0]}
190193
case domain.CategoryUnknown:
191194
// exhaustive

0 commit comments

Comments
 (0)