Skip to content

Commit

Permalink
trial
Browse files Browse the repository at this point in the history
  • Loading branch information
uriziv1 committed Aug 26, 2024
1 parent 6267ba6 commit 2d11d1a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion console/console.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const MainBasePath = "/"
const CompatibilityBasePath = "/compatibility/"

func safeIntToInt32(val int) int32 {
// Verify no integer overflow conversion int -> int32 (gosec)
// Verify no integer overflow conversion int -> int32 (gosec G115)
if val < math.MinInt32 || val > math.MaxInt32 {
panic("safeIntToInt32 - integer overflow")
}
Expand Down
2 changes: 1 addition & 1 deletion controllers/flashsystemcluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ func (r *FlashSystemClusterReconciler) ensureDefaultStorageClass(instance *odfv1
msg := "storageClass with same name already exists and doesn't match ODF-FS requirements. " +
"Deletion of existing StorageClass is required. Failing FlashSystemCluster reconcile"
r.createEvent(instance, corev1.EventTypeWarning, util.DeletedDuplicatedStorageClassReason, msg)
return fmt.Errorf(msg)
return fmt.Errorf("%s", msg)
}

r.Log.Info("create default StorageClass")
Expand Down
6 changes: 3 additions & 3 deletions controllers/persistentvolume/persistentvolume_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,22 +254,22 @@ func (r *PersistentVolumeWatcher) getPVManagementAddress(pv *corev1.PersistentVo
if pvVolumeHandle == "" {
msg := "volumeHandle cannot be empty"
r.Log.Error(nil, msg)
return "", fmt.Errorf(msg)
return "", fmt.Errorf("%s", msg)
}

pvVolumeHandleList := strings.Split(pvVolumeHandle, ":")
if len(pvVolumeHandleList) < 2 {
msg := "volumeHandle must contain system id"
r.Log.Error(nil, msg)
return "", fmt.Errorf(msg)
return "", fmt.Errorf("%s", msg)
}

pvMgmtId := pvVolumeHandleList[1]
matchSecretMgmtData, exist := secretMgmtDataByMgmtId[pvMgmtId]
if !exist {
msg := "could not find system id in topology Secret"
r.Log.Error(nil, msg)
return "", fmt.Errorf(msg)
return "", fmt.Errorf("%s", msg)
}

pvMgmtAddr = matchSecretMgmtData.(map[string]interface{})[util.SecretManagementAddressKey].(string)
Expand Down
6 changes: 3 additions & 3 deletions controllers/storageclass/storageclass_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ func (r *StorageClassWatcher) ensureConfigMapUpdated(request reconcile.Request,
if !fscExist {
msg := "failed to get FlashSystemCluster entry from pools ConfigMap"
r.Log.Error(nil, msg, "FlashSystemCluster", fscName, "ConfigMap", configMap.Name)
return fmt.Errorf(msg)
return fmt.Errorf("%s", msg)
}
}

Expand Down Expand Up @@ -370,7 +370,7 @@ func (r *StorageClassWatcher) extractPoolName(sc storagev1.StorageClass, mgmtDat
if !ok {
msg := "failed to find the management id in the \"by_management_id\" parameter in the StorageClass"
r.Log.Error(nil, msg, "management id", mgmtId)
return poolName, fmt.Errorf(msg)
return poolName, fmt.Errorf("%s", msg)
}
byMgmtIdData := mgmtData.(map[string]interface{})
poolName, ok = byMgmtIdData[util.CsiIBMBlockScPool].(string)
Expand Down Expand Up @@ -437,7 +437,7 @@ func (r *StorageClassWatcher) addStorageClassToConfigMap(configMap corev1.Config
if !exist {
msg := "failed to get FlashSystemCluster entry from pools ConfigMap"
r.Log.Error(nil, msg, "FlashSystemCluster", fscName, "ConfigMap", configMap.Name)
return fmt.Errorf(msg)
return fmt.Errorf("%s", msg)
}

var fsMap util.FlashSystemClusterMapContent
Expand Down

0 comments on commit 2d11d1a

Please sign in to comment.