Skip to content
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

jenkins: use oc for image tagging #343

Merged
merged 3 commits into from
Oct 3, 2018

Conversation

miabbott
Copy link
Member

@miabbott miabbott commented Oct 3, 2018

To do tag manipulation on our oscontainer images, we need to use oc to operate on the ImageStream, rather than trying to use podman and skopeo.

The reasoning is that podman and skopeo can only operate according to the registry API which lacks a mechanism to "untag" an image. (See containers/skopeo#531 (comment))

This adds a utility function to login to an OpenShift service and
switches to a desired project.

I snuck in a small change to the `registry_login()` function to echo
out what the command looks like.
This change forgoes the use of `skopeo copy` to tag the container
image with an ostree commit and instead directly talks to OpenShift to
apply the tag.  I think this should be less likely to fail as we
don't have to rely on a longer, more network intensive `skopeo copy`
operation.

Note: we are explicitly tagging the sha256sum reference of the image,
rather than re-tagging the `buildmaster` tag.  This means the ostree
commit tag will always point to the sha256sum of the image, rather
than the `buildmaster` tag, which changes each build.
This implements the use of `oc` to handle the tagging of the container
image to `alpha` and to garbage collect ostree commit tags that we no
longer need.
@openshift-ci-robot openshift-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 3, 2018
@cgwalters
Copy link
Member

/lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants