Add debug information to help understand failures finding schemas

This commit is contained in:
Yann Hamon 2022-10-15 17:39:14 +02:00
parent 7abf19346c
commit fce54a1b6f
2 changed files with 6 additions and 2 deletions

View file

@ -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 {

View file

@ -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
}