From fce54a1b6f943f2f8368e0e9bc992df174349dfc Mon Sep 17 00:00:00 2001 From: Yann Hamon Date: Sat, 15 Oct 2022 17:39:14 +0200 Subject: [PATCH] Add debug information to help understand failures finding schemas --- pkg/registry/http.go | 4 +++- pkg/registry/local.go | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/registry/http.go b/pkg/registry/http.go index 8103efc..db49f96 100644 --- a/pkg/registry/http.go +++ b/pkg/registry/http.go @@ -108,7 +108,9 @@ func (r SchemaRegistry) DownloadSchema(resourceKind, resourceAPIVersion, k8sVers return nil, errors.New(msg) } - log.Printf("using schema found at %s", url) + if r.debug { + log.Printf("using schema found at %s", url) + } if r.cache != nil { if err := r.cache.Set(resourceKind, resourceAPIVersion, k8sVersion, body); err != nil { diff --git a/pkg/registry/local.go b/pkg/registry/local.go index 56ccaf3..81d69e2 100644 --- a/pkg/registry/local.go +++ b/pkg/registry/local.go @@ -56,6 +56,8 @@ func (r LocalRegistry) DownloadSchema(resourceKind, resourceAPIVersion, k8sVersi return nil, err } - log.Printf("using schema found at %s", schemaFile) + if r.debug { + log.Printf("using schema found at %s", schemaFile) + } return content, nil }