Skip to content

Commit 48c0b28

Browse files
committed
Fix code comments
1 parent d5840a6 commit 48c0b28

File tree

5 files changed

+11
-0
lines changed

5 files changed

+11
-0
lines changed

cluster-autoscaler/simulator/clustersnapshot/store/basic.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,7 @@ func (snapshot *BasicSnapshotStore) DeviceClasses() fwk.DeviceClassLister {
360360
return snapshot.DraSnapshot().DeviceClasses()
361361
}
362362

363+
// DeviceClassResolver exposes the snapshot as DeviceClassResolver.
363364
func (snapshot *BasicSnapshotStore) DeviceClassResolver() fwk.DeviceClassResolver {
364365
return snapshot.DraSnapshot().DeviceClassResolver()
365366
}

cluster-autoscaler/simulator/clustersnapshot/store/delta.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,10 +439,12 @@ func (snapshot *DeltaSnapshotStore) CsiSnapshot() *csisnapshot.Snapshot {
439439
return snapshot.csiSnapshot
440440
}
441441

442+
// CSINodes returns the CSI node lister for this snapshot.
442443
func (snapshot *DeltaSnapshotStore) CSINodes() fwk.CSINodeLister {
443444
return snapshot.csiSnapshot.CSINodes()
444445
}
445446

447+
// DeviceClassResolver exposes the snapshot as DeviceClassResolver.
446448
func (snapshot *DeltaSnapshotStore) DeviceClassResolver() fwk.DeviceClassResolver {
447449
return snapshot.DraSnapshot().DeviceClassResolver()
448450
}

cluster-autoscaler/simulator/csi/provider/csinode.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@ import (
88
v1storagelister "k8s.io/client-go/listers/storage/v1"
99
)
1010

11+
// Provider provides access to CSI node information for the cluster.
1112
type Provider struct {
1213
csINodesLister v1storagelister.CSINodeLister
1314
}
1415

16+
// NewCSINodeProvider creates a new Provider with the given CSI node lister.
1517
func NewCSINodeProvider(csINodesLister v1storagelister.CSINodeLister) *Provider {
1618
return &Provider{csINodesLister: csINodesLister}
1719
}
1820

21+
// NewCSINodeProviderFromInformers creates a new Provider from an informer factory.
1922
func NewCSINodeProviderFromInformers(informerFactory informers.SharedInformerFactory) *Provider {
2023
return NewCSINodeProvider(informerFactory.Storage().V1().CSINodes().Lister())
2124
}

cluster-autoscaler/simulator/csi/snapshot/csinode_lister.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@ package snapshot
22

33
import storagev1 "k8s.io/api/storage/v1"
44

5+
// SnapshotCSINodeLister provides access to CSI nodes within a snapshot.
56
type SnapshotCSINodeLister struct {
67
snapshot *Snapshot
78
}
89

10+
// List returns all CSI nodes in the snapshot.
911
func (s SnapshotCSINodeLister) List() ([]*storagev1.CSINode, error) {
1012
return s.snapshot.listCSINodes(), nil
1113
}
1214

15+
// Get retrieves a CSI node by name from the snapshot.
1316
func (s SnapshotCSINodeLister) Get(name string) (*storagev1.CSINode, error) {
1417
return s.snapshot.Get(name)
1518
}

cluster-autoscaler/simulator/csi/snapshot/snapshot.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ import (
1010
schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework"
1111
)
1212

13+
// Snapshot represents a snapshot of CSI node information for cluster simulation.
1314
type Snapshot struct {
1415
csiNodes *common.PatchSet[string, *storagev1.CSINode]
1516
}
1617

18+
// NewSnapshot creates a new Snapshot from a map of CSI nodes.
1719
func NewSnapshot(csiNodes map[string]*storagev1.CSINode) *Snapshot {
1820
csiNdodePatch := common.NewPatchFromMap(csiNodes)
1921
return &Snapshot{

0 commit comments

Comments
 (0)