fix: surface sanitized operator detail in thothctl compose failures
This commit is contained in:
@@ -218,6 +218,15 @@ type OperationError struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (e *OperationError) Error() string {
|
func (e *OperationError) Error() string {
|
||||||
|
detail := strings.TrimSpace(e.detail)
|
||||||
|
if len(detail) > 0 {
|
||||||
|
// Bounded, sanitized operator/container detail so operators can diagnose failures
|
||||||
|
// without leaking secrets; the full renderer sanitizes further before output.
|
||||||
|
if len(detail) > 2048 {
|
||||||
|
detail = detail[:2048]
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("stage=%s class=%s: %s", e.stage, e.class, detail)
|
||||||
|
}
|
||||||
return fmt.Sprintf("stage=%s class=%s", e.stage, e.class)
|
return fmt.Sprintf("stage=%s class=%s", e.stage, e.class)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user