Skip to content

ImageStreamTag should be whited out by OpenShiftPlugin #26

@midays

Description

@midays

What version of crane are you running, and what are your clusters+platform:
crane: main branch
OpenShiftPlugin: v0.0.4
Source: OpenShift 4.x (cam-src)
Destination: OpenShift 4.x (cam-tgt)

Description:
ImageStreamTag resources exported from the source namespace should be whited
out by the OpenShiftPlugin during transform, similar to ImageTag (#25).

What actually happened?
ImageStreamTag survives both transform stages and ends up in the final
output. When applied on the destination after the destination registry has
already received the image (e.g. via skopeo copy during image migration),
kubectl apply fails with:

Error from server (BadRequest): ...
imagestreamtag v1 is not a spec tag in imagestream <ns>/<is>,
cannot be updated

Why it should be whited out:
ImageStreamTag is a server-managed projection that the OpenShift API server
populates from registry push events. Once image bytes land on the destination
registry, the destination's ImageStreamTag is created automatically pointing
at the correct digest, applying a migrated copy on top of it is rejected.
Same architectural pattern as ImageTag (#25): the destination recreates it,
the migration shouldn't carry it.

Reproduction steps:

  1. Deploy an app with a manually-pushed image on source (no BuildConfig)
  2. crane export --namespace=<ns>
  3. crane transform --stage 10_KubernetesPlugin
  4. crane transform --stage 20_OpenShiftPlugin
  5. crane apply
  6. On destination: create the namespace, apply the empty ImageStream
  7. skopeo copy source digest → destination registry
  8. kubectl apply -f output/resources/<ns>/ImageStreamTag_*.yaml
  9. Observe: imagestreamtag <tag> is not a spec tag in imagestream <ns>/<is>, cannot be updated

Expected fix:
OpenShiftPlugin should add ImageStreamTag to its whiteout list during
transform, alongside the proposed ImageTag whiteout in #25.

Related:

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.needs-priorityneeds-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No fields configured for Bug.

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions