diff --git a/console/console.go b/console/console.go index cd9a7d7..6a6a96d 100644 --- a/console/console.go +++ b/console/console.go @@ -58,8 +58,8 @@ func GetService(port int, namespace string) *apiv1.Service { Spec: apiv1.ServiceSpec{ Ports: []apiv1.ServicePort{ {Protocol: "TCP", - TargetPort: intstr.IntOrString{IntVal: int32(port)}, - Port: int32(port), + TargetPort: intstr.IntOrString{IntVal: uint32(port)}, + Port: uint32(port), Name: "console-port", }, }, @@ -81,7 +81,7 @@ func GetConsolePluginCR(consolePort int, basePath string, serviceNamespace strin Service: consolev1alpha1.ConsolePluginService{ Name: "ibm-odf-console-service", Namespace: serviceNamespace, - Port: int32(consolePort), + Port: uint32(consolePort), BasePath: basePath, }, }, diff --git a/controllers/flashsystemcluster_controller.go b/controllers/flashsystemcluster_controller.go index 891d3e7..01c2f0a 100644 --- a/controllers/flashsystemcluster_controller.go +++ b/controllers/flashsystemcluster_controller.go @@ -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") diff --git a/controllers/persistentvolume/persistentvolume_controller.go b/controllers/persistentvolume/persistentvolume_controller.go index b50ab64..a047d74 100644 --- a/controllers/persistentvolume/persistentvolume_controller.go +++ b/controllers/persistentvolume/persistentvolume_controller.go @@ -254,14 +254,14 @@ 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] @@ -269,7 +269,7 @@ func (r *PersistentVolumeWatcher) getPVManagementAddress(pv *corev1.PersistentVo 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) diff --git a/controllers/storageclass/storageclass_controller.go b/controllers/storageclass/storageclass_controller.go index e1e683f..d5e5d94 100644 --- a/controllers/storageclass/storageclass_controller.go +++ b/controllers/storageclass/storageclass_controller.go @@ -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) } } @@ -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) @@ -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