Skip to content

Use info log entry for handled errors in Chart catalog population

Hossein Pursultani requested to merge hp-use-info-log into master

This MR uses info log entry (instead of error entries) for handled errors in Chart catalog population.

This leaves fewer traces in the log output which do not necessarily contain useful information, for example currently Operator starts with the following log output:

2022-06-28T07:05:12.765Z        ERROR   entry does not contain a chart  {"path": "/charts", "isDirectory": true, "error": "Chart.yaml file is missing", "errorVerbose": "Chart.yaml file is missing\nhelm.sh/helm/v3/pkg/chart/loader.LoadFiles\n\t/go/pkg/mod/helm.sh/helm/v3@v3.7.0/pkg/chart/loader/load.go:158\nhelm.sh/helm/v3/pkg/chart/loader.LoadDir\n\t/go/pkg/mod/helm.sh/helm/v3@v3.7.0/pkg/chart/loader/directory.go:119\nhelm.sh/helm/v3/pkg/chart/loader.DirLoader.Load\n\t/go/pkg/mod/helm.sh/helm/v3@v3.7.0/pkg/chart/loader/directory.go:41\nhelm.sh/helm/v3/pkg/chart/loader.Load\n\t/go/pkg/mod/helm.sh/helm/v3@v3.7.0/pkg/chart/loader/load.go:62\ngitlab.com/gitlab-org/cloud-native/gitlab-operator/pkg/support/charts.(*PopulateConfig).tryEntryAsChart\n\t/workspace/pkg/support/charts/populate.go:113\ngitlab.com/gitlab-org/cloud-native/gitlab-operator/pkg/support/charts.(*PopulateConfig).processDirEntry\n\t/workspace/pkg/support/charts/populate.go:84\npath/filepath.walkDir\n\t/usr/local/go/src/path/filepath/path.go:382\npath/filepath.WalkDir\n\t/usr/local/go/src/path/filepath/path.go:465\ngitlab.com/gitlab-org/cloud-native/gitlab-operator/pkg/support/charts.(*PopulateConfig).populate\n\t/workspace/pkg/support/charts/populate.go:68\ngitlab.com/gitlab-org/cloud-native/gitlab-operator/pkg/support/charts.(*Catalog).Populate\n\t/workspace/pkg/support/charts/catalog.go:107\ngitlab.com/gitlab-org/cloud-native/gitlab-operator/pkg/support/charts.PopulateGlobalCatalog\n\t/workspace/pkg/support/charts/global.go:29\nmain.main\n\t/workspace/main.go:81\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:225\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1371"}
gitlab.com/gitlab-org/cloud-native/gitlab-operator/pkg/support/charts.(*PopulateConfig).processDirEntry
        /workspace/pkg/support/charts/populate.go:84
path/filepath.walkDir
        /usr/local/go/src/path/filepath/path.go:382
path/filepath.WalkDir
        /usr/local/go/src/path/filepath/path.go:465
gitlab.com/gitlab-org/cloud-native/gitlab-operator/pkg/support/charts.(*PopulateConfig).populate
        /workspace/pkg/support/charts/populate.go:68
gitlab.com/gitlab-org/cloud-native/gitlab-operator/pkg/support/charts.(*Catalog).Populate
        /workspace/pkg/support/charts/catalog.go:107
gitlab.com/gitlab-org/cloud-native/gitlab-operator/pkg/support/charts.PopulateGlobalCatalog
        /workspace/pkg/support/charts/global.go:29
main.main
        /workspace/main.go:81
runtime.main
        /usr/local/go/src/runtime/proc.go:225

This is not an unexpected error and is handled by Chart population.

Merge request reports