1
0
mirror of https://github.com/rancher/steve.git synced 2025-08-31 06:46:25 +00:00

Log and ignore transform errors. (#683)

This commit is contained in:
Eric Promislow
2025-06-18 11:02:46 -07:00
committed by GitHub
parent 4212386e13
commit c32995dba4

View File

@@ -95,10 +95,14 @@ func (t *TransformBuilder) GetTransformFunc(gvk schema.GroupVersionKind, columns
}
// Conversions are run in this loop:
for _, f := range converters {
obj, err = f(obj)
transformed, err := f(obj)
if err != nil {
return nil, err
// If we return an error here, the upstream k8s library will retry a transform, and we don't want that,
// as it's likely to loop forever and the server will hang.
// Instead, log this error and try the remaining transform functions
logrus.Errorf("error in transform: %v", err)
}
obj = transformed
}
return obj, nil
}