Open davidfestal opened 1 year ago
/assign
hey @davidfestal ,should I add a new field into ResourceToSync
type that would indicate errors
in case any..?
I think we could do that. Something similar to the Message in status conditions:
// A human readable message indicating details about the compatibility errors
// This field may be empty.
// +optional
Message string `json:"message,omitempty"`
@sttts wdyt about https://github.com/kcp-dev/contrib-tmc/issues/33 ?
/transfer-issue contrib-tmc
/transfer-issue contrib-tmc
Describe the bug
When a resource to sync on a SyncTarget is incompatible, there are not details about the compatibility errors between the KCP schema and the SyncTarget schema. That makes it quite hard to understand what happens.
Steps To Reproduce
root:compute:kubernetes
APIExportSyncTarget.Status.ResourcesToSync
list have theIncompatible
state, but don't provide any more detail.Expected Behaviour
We should have a compatibility detailed error message. This should be possible, since the internal code used to do the compatibility check returns a list of errors (missing field, incompatible types, etc...)
Additional Context
Here is the code where the at least the
err.Error()
of the error coming from theschemacompat.EnsureStructuralSchemaCompatibility()
call should be added in a detailed message on theResourceToSync
:https://github.com/kcp-dev/kcp/blob/60ba17a1780879d4418ab8d1e90abc6ece65cbba/pkg/reconciler/workload/synctargetexports/synctargetcompatible_reconcile.go#L122-L128