Skip to content

Commit 00a9472

Browse files
committed
Ignore G115 at golangi.yml level
1 parent 32bd066 commit 00a9472

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

.golangci.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ linters:
2828
- rowserrcheck
2929
- gosec
3030
- unconvert
31-
31+
linters-settings:
32+
gosec:
33+
excludes:
34+
- G115
3235
run:
3336
modules-download-mode: mod
3437
# timeout for analysis, e.g. 30s, 5m, default is 1m

pkg/agent/replica_set_port_manager.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,18 @@ func (r *ReplicaSetPortManager) GetServicePorts() []corev1.ServicePort {
5555

5656
if !portChangeRequired || oldPort == r.expectedPort {
5757
return []corev1.ServicePort{{
58-
Port: int32(r.expectedPort), // #nosec G115
58+
Port: int32(r.expectedPort),
5959
Name: "mongodb",
6060
}}
6161
}
6262

6363
servicePorts := []corev1.ServicePort{
6464
{
65-
Port: int32(r.expectedPort), // #nosec G115
65+
Port: int32(r.expectedPort),
6666
Name: "mongodb-new",
6767
},
6868
{
69-
Port: int32(oldPort), // #nosec G115
69+
Port: int32(oldPort),
7070
Name: "mongodb",
7171
},
7272
}

pkg/kube/probes/probes.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -31,28 +31,28 @@ func WithExecCommand(cmd []string) Modification {
3131

3232
func WithFailureThreshold(failureThreshold int) Modification {
3333
return func(probe *corev1.Probe) {
34-
probe.FailureThreshold = int32(failureThreshold) // #nosec G115
34+
probe.FailureThreshold = int32(failureThreshold)
3535
}
3636
}
3737

3838
func WithInitialDelaySeconds(initialDelaySeconds int) Modification {
3939
return func(probe *corev1.Probe) {
40-
probe.InitialDelaySeconds = int32(initialDelaySeconds) // #nosec G115
40+
probe.InitialDelaySeconds = int32(initialDelaySeconds)
4141
}
4242
}
4343
func WithSuccessThreshold(successThreshold int) Modification {
4444
return func(probe *corev1.Probe) {
45-
probe.SuccessThreshold = int32(successThreshold) // #nosec G115
45+
probe.SuccessThreshold = int32(successThreshold)
4646
}
4747
}
4848
func WithPeriodSeconds(periodSeconds int) Modification {
4949
return func(probe *corev1.Probe) {
50-
probe.PeriodSeconds = int32(periodSeconds) // #nosec G115
50+
probe.PeriodSeconds = int32(periodSeconds)
5151
}
5252
}
5353
func WithTimeoutSeconds(timeoutSeconds int) Modification {
5454
return func(probe *corev1.Probe) {
55-
probe.TimeoutSeconds = int32(timeoutSeconds) // #nosec G115
55+
probe.TimeoutSeconds = int32(timeoutSeconds)
5656
}
5757
}
5858

0 commit comments

Comments
 (0)