Merge pull request #11920 from rook/mergify/bp/release-1.10/pr-11904

ci: update golangci-lint version as it fails for some k8s version in … (backport #11904)
This commit is contained in:
mergify[bot] authored and GitHub committed 2023-03-20 16:55:14 +00:00
commit b358fc04b6
14 files changed
+21 -24

No files matched your search

+1 -1
View File
@@ -34,7 +34,7 @@ jobs:
uses: golangci/golangci-lint-action@v2
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.48.0
version: v1.51.2
# Optional: working directory, useful for monorepos
# working-directory: somedir
+4 -5
View File
@@ -75,11 +75,10 @@ var (
type kmipKMS struct {
// standard KMIP configuration options
endpoint string
tlsConfig *tls.Config
uniqueIdentifier string
readTimeout uint8
writeTimeout uint8
endpoint string
tlsConfig *tls.Config
readTimeout uint8
writeTimeout uint8
}
// InitKKMIP initializes the KMIP KMS.
+1 -1
View File
@@ -148,7 +148,7 @@ func configTLS(ctx context.Context, clusterdContext *clusterd.Context, namespace
}
// Write into a file
err = ioutil.WriteFile(file.Name(), secret.Data[tlsSecretKeyToCheck(tlsOption)], 0444)
err = os.WriteFile(file.Name(), secret.Data[tlsSecretKeyToCheck(tlsOption)], 0400)
if err != nil {
return nil, removeCertFiles, errors.Wrapf(err, "failed to write k8s secret %q content to a file", tlsSecretName)
}
+1 -3
View File
@@ -273,9 +273,7 @@ func (a *OsdAgent) initializeBlockPVC(context *clusterd.Context, devices *Device
if device.Data == -1 {
logger.Infof("configuring new device %q", device.Config.Name)
var err error
var deviceArg string
deviceArg = device.Config.Name
deviceArg := device.Config.Name
immediateExecuteArgs := append(baseArgs, []string{
"--data",
+1 -1
View File
@@ -343,7 +343,7 @@ func TestConfigureCVDevices(t *testing.T) {
executor.MockExecuteCommandWithOutput = func(command string, args ...string) (string, error) {
logger.Infof("[MockExecuteCommandWithOutput] %s %v", command, args)
if command == "lsblk" && args[0] == mountedDev {
return fmt.Sprintf(`SIZE="17179869184" ROTA="1" RO="0" TYPE="lvm" PKNAME="" NAME="/mnt/set1-data-0-rpf2k" KNAME="/dev/dm-1, a ...interface{})`), nil
return `SIZE="17179869184" ROTA="1" RO="0" TYPE="lvm" PKNAME="" NAME="/mnt/set1-data-0-rpf2k" KNAME="/dev/dm-1, a ...interface{})`, nil
}
if command == "sgdisk" {
return "Disk identifier (GUID): 18484D7E-5287-4CE9-AC73-D02FB69055CE", nil
+3 -1
View File
@@ -53,5 +53,7 @@ func GetPortFromEndpoint(endpoint string) int32 {
logger.Errorf("failed to convert %q to integer. %v", portString, err)
}
}
return int32(port)
//#nosec G109 -- This is just a lower bit to bigger bit conversion
portInt32 := int32(port)
return portInt32
}
+1 -1
View File
@@ -87,7 +87,7 @@ func TestGetTcmallocMaxTotalThreadCacheBytes(t *testing.T) {
assert.Equal(t, "67108864", v.Value)
// Read the file now
err = ioutil.WriteFile(file.Name(), sysconfig, 0444)
err = os.WriteFile(file.Name(), sysconfig, 0400)
assert.NoError(t, err)
v = getTcmallocMaxTotalThreadCacheBytes("")
assert.Equal(t, "134217728", v.Value)
@@ -624,7 +624,7 @@ func (p *Provisioner) setAdditionalSettings(options *apibkt.BucketOptions) error
}
}
if *&objectUser.UserQuota.MaxSize != &maxSizeInt64 {
if objectUser.UserQuota.MaxSize != &maxSizeInt64 {
err = p.adminOpsClient.SetUserQuota(p.clusterInfo.Context, admin.QuotaSpec{UID: p.cephUserName, MaxSize: &maxSizeInt64})
if err != nil {
return errors.Wrapf(err, "failed to set MaxSize=%v to user %q", maxSizeInt64, p.cephUserName)
+1 -3
View File
@@ -355,9 +355,7 @@ func TestCephObjectStoreController(t *testing.T) {
objectStore,
}
for i := range additionalObjects {
objects = append(objects, additionalObjects[i])
}
objects = append(objects, additionalObjects...)
executor := &exectest.MockExecutor{
MockExecuteCommandWithOutput: func(command string, args ...string) (string, error) {
+1 -3
View File
@@ -357,9 +357,7 @@ func ListDevicesInUse(ctx context.Context, clusterdContext *clusterd.Context, na
logger.Warningf("failed to unmarshal %s", deviceJson)
continue
}
for i := range d {
devices = append(devices, d[i])
}
devices = append(devices, d...)
}
logger.Debugf("devices in use %+v", devices)
return devices, nil
+3
View File
@@ -141,6 +141,9 @@ func NewComplexClientset(t *testing.T) *fake.Clientset {
}
obj := createAction.GetObject()
objMeta, err := meta.Accessor(obj)
if err != nil {
panic(fmt.Errorf("failed to objMeta"))
}
resource := action.GetResource().Resource
name := objMeta.GetName()
+1 -2
View File
@@ -17,7 +17,6 @@ limitations under the License.
package test
import (
"errors"
"fmt"
"os"
"os/exec"
@@ -139,5 +138,5 @@ func TestMockExecHelperProcess(t *testing.T) {
}
func FakeTimeoutError(text string) error {
return errors.New(fmt.Sprintf("exec timeout waiting for %s", text))
return fmt.Errorf("exec timeout waiting for %s", text)
}
+1 -1
View File
@@ -71,7 +71,7 @@ func CreateTempFile(content string) (*os.File, error) {
}
// Write content into file
err = ioutil.WriteFile(file.Name(), []byte(content), 0440)
err = os.WriteFile(file.Name(), []byte(content), 0400)
if err != nil {
return nil, errors.Wrap(err, "failed to write content into file")
}
+1 -1
View File
@@ -441,7 +441,7 @@ func cleanupFilesystemConsumer(helper *clients.TestClient, k8sh *utils.K8sHelper
}
isPVListZero := k8sh.WaitUntilZeroPVs()
if !isPVListZero {
assert.Fail(s.T(), fmt.Sprintf("PV list is not zero"))
assert.Fail(s.T(), "PV list is not zero")
}
logger.Infof("File system consumer deleted")
}