Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup: resolve godot linter #2256

Merged
merged 1 commit into from
Jul 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/cephcsi.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const (
pollTime = 60 // seconds
probeTimeout = 3 // seconds

// use default namespace if namespace is not set
// use default namespace if namespace is not set.
defaultNS = "default"
)

Expand Down
4 changes: 2 additions & 2 deletions e2e/ceph_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import (

// #nosec because of the word `Secret`
const (
// ceph user names
// ceph user names.
keyringRBDProvisionerUsername = "cephcsi-rbd-provisioner"
keyringRBDNodePluginUsername = "cephcsi-rbd-node"
keyringRBDNamespaceProvisionerUsername = "cephcsi-rbd-ns-provisioner"
keyringRBDNamespaceNodePluginUsername = "cephcsi-rbd-ns-node"
keyringCephFSProvisionerUsername = "cephcsi-cephfs-provisioner"
keyringCephFSNodePluginUsername = "cephcsi-cephfs-node"
// secret names
// secret names.
rbdNodePluginSecretName = "cephcsi-rbd-node"
rbdProvisionerSecretName = "cephcsi-rbd-provisioner"
rbdNamespaceNodePluginSecretName = "cephcsi-rbd-ns-node"
Expand Down
4 changes: 2 additions & 2 deletions e2e/rbd.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var (
rbdDeploymentName = "csi-rbdplugin-provisioner"
rbdDaemonsetName = "csi-rbdplugin"
defaultRBDPool = "replicapool"
// Topology related variables
// Topology related variables.
nodeRegionLabel = "test.failure-domain/region"
regionValue = "testregion"
nodeZoneLabel = "test.failure-domain/zone"
Expand All @@ -40,7 +40,7 @@ var (
rbdTopologyPool = "newrbdpool"
rbdTopologyDataPool = "replicapool" // NOTE: should be different than rbdTopologyPool for test to be effective

// yaml files required for deployment
// yaml files required for deployment.
pvcPath = rbdExamplePath + "pvc.yaml"
appPath = rbdExamplePath + "pod.yaml"
rawPvcPath = rbdExamplePath + "raw-block-pvc.yaml"
Expand Down
4 changes: 2 additions & 2 deletions e2e/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ const (
retainPolicy = v1.PersistentVolumeReclaimRetain
// deletePolicy is the default policy in E2E.
deletePolicy = v1.PersistentVolumeReclaimDelete
// Default key and label for Listoptions
// Default key and label for Listoptions.
appKey = "app"
appLabel = "write-data-in-pod"

noError = ""
)

var (
// cli flags
// cli flags.
deployTimeout int
deployCephFS bool
deployRBD bool
Expand Down
10 changes: 5 additions & 5 deletions internal/cephfs/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import (
)

const (
// volIDVersion is the version number of volume ID encoding scheme
// volIDVersion is the version number of volume ID encoding scheme.
volIDVersion uint16 = 1

// RADOS namespace to store CSI specific objects and keys
// RADOS namespace to store CSI specific objects and keys.
radosNamespace = "csi"
)

Expand All @@ -43,15 +43,15 @@ type Driver struct {

var (
// CSIInstanceID is the instance ID that is unique to an instance of CSI, used when sharing
// ceph clusters across CSI instances, to differentiate omap names per CSI instance
// ceph clusters across CSI instances, to differentiate omap names per CSI instance.
CSIInstanceID = "default"

// volJournal is used to maintain RADOS based journals for CO generated
// VolumeName to backing CephFS subvolumes
// VolumeName to backing CephFS subvolumes.
volJournal *journal.Config

// snapJournal is used to maintain RADOS based journals for CO generated
// SnapshotName to backing CephFS subvolumes
// SnapshotName to backing CephFS subvolumes.
snapJournal *journal.Config
)

Expand Down
10 changes: 5 additions & 5 deletions internal/cephfs/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ const (
)

var (
// ErrCloneInProgress is returned when snapshot clone state is `in progress`
// ErrCloneInProgress is returned when snapshot clone state is `in progress`.
ErrCloneInProgress = errors.New("clone from snapshot is already in progress")

// ErrClonePending is returned when snapshot clone state is `pending`
// ErrClonePending is returned when snapshot clone state is `pending`.
ErrClonePending = errors.New("clone from snapshot is pending")

// ErrInvalidClone is returned when the clone state is invalid
// ErrInvalidClone is returned when the clone state is invalid.
ErrInvalidClone = errors.New("invalid clone state")

// ErrCloneFailed is returned when the clone state is failed.
Expand All @@ -46,7 +46,7 @@ var (
// statically provisioned.
ErrNonStaticVolume = errors.New("volume not static")

// ErrSnapProtectionExist is returned when the snapshot is already protected
// ErrSnapProtectionExist is returned when the snapshot is already protected.
ErrSnapProtectionExist = errors.New("snapshot protection already exists")

// ErrSnapNotFound is returned when snap name passed is not found in the list
Expand All @@ -56,7 +56,7 @@ var (
// ErrVolumeNotFound is returned when a subvolume is not found in CephFS.
ErrVolumeNotFound = errors.New("volume not found")

// ErrInvalidCommand is returned when a command is not known to the cluster
// ErrInvalidCommand is returned when a command is not known to the cluster.
ErrInvalidCommand = errors.New("invalid command")

// ErrVolumeHasSnapshots is returned when a subvolume has snapshots.
Expand Down
2 changes: 1 addition & 1 deletion internal/cephfs/volumemounter.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const (
var (
availableMounters []string

// maps a mountpoint to PID of its FUSE daemon
// maps a mountpoint to PID of its FUSE daemon.
fusePidMap = make(map[string]int)
fusePidMapMtx sync.Mutex

Expand Down
10 changes: 5 additions & 5 deletions internal/rbd/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
)

const (
// volIDVersion is the version number of volume ID encoding scheme
// volIDVersion is the version number of volume ID encoding scheme.
volIDVersion uint16 = 1
)

Expand All @@ -43,19 +43,19 @@ type Driver struct {
var (

// CSIInstanceID is the instance ID that is unique to an instance of CSI, used when sharing
// ceph clusters across CSI instances, to differentiate omap names per CSI instance
// ceph clusters across CSI instances, to differentiate omap names per CSI instance.
CSIInstanceID = "default"

// volJournal and snapJournal are used to maintain RADOS based journals for CO generated
// VolumeName to backing RBD images
// VolumeName to backing RBD images.
volJournal *journal.Config
snapJournal *journal.Config
// rbdHardMaxCloneDepth is the hard limit for maximum number of nested volume clones that are taken before a flatten
// occurs
// occurs.
rbdHardMaxCloneDepth uint

// rbdSoftMaxCloneDepth is the soft limit for maximum number of nested volume clones that are taken before a flatten
// occurs
// occurs.
rbdSoftMaxCloneDepth uint
maxSnapshotsOnImage uint
minSnapshotsOnImageToStartFlatten uint
Expand Down
4 changes: 2 additions & 2 deletions internal/rbd/encryption.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ const (
// rbdImageRequiresEncryption has been deprecated, it is used only for
// volumes that have been created with an old provisioner, were never
// attached/mounted and now get staged by a new node-plugin
// TODO: remove this backwards compatibility support
// TODO: remove this backwards compatibility support.
rbdImageRequiresEncryption = rbdEncryptionState("requiresEncryption")

// image metadata key for encryption
// image metadata key for encryption.
encryptionMetaKey = ".rbd.csi.ceph.com/encrypted"

// metadataDEK is the key in the image metadata where the (encrypted)
Expand Down
4 changes: 2 additions & 2 deletions internal/rbd/nodeserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ type stageTransaction struct {
}

const (
// values for xfsHasReflink
// values for xfsHasReflink.
xfsReflinkUnset int = iota
xfsReflinkNoSupport
xfsReflinkSupport
Expand Down Expand Up @@ -92,7 +92,7 @@ var (
}

// xfsHasReflink is set by xfsSupportsReflink(), use the function when
// checking the support for reflink
// checking the support for reflink.
xfsHasReflink = xfsReflinkUnset
)

Expand Down
2 changes: 1 addition & 1 deletion internal/rbd/rbd_attach.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const (
// Output strings returned during invocation of "rbd unmap --device-type... <imageSpec>" when
// image is not found to be mapped. Used to ignore errors when attempting to unmap such images.
// The %s format specifier should contain the <imageSpec> string
// NOTE: When using devicePath instead of imageSpec, the error strings are different
// NOTE: When using devicePath instead of imageSpec, the error strings are different.
rbdUnmapCmdkRbdMissingMap = "rbd: %s: not a mapped image or snapshot"
rbdUnmapCmdNbdMissingMap = "rbd-nbd: %s is not mapped"
rbdMapConnectionTimeout = "Connection timed out"
Expand Down
4 changes: 2 additions & 2 deletions internal/util/aws_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ const (
//
// #nosec:G101, no hardcoded secrets, only configuration keys.
awsAccessKey = "AWS_ACCESS_KEY_ID"
// #nosec:G101
// #nosec:G101.
awsSecretAccessKey = "AWS_SECRET_ACCESS_KEY"
// #nosec:G101
// #nosec:G101.
awsSessionToken = "AWS_SESSION_TOKEN"
awsCMK = "AWS_CMK_ARN"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/util/cephconf.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fuse_big_writes = true

const (
cephConfigRoot = "/etc/ceph"
// CephConfigPath ceph configuration file
// CephConfigPath ceph configuration file.
CephConfigPath = "/etc/ceph/ceph.conf"

keyRing = "/etc/ceph/keyring"
Expand Down
2 changes: 1 addition & 1 deletion internal/util/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type ClusterConnection struct {
var (
// large interval and timeout, it should be longer than the maximum
// time an operation can take (until refcounting of the connections is
// available)
// available).
cpInterval = 15 * time.Minute
cpExpiry = 10 * time.Minute
connPool = NewConnPool(cpInterval, cpExpiry)
Expand Down
2 changes: 1 addition & 1 deletion internal/util/crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const (
mapperFilePrefix = "luks-rbd-"
mapperFilePathPrefix = "/dev/mapper"

// kmsConfigPath is the location of the vault config file
// kmsConfigPath is the location of the vault config file.
kmsConfigPath = "/etc/ceph-csi-encryption-kms-config/config.json"

// Passphrase size - 20 bytes is 160 bits to satisfy:
Expand Down
2 changes: 1 addition & 1 deletion internal/util/csiconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const (
// This was hardcoded once and defaults to the old value to keep backward compatibility.
defaultCsiSubvolumeGroup = "csi"

// CsiConfigFile is the location of the CSI config file
// CsiConfigFile is the location of the CSI config file.
CsiConfigFile = "/etc/ceph-csi-config/config.json"
)

Expand Down
4 changes: 2 additions & 2 deletions internal/util/idlocker.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (
)

const (
// VolumeOperationAlreadyExistsFmt string format to return for concurrent operation
// VolumeOperationAlreadyExistsFmt string format to return for concurrent operation.
VolumeOperationAlreadyExistsFmt = "an operation with the given Volume ID %s already exists"

// SnapshotOperationAlreadyExistsFmt string format to return for concurrent operation
// SnapshotOperationAlreadyExistsFmt string format to return for concurrent operation.
SnapshotOperationAlreadyExistsFmt = "an operation with the given Snapshot ID %s already exists"
)

Expand Down
6 changes: 3 additions & 3 deletions internal/util/kms.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ const (
// options.
kmsTypeKey = "encryptionKMSType"

// podNamespaceEnv ENV should be set in the cephcsi container
// podNamespaceEnv ENV should be set in the cephcsi container.
podNamespaceEnv = "POD_NAMESPACE"

// kmsConfigMapEnv env to read a ConfigMap by name
// kmsConfigMapEnv env to read a ConfigMap by name.
kmsConfigMapEnv = "KMS_CONFIGMAP_NAME"

// defaultKMSConfigMapName default ConfigMap name to fetch kms
// connection details
// connection details.
defaultKMSConfigMapName = "csi-kms-connection-details"
)

Expand Down
4 changes: 2 additions & 2 deletions internal/util/secretskms.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ import (
)

const (
// Encryption passphrase location in K8s secrets
// Encryption passphrase location in K8s secrets.
encryptionPassphraseKey = "encryptionPassphrase"

// Default KMS type
// Default KMS type.
defaultKMSType = "default"

// kmsTypeSecretsMetadata is the SecretsKMS with per-volume encryption,
Expand Down
4 changes: 2 additions & 2 deletions internal/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ func RoundOffBytes(bytes int64) int64 {

// variables which will be set during the build time.
var (
// GitCommit tell the latest git commit image is built from
// GitCommit tell the latest git commit image is built from.
GitCommit string
// DriverVersion which will be driver version
// DriverVersion which will be driver version.
DriverVersion string
)

Expand Down
2 changes: 1 addition & 1 deletion internal/util/vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const (
// #nosec
serviceAccountTokenPath = "/var/run/secrets/kubernetes.io/serviceaccount/token"

// vault configuration defaults
// vault configuration defaults.
vaultDefaultAuthPath = "/v1/auth/kubernetes/login"
vaultDefaultRole = "csi-kubernetes"
vaultDefaultNamespace = ""
Expand Down