Skip to content

Different transfer behaviour when using ocm transfer ctf/component/? (with options) #1500

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
frewilhelm opened this issue Jun 6, 2025 · 2 comments · May be fixed by #1501
Open

Different transfer behaviour when using ocm transfer ctf/component/? (with options) #1500

frewilhelm opened this issue Jun 6, 2025 · 2 comments · May be fixed by #1501
Labels
area/ipcei Important Project of Common European Interest kind/task small task, normally part of feature or epic

Comments

@frewilhelm
Copy link
Contributor

frewilhelm commented Jun 6, 2025

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:

spiff:

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)

@frewilhelm frewilhelm added kind/task small task, normally part of feature or epic needs/validation Validate the issue and assign a priority labels Jun 6, 2025
@frewilhelm frewilhelm added the needs/refinement Discuss with the team and gain a shared understanding label Jun 6, 2025
@github-actions github-actions bot added the area/ipcei Important Project of Common European Interest label Jun 6, 2025
@frewilhelm frewilhelm moved this from 🆕 ToDo to 📋 Next-UP in OCM Backlog Board Jun 6, 2025
@jakobmoellerdev jakobmoellerdev removed the needs/validation Validate the issue and assign a priority label Jun 6, 2025
@jakobmoellerdev jakobmoellerdev added this to the 2025-Q2 milestone Jun 6, 2025
@Skarlso
Copy link
Contributor

Skarlso commented Jun 12, 2025

Please update the description with the workaround that exists. Download, create ctf, use ocm transfer ctf would be the workaround.

@Skarlso
Copy link
Contributor

Skarlso commented Jun 12, 2025

Investigate if the documentation for this scenario is up-to-date, if it's not, update it to make more sense / be more usable.

@Skarlso Skarlso removed the needs/refinement Discuss with the team and gain a shared understanding label Jun 12, 2025
@Skarlso Skarlso removed this from the 2025-Q2 milestone Jun 12, 2025
@Skarlso Skarlso moved this from 📋 Next-UP to 🆕 ToDo in OCM Backlog Board Jun 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ipcei Important Project of Common European Interest kind/task small task, normally part of feature or epic
Projects
Status: 🆕 ToDo
Development

Successfully merging a pull request may close this issue.

3 participants