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

WIP: Add controller to update cross image stream tag aliases #13595

Closed
wants to merge 2 commits into from

Conversation

mfojtik
Copy link
Contributor

@mfojtik mfojtik commented Mar 31, 2017

Today, when you create imagestreamtag alias like:

$ oc import-image openshift/origin-pod:latest --confirm
$ oc tag --source=imagestreamtag origin-pod:latest foo:bar --alias=true
Tag second:foo set up to track origin-pod:latest

The message above is a lie, no tracking is setupped for the origin-pod:latest, the "second:foo" will never update. To prove this:

$ oc tag --source=docker openshift/origin-pod:v3.6.0-alpha.0 test/origin-pod:latest

Then check the second:foo and you will see it still points to previous version of origin-pod:latest.

To fix this we should have a controller that handles relations between aliased image stream and automatically update the status of the aliased image stream to reflect an update in the source image stream.

@mfojtik
Copy link
Contributor Author

mfojtik commented Mar 31, 2017

This is currently blocked on 1.6 rebase (I need update to clientset generator to get UpdateStatus()...), however @smarterclayton @soltysh PTAL the idea.

I'm still not sure what to do when the source image stream tag is deleted (should we just stop tracking? should we put some special annotation or status on saying the source image stream was deleted?...)

Also we should probably add shared informer for ImageStreams and re-use it in image import controller (that is the highest PM tech-debt in 3.7).

@mfojtik mfojtik requested a review from miminar March 31, 2017 15:27
@mfojtik mfojtik force-pushed the update-aliased-is branch from b353e02 to 5e6b4d1 Compare March 31, 2017 15:29
@ncdc
Copy link
Contributor

ncdc commented Mar 31, 2017

You will be getting generated shared informers for all origin types for free in 3.6.

@smarterclayton
Copy link
Contributor

The generic trigger controller will require a shared informer and will remove the deployment and build trigger controllers watch on images.

How do you handle security on this? It looks like I can use this to steal images I don't have access to in other namespaces?

@smarterclayton
Copy link
Contributor

Also, we really need to collapse the secret informers. Probably the most expensive single type right now

@mfojtik
Copy link
Contributor Author

mfojtik commented Apr 3, 2017

How do you handle security on this? It looks like I can use this to steal images I don't have access to in other namespaces?

If you had an access to create an alias for the image stream tag that lives in a namespace you have access to, don't you expect that alias to update when the source image stream tag change?

But I see your point, I can change the "from" to point to an image stream that exists in a namespace I don't have access to and the controller will update it to match the tag... I guess I can just forbid updating cross-namespace? (or is there a SAR check if an user who created this image stream have access to other image stream?).

@smarterclayton
Copy link
Contributor

smarterclayton commented Apr 3, 2017 via email

@mfojtik
Copy link
Contributor Author

mfojtik commented Apr 3, 2017

@smarterclayton in that case, maybe we should remove the --alias completely? or at least change the message to tell users that tag will not be "tracked" but just copied and never updated :-)

and I think I agree, I don't see much use-cases for in-namespace cross-imagestream alias... it kind of make sense for :latest inside image stream...

@smarterclayton
Copy link
Contributor

smarterclayton commented Apr 3, 2017 via email

@mfojtik mfojtik closed this Apr 4, 2017
@mfojtik mfojtik deleted the update-aliased-is branch September 5, 2018 21:23
jlebon added a commit to jlebon/fedora-coreos-pipeline that referenced this pull request Dec 1, 2023
…eam tags

In the case where we don't need custom certs, we had the
`openshift/jenkins:2` imagestream feed into the `jenkins:latest`
imagestream, which then was the input to the S2I build.

And similarly, we had `openshift/jenkins-agent-base:latest` feed  into
`jenkins-agent-base:latest`.

In eb70bf7 ("manifests/jenkins-s2i: set `scheduled` on our
imagestreams"), we added `scheduled: true` for those tags thinking they would
keep those imagestreams up to date with the `openshift/` ones. But in
fact, `scheduled: true` only works when an imagestream tracks an image
in an external registry.

There is no way as far as I can tell to have an imagestream tag track
another imagestream tag. The closest is aliases, but those only work
for tags within the same imagestream, not different imagestreams. This is
by design (see openshift/origin#13595).

So we'd have to periodically manually `oc tag` ourselves to keep them up
to date, and that doesn't seem worth it.

Instead, cut it out entirely.

So now, in the non-cert case, we really just have our buildconfig output
to an imagestream and that's it.

The cert flow remains unchanged.

To deal with the agent image being *either* the
`openshift/jenkins-agent-base` one or our custom one with a cert, we
have to parameterize the `defaultImage` property of the Kubernetes
plugin in `jenkins.yaml`.
jlebon added a commit to jlebon/fedora-coreos-pipeline that referenced this pull request Dec 1, 2023
…eam tags

In the case where we don't need custom certs, we had the
`openshift/jenkins:2` imagestream feed into the `jenkins:latest`
imagestream, which then was the input to the S2I build.

And similarly, we had `openshift/jenkins-agent-base:latest` feed  into
`jenkins-agent-base:latest`.

In eb70bf7 ("manifests/jenkins-s2i: set `scheduled` on our
imagestreams"), we added `scheduled: true` for those tags thinking they would
keep those imagestreams up to date with the `openshift/` ones. But in
fact, `scheduled: true` only works when an imagestream tracks an image
in an external registry.

There is no way as far as I can tell to have an imagestream tag track
another imagestream tag. The closest is aliases, but those only work
for tags within the same imagestream, not different imagestreams. This is
by design (see openshift/origin#13595).

So we'd have to add more code to periodically `oc tag` them to keep them
up to date, and that doesn't seem worth it.

Instead, cut it out entirely.

So now, in the non-cert case, we really just have our buildconfig output
to an imagestream and that's it.

The cert flow remains unchanged.

To deal with the agent image being *either* the
`openshift/jenkins-agent-base` one or our custom one with a cert, we
have to parameterize the `defaultImage` property of the Kubernetes
plugin in `jenkins.yaml`.
jlebon added a commit to jlebon/fedora-coreos-pipeline that referenced this pull request Dec 1, 2023
…eam tags

In the case where we don't need custom certs, we had the
`openshift/jenkins:2` imagestream feed into the `jenkins:latest`
imagestream, which then was the input to the S2I build.

And similarly, we had `openshift/jenkins-agent-base:latest` feed  into
`jenkins-agent-base:latest`.

In eb70bf7 ("manifests/jenkins-s2i: set `scheduled` on our
imagestreams"), we added `scheduled: true` for those tags thinking they would
keep those imagestreams up to date with the `openshift/` ones. But in
fact, `scheduled: true` only works when an imagestream tracks an image
in an external registry.

There is no way as far as I can tell to have an imagestream tag track
another imagestream tag. The closest is aliases, but those only work
for tags within the same imagestream, not different imagestreams. This is
by design (see openshift/origin#13595).

So we'd have to add more code to periodically `oc tag` them to keep them
up to date, and that doesn't seem worth it.

Instead, cut it out entirely.

So now, in the non-cert case, we really just have our buildconfig output
to an imagestream and that's it.

The cert flow remains unchanged.

To deal with the agent image being *either* the
`openshift/jenkins-agent-base` one or our custom one with a cert, we
have to parameterize the `defaultImage` property of the Kubernetes
plugin in `jenkins.yaml`.
jlebon added a commit to coreos/fedora-coreos-pipeline that referenced this pull request Feb 13, 2024
…eam tags

In the case where we don't need custom certs, we had the
`openshift/jenkins:2` imagestream feed into the `jenkins:latest`
imagestream, which then was the input to the S2I build.

And similarly, we had `openshift/jenkins-agent-base:latest` feed  into
`jenkins-agent-base:latest`.

In eb70bf7 ("manifests/jenkins-s2i: set `scheduled` on our
imagestreams"), we added `scheduled: true` for those tags thinking they would
keep those imagestreams up to date with the `openshift/` ones. But in
fact, `scheduled: true` only works when an imagestream tracks an image
in an external registry.

There is no way as far as I can tell to have an imagestream tag track
another imagestream tag. The closest is aliases, but those only work
for tags within the same imagestream, not different imagestreams. This is
by design (see openshift/origin#13595).

So we'd have to add more code to periodically `oc tag` them to keep them
up to date, and that doesn't seem worth it.

Instead, cut it out entirely.

So now, in the non-cert case, we really just have our buildconfig output
to an imagestream and that's it.

The cert flow remains unchanged.

To deal with the agent image being *either* the
`openshift/jenkins-agent-base` one or our custom one with a cert, we
have to parameterize the `defaultImage` property of the Kubernetes
plugin in `jenkins.yaml`.
aaradhak pushed a commit to aaradhak/fedora-coreos-pipeline that referenced this pull request May 14, 2024
…eam tags

In the case where we don't need custom certs, we had the
`openshift/jenkins:2` imagestream feed into the `jenkins:latest`
imagestream, which then was the input to the S2I build.

And similarly, we had `openshift/jenkins-agent-base:latest` feed  into
`jenkins-agent-base:latest`.

In eb70bf7 ("manifests/jenkins-s2i: set `scheduled` on our
imagestreams"), we added `scheduled: true` for those tags thinking they would
keep those imagestreams up to date with the `openshift/` ones. But in
fact, `scheduled: true` only works when an imagestream tracks an image
in an external registry.

There is no way as far as I can tell to have an imagestream tag track
another imagestream tag. The closest is aliases, but those only work
for tags within the same imagestream, not different imagestreams. This is
by design (see openshift/origin#13595).

So we'd have to add more code to periodically `oc tag` them to keep them
up to date, and that doesn't seem worth it.

Instead, cut it out entirely.

So now, in the non-cert case, we really just have our buildconfig output
to an imagestream and that's it.

The cert flow remains unchanged.

To deal with the agent image being *either* the
`openshift/jenkins-agent-base` one or our custom one with a cert, we
have to parameterize the `defaultImage` property of the Kubernetes
plugin in `jenkins.yaml`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants