-
Notifications
You must be signed in to change notification settings - Fork 25
Description
Context
Initially, we noticed that ocm transfer component ignores the --omit-access-type flag. We did figure out that this is due to a missing check in the spiff transfer handler:
func (h *Handler) TransferResource(src ocm.ComponentVersionAccess, a ocm.AccessSpec, r ocm.ResourceAccess) (bool, error) {
if !h.opts.IsResourcesByValue() {
return false, nil
}
if h.opts.GetScript() == nil {
return true, nil
}
binding := h.getBinding(src, a, &r.Meta().ElementMeta, &r.Meta().Type, nil)
return h.EvalBool("resource", binding, "process")
}in comparison to the standard handler:
func (h *Handler) TransferResource(src ocm.ComponentVersionAccess, a ocm.AccessSpec, r ocm.ResourceAccess) (bool, error) {
if h.opts.IsAccessTypeOmitted(a.GetType()) {
return false, nil
}
if h.opts.IsLocalResourcesByValue() {
if r.Meta().Relation == metav1.LocalRelation {
return true, nil
}
}
return h.opts.IsResourcesByValue(), nil
}This check is missing:
if h.opts.IsAccessTypeOmitted(a.GetType()) {
return false, nil
}While debugging this, however, we noticed that this ocm transfer ctf acknowledges the --omit-access-type flag because it defaults to the standard transfer-handler.
Accordingly, there is one bug in the spiff-handler wrt to the check but also depending on the command, a different transfer handler is chosen in general. So far, we only checked this for ctf and component. Maybe this is also true for other objects.
Expected behavior
A consistent and understandable call of the transfer handlers as well as respecting any passed option.
(This bug is a result of a joined discussion and is used as tracker. @discussion-attendees feel free to edit this description if necessary)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status