Skip to content

Commit

Permalink
refact(log): remove cstor prefix from localPV log and alert messages (#…
Browse files Browse the repository at this point in the history
…1638)

Signed-off-by: Akhil Mohan <[email protected]>
  • Loading branch information
akhilerm authored Mar 26, 2020
1 parent c37fbf8 commit 064f1d5
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
16 changes: 8 additions & 8 deletions cmd/provisioner-localpv/app/provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ func (p *Provisioner) Provision(opts pvController.VolumeOptions) (*v1.Persistent
return nil, fmt.Errorf("PV with BlockMode is not supported with StorageType %v", stgType)
}
alertlog.Logger.Errorw("",
"eventcode", "cstor.local.pv.provision.failure",
"msg", "Failed to provision CStor Local PV",
"eventcode", "local.pv.provision.failure",
"msg", "Failed to provision Local PV",
"rname", opts.PVName,
"reason", "StorageType not supported",
"storagetype", stgType,
Expand Down Expand Up @@ -164,8 +164,8 @@ func (p *Provisioner) Delete(pv *v1.PersistentVolume) (err error) {
err := p.DeleteBlockDevice(pv)
if err != nil {
alertlog.Logger.Errorw("",
"eventcode", "cstor.local.pv.delete.failure",
"msg", "Failed to delete CStor Local PV",
"eventcode", "local.pv.delete.failure",
"msg", "Failed to delete Local PV",
"rname", pv.Name,
"reason", "failed to delete block device",
"storagetype", pvType,
Expand All @@ -177,8 +177,8 @@ func (p *Provisioner) Delete(pv *v1.PersistentVolume) (err error) {
err = p.DeleteHostPath(pv)
if err != nil {
alertlog.Logger.Errorw("",
"eventcode", "cstor.local.pv.delete.failure",
"msg", "Failed to delete CStor Local PV",
"eventcode", "local.pv.delete.failure",
"msg", "Failed to delete Local PV",
"rname", pv.Name,
"reason", "failed to delete host path",
"storagetype", pvType,
Expand All @@ -188,8 +188,8 @@ func (p *Provisioner) Delete(pv *v1.PersistentVolume) (err error) {
}
klog.Infof("Retained volume %v", pv.Name)
alertlog.Logger.Infow("",
"eventcode", "cstor.local.pv.delete.success",
"msg", "Successfully deleted CStor Local PV",
"eventcode", "local.pv.delete.success",
"msg", "Successfully deleted Local PV",
"rname", pv.Name,
)
return nil
Expand Down
12 changes: 6 additions & 6 deletions cmd/provisioner-localpv/app/provisioner_blockdevice.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ func (p *Provisioner) ProvisionBlockDevice(opts pvController.VolumeOptions, volu
if err != nil {
klog.Infof("Initialize volume %v failed: %v", name, err)
alertlog.Logger.Errorw("",
"eventcode", "cstor.local.pv.provision.failure",
"msg", "Failed to provision CStor Local PV",
"eventcode", "local.pv.provision.failure",
"msg", "Failed to provision Local PV",
"rname", opts.PVName,
"reason", "Block device initialization failed",
"storagetype", stgType,
Expand Down Expand Up @@ -102,17 +102,17 @@ func (p *Provisioner) ProvisionBlockDevice(opts pvController.VolumeOptions, volu

if err != nil {
alertlog.Logger.Errorw("",
"eventcode", "cstor.local.pv.provision.failure",
"msg", "Failed to provision CStor Local PV",
"eventcode", "local.pv.provision.failure",
"msg", "Failed to provision Local PV",
"rname", opts.PVName,
"reason", "Building volume failed",
"storagetype", stgType,
)
return nil, err
}
alertlog.Logger.Infow("",
"eventcode", "cstor.local.pv.provision.success",
"msg", "Successfully provisioned CStor Local PV",
"eventcode", "local.pv.provision.success",
"msg", "Successfully provisioned Local PV",
"rname", opts.PVName,
"storagetype", stgType,
)
Expand Down
16 changes: 8 additions & 8 deletions cmd/provisioner-localpv/app/provisioner_hostpath.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ func (p *Provisioner) ProvisionHostPath(opts pvController.VolumeOptions, volumeC
path, err := volumeConfig.GetPath()
if err != nil {
alertlog.Logger.Errorw("",
"eventcode", "cstor.local.pv.provision.failure",
"msg", "Failed to provision CStor Local PV",
"eventcode", "local.pv.provision.failure",
"msg", "Failed to provision Local PV",
"rname", opts.PVName,
"reason", "Unable to get volume config",
"storagetype", stgType,
Expand All @@ -68,8 +68,8 @@ func (p *Provisioner) ProvisionHostPath(opts pvController.VolumeOptions, volumeC
if iErr != nil {
klog.Infof("Initialize volume %v failed: %v", name, iErr)
alertlog.Logger.Errorw("",
"eventcode", "cstor.local.pv.provision.failure",
"msg", "Failed to provision CStor Local PV",
"eventcode", "local.pv.provision.failure",
"msg", "Failed to provision Local PV",
"rname", opts.PVName,
"reason", "Volume initialization failed",
"storagetype", stgType,
Expand Down Expand Up @@ -109,17 +109,17 @@ func (p *Provisioner) ProvisionHostPath(opts pvController.VolumeOptions, volumeC

if err != nil {
alertlog.Logger.Errorw("",
"eventcode", "cstor.local.pv.provision.failure",
"msg", "Failed to provision CStor Local PV",
"eventcode", "local.pv.provision.failure",
"msg", "Failed to provision Local PV",
"rname", opts.PVName,
"reason", "failed to build persistent volume",
"storagetype", stgType,
)
return nil, err
}
alertlog.Logger.Infow("",
"eventcode", "cstor.local.pv.provision.success",
"msg", "Successfully provisioned CStor Local PV",
"eventcode", "local.pv.provision.success",
"msg", "Successfully provisioned Local PV",
"rname", opts.PVName,
"storagetype", stgType,
)
Expand Down

0 comments on commit 064f1d5

Please sign in to comment.