[hermes] soteria: go:S1192 #49
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
SonarQube reports go:S1192 in
internal/k8s/job_manifests.go. The build is green; this is a standing finding, not a failure.What is wrong
The string literal "/cache" is duplicated three times in internal/k8s/job_manifests.go: as the cache VolumeMount path in buildBackupJob, as the cache VolumeMount path in buildRestoreJob, and as the RESTIC_CACHE_DIR value in resticEnv. These three occurrences must stay in sync (restic writes its cache to RESTIC_CACHE_DIR, which must be the emptyDir mount path), so they should share one named constant.
Ariadne opened no pull request for it: no automated patch was possible for this finding.
Facts
internal/k8s/job_manifests.go:45)Suggested fix (not applied)
Hermes could not open a pull request for this, so the change below was not written, validated, or pushed anywhere. It is a starting point for whoever picks this up, not a reviewed patch.
internal/k8s/job_manifests.go— Introduce a package-level constant for the cache mount path and use it at all three sites. Add the const after the import block, then replace the literal in the buildBackupJob VolumeMounts, the buildRestoreJob VolumeMounts, and the RESTIC_CACHE_DIR env var in resticEnv. Behaviour is unchanged: the constant has exactly the same value, and the shell commands in restoreCommand that reference /cache/restore are left as-is (they use the longer literal "/cache/restore", which the rule does not flag).Links
/api/admin/audit/events, event typeshermes_autotriage_incidentandhermes_autotriage_diagnosis.Filed automatically by Ariadne from a Hermes Agent diagnosis (run run_8c11c148b87f438caeb17585d8d2ede6). Hermes has no write access to this repository; no files or infrastructure were changed.