Skip to content

Commit

Permalink
cleanup: resolve godot linter
Browse files Browse the repository at this point in the history
This commit resolves godot linter issue
which says "Comment should end in a period (godot)".

Updates: #1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
  • Loading branch information
yati1998 committed Jul 8, 2021
1 parent 853d77d commit 8cf0f52
Show file tree
Hide file tree
Showing 21 changed files with 65 additions and 65 deletions.
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
12 changes: 6 additions & 6 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 All @@ -56,7 +56,7 @@ var (
)

func deployRBDPlugin() {
// delete objects deployed by rook
// delete objects deployed by rook.
data, err := replaceNamespaceInTemplate(rbdDirPath + rbdProvisionerRBAC)
if err != nil {
e2elog.Failf("failed to read content from %s with error %v", rbdDirPath+rbdProvisionerRBAC, err)
Expand Down Expand Up @@ -172,7 +172,7 @@ func validateRBDImageCount(f *framework.Framework, count int, pool string) {
var _ = Describe("RBD", func() {
f := framework.NewDefaultFramework("rbd")
var c clientset.Interface
// deploy RBD CSI
// deploy RBD CSI.
BeforeEach(func() {
if !testRBD || upgradeTesting {
Skip("Skipping RBD E2E")
Expand Down Expand Up @@ -207,7 +207,7 @@ var _ = Describe("RBD", func() {
e2elog.Failf("failed to create storageclass with error %v", err)
}
}
// create rbd provisioner secret
// create rbd provisioner secret.
key, err := createCephUser(f, keyringRBDProvisionerUsername, rbdProvisionerCaps("", ""))
if err != nil {
e2elog.Failf("failed to create user %s with error %v", keyringRBDProvisionerUsername, err)
Expand All @@ -216,7 +216,7 @@ var _ = Describe("RBD", func() {
if err != nil {
e2elog.Failf("failed to create provisioner secret with error %v", err)
}
// create rbd plugin secret
// create rbd plugin secret.
key, err = createCephUser(f, keyringRBDNodePluginUsername, rbdNodePluginCaps("", ""))
if err != nil {
e2elog.Failf("failed to create user %s with error %v", keyringRBDNodePluginUsername, err)
Expand Down
8 changes: 4 additions & 4 deletions e2e/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
const (
defaultNs = "default"
defaultSCName = ""
// vaultBackendPath is the default VAULT_BACKEND_PATH for secrets
// vaultBackendPath is the default VAULT_BACKEND_PATH for secrets.
vaultBackendPath = "secret/"
// vaultPassphrasePath is an advanced configuration option, only
// available for the VaultKMS (not VaultTokensKMS) provider.
Expand All @@ -40,19 +40,19 @@ 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"

// vaultTokens KMS type
// vaultTokens KMS type.
vaultTokens = "vaulttokens"
noError = ""

noKms = ""
)

var (
// cli flags
// cli flags.
deployTimeout int
deployCephFS bool
deployRBD bool
Expand Down
14 changes: 7 additions & 7 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 Expand Up @@ -100,11 +100,11 @@ func (fs *Driver) Run(conf *util.Config) {
util.FatalLogMsg("failed to write ceph configuration file: %v", err)
}

// Use passed in instance ID, if provided for omap suffix naming
// Use passed in instance ID, if provided for omap suffix naming.
if conf.InstanceID != "" {
CSIInstanceID = conf.InstanceID
}
// Create an instance of the volume journal
// Create an instance of the volume journal.
volJournal = journal.NewCSIVolumeJournalWithNamespace(CSIInstanceID, radosNamespace)

snapJournal = journal.NewCSISnapshotJournalWithNamespace(CSIInstanceID, radosNamespace)
Expand Down
8 changes: 4 additions & 4 deletions internal/cephfs/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ 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")

// ErrInvalidVolID is returned when a CSI passed VolumeID is not conformant to any known volume ID
Expand All @@ -40,7 +40,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 @@ -50,7 +50,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
24 changes: 12 additions & 12 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 Expand Up @@ -104,27 +104,27 @@ func (r *Driver) Run(conf *util.Config) {
var err error
var topology map[string]string

// Create ceph.conf for use with CLI commands
// Create ceph.conf for use with CLI commands.
if err = util.WriteCephConfig(); err != nil {
util.FatalLogMsg("failed to write ceph configuration file (%v)", err)
}

// Use passed in instance ID, if provided for omap suffix naming
// Use passed in instance ID, if provided for omap suffix naming.
if conf.InstanceID != "" {
CSIInstanceID = conf.InstanceID
}

// update clone soft and hard limit
// update clone soft and hard limit.
rbdHardMaxCloneDepth = conf.RbdHardMaxCloneDepth
rbdSoftMaxCloneDepth = conf.RbdSoftMaxCloneDepth
skipForceFlatten = conf.SkipForceFlatten
maxSnapshotsOnImage = conf.MaxSnapshotsOnImage
minSnapshotsOnImageToStartFlatten = conf.MinSnapshotsOnImage
// Create instances of the volume and snapshot journal
// Create instances of the volume and snapshot journal.
volJournal = journal.NewCSIVolumeJournal(CSIInstanceID)
snapJournal = journal.NewCSISnapshotJournal(CSIInstanceID)

// Initialize default library driver
// Initialize default library driver.
r.cd = csicommon.NewCSIDriver(conf.DriverName, util.DriverVersion, conf.NodeID)
if r.cd == nil {
util.FatalLogMsg("Failed to initialize CSI Driver.")
Expand All @@ -140,13 +140,13 @@ func (r *Driver) Run(conf *util.Config) {
// general
// In addition, we want to add the remaining modes like MULTI_NODE_READER_ONLY,
// MULTI_NODE_SINGLE_WRITER etc, but need to do some verification of RO modes first
// will work those as follow up features
// will work those as follow up features.
r.cd.AddVolumeCapabilityAccessModes(
[]csi.VolumeCapability_AccessMode_Mode{csi.VolumeCapability_AccessMode_SINGLE_NODE_WRITER,
csi.VolumeCapability_AccessMode_MULTI_NODE_MULTI_WRITER})
}

// Create GRPC servers
// Create GRPC servers.
r.ids = NewIdentityServer(r.cd)

if conf.IsNodeServer {
Expand Down
16 changes: 8 additions & 8 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 Expand Up @@ -121,7 +121,7 @@ func (ri *rbdImage) copyEncryptionConfig(cp *rbdImage) error {
"set!? Call stack: %s", ri, cp, ri.VolID, util.CallStack())
}

// get the unencrypted passphrase
// get the unencrypted passphrase.
passphrase, err := ri.encryption.GetCryptoPassphrase(ri.VolID)
if err != nil {
return fmt.Errorf("failed to fetch passphrase for %q: %w",
Expand All @@ -133,14 +133,14 @@ func (ri *rbdImage) copyEncryptionConfig(cp *rbdImage) error {
cp.encryption.SetDEKStore(cp)
}

// re-encrypt the plain passphrase for the cloned volume
// re-encrypt the plain passphrase for the cloned volume.
err = cp.encryption.StoreCryptoPassphrase(cp.VolID, passphrase)
if err != nil {
return fmt.Errorf("failed to store passphrase for %q: %w",
cp, err)
}

// copy encryption status for the original volume
// copy encryption status for the original volume.
status, err := ri.checkRbdImageEncrypted(context.TODO())
if err != nil {
return fmt.Errorf("failed to get encryption status for %q: %w",
Expand All @@ -162,10 +162,10 @@ func (ri *rbdImage) repairEncryptionConfig(dest *rbdImage) error {
return nil
}

// if ri is encrypted, copy its configuration in case it is missing
// if ri is encrypted, copy its configuration in case it is missing.
if !dest.isEncrypted() {
// dest needs to be connected to the cluster, otherwise it will
// not be possible to write any metadata
// not be possible to write any metadata.
if dest.conn == nil {
dest.conn = ri.conn.Copy()
}
Expand Down Expand Up @@ -276,7 +276,7 @@ func (ri *rbdImage) configureEncryption(kmsID string, credentials map[string]str
ri.encryption, err = util.NewVolumeEncryption(kmsID, kms)

// if the KMS can not store the DEK itself, we'll store it in the
// metadata of the RBD image itself
// metadata of the RBD image itself.
if errors.Is(err, util.ErrDEKStoreNeeded) {
ri.encryption.SetDEKStore(ri)
}
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
4 changes: 2 additions & 2 deletions 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 Expand Up @@ -102,7 +102,7 @@ func rbdGetDeviceList(ctx context.Context, accessType string) ([]rbdDeviceInfo,
err)
}

// convert output to a rbdDeviceInfo list for consumers
// convert output to a rbdDeviceInfo list for consumers.
if accessType == accessTypeNbd {
for _, device := range nbdDeviceList {
rbdDeviceList = append(
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
Loading

0 comments on commit 8cf0f52

Please sign in to comment.