From c43b8088472091ed65dfb0cdfc1ec160184095ec Mon Sep 17 00:00:00 2001 From: Mircea-Pavel ANTON Date: Sun, 29 Sep 2024 16:50:30 +0000 Subject: [PATCH] add doc comment --- pkg/substitute/pathsubst.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/substitute/pathsubst.go b/pkg/substitute/pathsubst.go index b6510278..583042f1 100644 --- a/pkg/substitute/pathsubst.go +++ b/pkg/substitute/pathsubst.go @@ -8,6 +8,11 @@ import ( "gopkg.in/yaml.v2" ) +// SubstituteRelativePaths will replace all relative paths in the config file to new paths, +// relative to the working dir from which the CLI has been called. +// When using the `--config-file` flag to point to a file not in the current dir, +// relative path evaluation would fail. This function basically prepends the path to the config +// file to the relative paths in the config file so that their evaluation no longer fails. func SubstituteRelativePaths(configFilePath string, yamlContent []byte) ([]byte, error) { // Get the directory of the YAML file yamlDir := filepath.Dir(configFilePath)