Skip to content

Commit 7d3b3ec

Browse files
authored
Merge pull request #82 from humblec/clean-2
Update exported function details with source code comments.
2 parents c9f5e3c + 164d10a commit 7d3b3ec

File tree

5 files changed

+5
-2
lines changed

5 files changed

+5
-2
lines changed

pkg/apis/volumesnapshot/v1alpha1/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ type VolumeSnapshotSource struct {
214214
CSI *CSIVolumeSnapshotSource `json:"csiVolumeSnapshotSource,omitempty"`
215215
}
216216

217-
// Represents the source from CSI volume snapshot
217+
// CSIVolumeSnapshotSource represents the source from CSI volume snapshot
218218
type CSIVolumeSnapshotSource struct {
219219
// Driver is the name of the driver to use for this snapshot.
220220
// This MUST be the same name returned by the CSI GetPluginName() call for

pkg/connection/connection.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ var (
7272
_ CSIConnection = &csiConnection{}
7373
)
7474

75+
// New returns a CSI connection object.
7576
func New(address string, timeout time.Duration) (CSIConnection, error) {
7677
conn, err := connect(address, timeout)
7778
if err != nil {

pkg/controller/csi_handler.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ type csiHandler struct {
4242
snapshotNameUUIDLength int
4343
}
4444

45+
// NewCSIHandler returns a handler which includes the csi connection and Snapshot name details
4546
func NewCSIHandler(
4647
csiConnection connection.CSIConnection,
4748
timeout time.Duration,

pkg/controller/snapshot_controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,7 @@ func getSnapshotStatusForLogging(snapshot *crdv1.VolumeSnapshot) string {
440440
return fmt.Sprintf("bound to: %q, Completed: %v", snapshot.Spec.SnapshotContentName, snapshot.Status.ReadyToUse)
441441
}
442442

443+
// IsSnapshotBound returns true/false if snapshot is bound
443444
func IsSnapshotBound(snapshot *crdv1.VolumeSnapshot, content *crdv1.VolumeSnapshotContent) bool {
444445
if content.Spec.VolumeSnapshotRef != nil && content.Spec.VolumeSnapshotRef.Name == snapshot.Name &&
445446
content.Spec.VolumeSnapshotRef.UID == snapshot.UID {

pkg/controller/util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ func getCredentials(k8s kubernetes.Interface, ref *v1.SecretReference) (map[stri
320320
return credentials, nil
321321
}
322322

323-
// Returns 0 for resyncPeriod in case resyncing is not needed.
323+
// NoResyncPeriodFunc Returns 0 for resyncPeriod in case resyncing is not needed.
324324
func NoResyncPeriodFunc() time.Duration {
325325
return 0
326326
}

0 commit comments

Comments
 (0)