Skip to content

Commit 15a5465

Browse files
authored
docs: catch some missed docs -> guide (#9850)
1 parent 51de2bd commit 15a5465

File tree

12 files changed

+26
-25
lines changed

12 files changed

+26
-25
lines changed

docs/guide/configuration/cache.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ $ trivy server --cache-backend redis://localhost:6379 \
100100
[trivy-java-db]: ./db.md
101101
[misconf-checks]: ../scanner/misconfiguration/check/builtin.md
102102
[boltdb]: https://github.com/etcd-io/bbolt
103-
[parallel-run]: https://trivy.dev/{{ git.tag}}/docs/references/troubleshooting/#running-in-parallel-takes-same-time-as-series-run
103+
[parallel-run]: https://trivy.dev/docs/{{ git.tag}}/guide/references/troubleshooting/#running-in-parallel-takes-same-time-as-series-run
104104

105105
[^1]: Downloaded when scanning for vulnerabilities
106106
[^2]: Downloaded when scanning `jar/war/par/ear` files

pkg/commands/artifact/run.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ func checkOptions(ctx context.Context, opts flag.Options, targetKind TargetKind)
469469
log.WarnContext(ctx,
470470
fmt.Sprintf(
471471
"Trivy runs in client/server mode, but misconfiguration and secret scanning will be done on the client side, see %s",
472-
doc.URL("/docs/references/modes/client-server", ""),
472+
doc.URL("guide/references/modes/client-server", ""),
473473
),
474474
)
475475
}
@@ -603,7 +603,7 @@ func (r *runner) initScannerConfig(ctx context.Context, opts flag.Options) (Scan
603603
strings.Join(xstrings.ToStringSlice(nonSecrets), ",")))
604604
}
605605
// e.g. https://trivy.dev/docs/latest/scanner/secret/#recommendation
606-
logger.Info(fmt.Sprintf("Please see %s for faster secret detection", doc.URL("/docs/scanner/secret/", "recommendation")))
606+
logger.Info(fmt.Sprintf("Please see %s for faster secret detection", doc.URL("guide/scanner/secret/", "recommendation")))
607607
} else {
608608
opts.SecretConfigPath = ""
609609
}

pkg/commands/run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
)
1313

1414
const (
15-
troubleshootingDocPath = "/docs/references/troubleshooting/"
15+
troubleshootingDocPath = "guide/references/troubleshooting/"
1616
lockDocFragment = "database-and-cache-lock-errors"
1717
timeoutDocFragment = "timeout"
1818
)

pkg/dependency/parser/java/pom/artifact.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ var (
1717
emptyVersionWarn = sync.OnceFunc(func() {
1818
log.WithPrefix("pom").Warn("Dependency version cannot be determined. Child dependencies will not be found.",
1919
// e.g. https://trivy.dev/docs/latest/coverage/language/java/#empty-dependency-version
20-
log.String("details", doc.URL("/docs/coverage/language/java/", "empty-dependency-version")))
20+
log.String("details", doc.URL("guide/coverage/language/java/", "empty-dependency-version")))
2121
})
2222
)
2323

pkg/fanal/analyzer/imgconf/dockerfile/dockerfile.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323

2424
var (
2525
disabledChecks = set.New("AVD-DS-0007", "AVD-DS-0016")
26-
reason = "See " + doc.URL("docs/target/container_image", "disabled-checks")
26+
reason = "See " + doc.URL("guide/target/container_image", "disabled-checks")
2727
)
2828

2929
const analyzerVersion = 1

pkg/fanal/analyzer/language/conda/environment/environment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func (*parser) Parse(ctx context.Context, r xio.ReadSeekerAt) ([]types.Package,
4444
// Show log once per file
4545
once.Do(func() {
4646
// e.g. https://trivy.dev/docs/latest/coverage/os/conda/#license_1
47-
log.WithPrefix("conda").Debug(fmt.Sprintf("License not found. See %s for details.", doc.URL("docs/coverage/os/conda/", "license_1")),
47+
log.WithPrefix("conda").Debug(fmt.Sprintf("License not found. See %s for details.", doc.URL("guide/coverage/os/conda/", "license_1")),
4848
log.String("pkg", pkg.Name), log.Err(err))
4949
})
5050
}

pkg/iac/rego/load.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,15 +272,15 @@ func (s *Scanner) handleModulesMetadata(path string, module *ast.Module) {
272272
s.logger.Warn(
273273
"Module has legacy input format - please update to use annotations",
274274
log.FilePath(module.Package.Location.File),
275-
log.String("details", doc.URL("/docs/scanner/misconfiguration/custom", "input")),
275+
log.String("details", doc.URL("guide/scanner/misconfiguration/custom", "input")),
276276
)
277277
}
278278

279279
if moduleHasLegacyMetadataFormat(module) {
280280
s.logger.Warn(
281281
"Module has legacy metadata format - please update to use annotations",
282282
log.FilePath(module.Package.Location.File),
283-
log.String("details", doc.URL("/docs/scanner/misconfiguration/custom", "metadata")),
283+
log.String("details", doc.URL("guide/scanner/misconfiguration/custom", "metadata")),
284284
)
285285
return
286286
}

pkg/oci/artifact.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ func shouldTryOtherRepo(err error) bool {
262262
for _, diagnostic := range terr.Errors {
263263
// For better user experience
264264
if diagnostic.Code == transport.DeniedErrorCode || diagnostic.Code == transport.UnauthorizedErrorCode {
265-
// e.g. https://trivy.dev/docs/latest/references/troubleshooting/#db
266-
log.Warnf("See %s", doc.URL("/docs/references/troubleshooting/", "db"))
265+
// e.g. https://trivy.dev/docs/latest/guide/references/troubleshooting/#db
266+
log.Warnf("See %s", doc.URL("guide/references/troubleshooting/", "db"))
267267
break
268268
}
269269
}

pkg/report/table/vulnerability.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func (r *vulnerabilityRenderer) renderDetectedVulnerabilities(result types.Resul
9393
if os.Getenv(envDisableNotice) != "" || os.Getenv("CI") == "" {
9494
return
9595
}
96-
_, _ = color.New(color.FgCyan).Fprintf(r.w, vexNotice, doc.URL("docs/supply-chain/vex/repo", "publishing-vex-documents"))
96+
_, _ = color.New(color.FgCyan).Fprintf(r.w, vexNotice, doc.URL("guide/supply-chain/vex/repo", "publishing-vex-documents"))
9797
})
9898

9999
tw := newTableWriter(r.w, r.isTerminal)

pkg/version/doc/doc.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@ const devVersion = "dev"
1515
// BaseURL returns the base URL for the versioned documentation
1616
func BaseURL(ver string) *url.URL {
1717
ver = canonicalVersion(ver)
18+
path := path.Join("docs", ver)
1819
return &url.URL{
1920
Scheme: "https",
2021
Host: "trivy.dev",
21-
Path: ver,
22+
Path: path,
2223
}
2324
}
2425

0 commit comments

Comments
 (0)