Skip to content

Commit

Permalink
Fixed golangci-lint errors
Browse files Browse the repository at this point in the history
Signed-off-by: vadimartynov <vadim.martynov@flant.com>
  • Loading branch information
vadimartynov committed Oct 31, 2024
1 parent 1f242d4 commit 1cee1a6
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ Multiline
Expect(cl.Get("client_secret").String()).To(Equal(dexClientAppSecret))
Expect(cl.Get("issuer").String()).To(Equal("https://dex.example.com/"))
Expect(cl.Get("k8s_master_uri").String()).To(Equal(a.masterURI))
Expect(cl.Get("name").String()).To(Equal(fmt.Sprintf("%s", a.id)))
Expect(cl.Get("name").String()).To(Equal(a.id))
Expect(cl.Get("redirect_uri").String()).To(Equal(fmt.Sprintf("https://kubeconfig.example.com/callback/%v", i)))
Expect(cl.Get("short_description").String()).To(Equal(a.desc))
Expect(cl.Get("scopes.0").String()).To(Equal("audience:server:client_id:kubernetes"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ type loggingDeleter struct {

func (d *loggingDeleter) Delete(name string) {
d.delegate.Delete(name)
d.logger.Warnf(d.message(name))
d.logger.Warn(d.message(name))
}

// objDeleter is the generic implementation of a Deleter interface
Expand Down
2 changes: 2 additions & 0 deletions testing/matrix/linter/rules/modules/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ func lintOneDockerfileOrWerfYAML(name, filePath, imagesPath string) errors.LintR
"MODULE001",
fmt.Sprintf("module = %s, image = %s", name, relativeFilePath),
fromTrimmed,
"%s",
message,
)
}
Expand All @@ -253,6 +254,7 @@ func lintOneDockerfileOrWerfYAML(name, filePath, imagesPath string) errors.LintR
"MODULE001",
fmt.Sprintf("module = %s, image = %s", name, relativeFilePath),
fromInstruction,
"%s",
message,
)
}
Expand Down
2 changes: 2 additions & 0 deletions testing/matrix/linter/rules/modules/monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func dirExists(moduleName, modulePath string, path ...string) (bool, errors.Lint
"MODULE060",
moduleLabel(moduleName),
path,
"%s",
err.Error(),
)
}
Expand Down Expand Up @@ -86,6 +87,7 @@ func monitoringModuleRule(moduleName, modulePath, moduleNamespace string) errors
"MODULE060",
moduleLabel(moduleName),
searchingFilePath,
"%s",
err.Error(),
)
}
Expand Down
1 change: 1 addition & 0 deletions testing/matrix/linter/rules/modules/oss.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func ossModuleRule(name, moduleRoot string) linterrors.LintRuleErrorsList {
"MODULE001",
moduleLabel(name),
nil,
"%s",
ossFileErrorMessage(err),
)

Expand Down
1 change: 1 addition & 0 deletions testing/matrix/linter/rules/modules/testgo.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ func commonTestGoForHooks(name, path string) errors.LintRuleError {
"MODULE001",
moduleLabel(name),
nil,
"%s",
errstr,
)
}
Expand Down
12 changes: 8 additions & 4 deletions testing/matrix/linter/rules/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,8 @@ func objectSecurityContext(object storage.StoreObject) errors.LintRuleError {
"MANIFEST003",
object.Identity(),
nil,
fmt.Sprintf("GetPodSecurityContext failed: %v", err),
"GetPodSecurityContext failed: %v",
err,
)
}

Expand Down Expand Up @@ -651,7 +652,8 @@ func objectHostNetworkPorts(object storage.StoreObject) errors.LintRuleError {
"MANIFEST003",
object.Identity(),
nil,
fmt.Sprintf("IsHostNetwork failed: %v", err),
"IsHostNetwork failed: %v",
err,
)
}

Expand All @@ -661,7 +663,8 @@ func objectHostNetworkPorts(object storage.StoreObject) errors.LintRuleError {
"MANIFEST003",
object.Identity(),
nil,
fmt.Sprintf("GetContainers failed: %v", err),
"GetContainers failed: %v",
err,
)
}
initContainers, err := object.GetInitContainers()
Expand All @@ -670,7 +673,8 @@ func objectHostNetworkPorts(object storage.StoreObject) errors.LintRuleError {
"MANIFEST003",
object.Identity(),
nil,
fmt.Sprintf("GetInitContainers failed: %v", err),
"GetInitContainers failed: %v",
err,
)
}
containers = append(containers, initContainers...)
Expand Down

0 comments on commit 1cee1a6

Please sign in to comment.