You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Failed to resolve ImageStreamTag in deployment #6934
OK, this is strange but when I deleted that project and created it from scratch, it actually deployed automatically after build even that auto=false...
EDIT: After I removed the project again and re-created it from the original steps, I get the IST not resolved again...
So further investigation reveals that we never update the DeploymentConfig when the "automatic:false", which means the Image in ContainerSpec is never resolved into DockerPullSpec based on the ImageStreamTag.
First bug in here is in oc status. Before I manually trigger the deployment:
$ oc status
In project stage on server https://localhost:8443
svc/sample-app - 172.30.154.201:8080
dc/sample-app deploys istag/sample-app:latest <-
bc/sample-app builds https://github.com/mfojtik/sample-app.git with openshift/ruby:latest
#1 build succeeded 45 seconds ago - 85d983b: Cleanup (Michal Fojtik <[email protected]>)
#1 deployment waiting on image or update
View details with 'oc describe <resource>/<name>' or list everything with 'oc get all'.
It should warn me that the image is available and I just need to manually trigger since dc.spec.triggers[1].automatic == false.
So when I set automatic:false it will not resolve the imagestreamtag... That seems to be the problem here.
That's exactly the root cause of your problem. Only ImageChange trigger is capable of resolving IST correctly, since in your example it's turned off the Deployment will be created from the exact PodTemplate you specified, in your case: image: sample-app:latest which won't work, obviously. This is not a bug.
@soltysh it depends on how you define "bug" here. If automatic=false disable IST resolving then we should at least tweak its API description:
Automatic means that the detection of a new tag value should result in a new deployment.
What I expected here is that the IST gets resolved, because I have ICT defined and I want it to become the Container->Image. What I don't want is the new tag result into a new deployment, which is what that description is saying. So I can do manual deploy when I decide to do it.
I don't see what the mappings get us over having a flag on the trigger that
says whether clients should refresh it when triggering a manual
deployment. Manual deployments are manual.
On Wed, Feb 17, 2016 at 3:19 PM, Ben Parees [email protected]
wrote:
so in my head i'm thinking a few flows:
a) ICT fires, matching mapping gets updated/resolved. If DC is automatic,
deployment happens.
b) Deployment is manually requested. Mappings marked "automatic" get
updated. deployment happens.
c) Deployment is automatically caused (by what?). Mappings marked
"automatic" get resolved/udpated. deployment happens.
In all cases the actual deployment uses the value defined in the mapping
at that point.
I guess my only concern is with (a). In the case of Builds we ultimately
separated the ICT from the Build. That is, any imagechange could
trigger a build, it's just an event. ("image foo changed. build bar!"). I
think maybe DC should be similar. the ICT trigger starts the deployment.
The content of that deployment would then depend on the Mapping and whether
the mapping was set to Automatic(re-resolve) or Manual(do not re-resolve).
The other question i'd have is what you do with an ImageStreamTag
reference in a Mapping when Automatic is false? You have to resolve it at
least once to get a pull spec....
—
Reply to this email directly or view it on GitHub #6934 (comment).
I could live with either, but abusing imagechangetriggers to say "this triggers deploys...oh and also we'll use the information in here to resolve which image to use when you do a manual deployment, if you set this other flag" feels like a hack.
imagechangetriggers should trigger things, overloading them to configure other behavior seems wrong.
and what if i always want to resolve an ImageStreamTag but i don't want to have an ICT at all? I define an ICT, then set deployment to manual, then set this other new flag to say "ResolveViaICT on deploy"?
do i still get configchangetriggers if i set deployment mode to manual?
Triggers are just probably poorly named. Triggers are "Dependencies" that
are leveraged by the controller to assist users in making decisions. There
is "automatic" (always trigger), "refresh" (if something else changes and
doesn't specify, refresh this value via a client), and "manual" (i don't
need your help).
On Wed, Feb 17, 2016 at 3:38 PM, Ben Parees [email protected]
wrote:
and what if i always want to resolve an ImageStreamTag but i don't want to
have an ICT at all? I define an ICT, then set deployment to manual, then
set this other new flag to say "ResolveViaICT on deploy"?
do i still get configchangetriggers if i set deployment mode to manual?
—
Reply to this email directly or view it on GitHub #6934 (comment).
@ironcladlou do we really need new API for this? How about having the imagechange controller update the reference but not bump the version for triggering the new deployment? False for automatic is a variation of Paused. If a deployment is paused it won't trigger by updating its container.
@ironcladlou do we really need new API for this? How about having the imagechange controller update the reference but not bump the version for triggering the new deployment? False for automatic is a variation of Paused. If a deployment is paused it won't trigger by updating its container.
How are references in the deploymentConfig pod spec updated during a manual deployment?
A user can tag an image stream tag and the deployment is updated with
the latest values of any automatic tags (handled by deployment controller)
A user on the command line can manually update to a particular latest
manual image and leave the others alone (handled by client code today, but
this is arguably an /instantiate endpoint)
A user on the command line can easily update to the latest images for
each container and then post that to the deployment config (no one does
this, but this is arguably an /instantiate endpoint)
I would expect oc rollout --image to handle both 2 and 3 cleanly.
Activity
mfojtik commentedon Feb 1, 2016
OK, this is strange but when I deleted that project and created it from scratch, it actually deployed automatically after build even that
auto=false...EDIT: After I removed the project again and re-created it from the original steps, I get the IST not resolved again...
[-]Deployment is trying to get library/sample-app:latest[/-][+]Failed to resolve ImageStreamTag in deployment[/+]mfojtik commentedon Feb 1, 2016
So when I set
automatic:falseit will not resolve the imagestreamtag... That seems to be the problem here.mfojtik commentedon Feb 1, 2016
So further investigation reveals that we never update the DeploymentConfig when the "automatic:false", which means the Image in ContainerSpec is never resolved into DockerPullSpec based on the ImageStreamTag.
The code is here: https://github.com/openshift/origin/blob/master/pkg/deploy/controller/imagechange/controller.go#L44
mfojtik commentedon Feb 1, 2016
@ironcladlou FYI
0xmichalis commentedon Feb 1, 2016
First bug in here is in
oc status. Before I manually trigger the deployment:It should warn me that the image is available and I just need to manually trigger since dc.spec.triggers[1].automatic == false.
0xmichalis commentedon Feb 1, 2016
I see the istag resolved from sample-app:latest to the full spec in the registry
0xmichalis commentedon Feb 1, 2016
@mfojtik you also have the following streams, right?
mfojtik commentedon Feb 1, 2016
yes i do
On Feb 1, 2016 4:09 PM, "Michail Kargakis" [email protected] wrote:
soltysh commentedon Feb 1, 2016
That's exactly the root cause of your problem. Only ImageChange trigger is capable of resolving IST correctly, since in your example it's turned off the Deployment will be created from the exact PodTemplate you specified, in your case:
image: sample-app:latestwhich won't work, obviously. This is not a bug.mfojtik commentedon Feb 1, 2016
@soltysh it depends on how you define "bug" here. If
automatic=falsedisable IST resolving then we should at least tweak its API description:What I expected here is that the IST gets resolved, because I have ICT defined and I want it to become the Container->Image. What I don't want is the new tag result into a new deployment, which is what that description is saying. So I can do manual deploy when I decide to do it.
cc @bparees @smarterclayton
21 remaining items
smarterclayton commentedon Feb 17, 2016
I don't see what the mappings get us over having a flag on the trigger that
says whether clients should refresh it when triggering a manual
deployment. Manual deployments are manual.
On Wed, Feb 17, 2016 at 3:19 PM, Ben Parees [email protected]
wrote:
bparees commentedon Feb 17, 2016
I could live with either, but abusing imagechangetriggers to say "this triggers deploys...oh and also we'll use the information in here to resolve which image to use when you do a manual deployment, if you set this other flag" feels like a hack.
imagechangetriggers should trigger things, overloading them to configure other behavior seems wrong.
bparees commentedon Feb 17, 2016
and what if i always want to resolve an ImageStreamTag but i don't want to have an ICT at all? I define an ICT, then set deployment to manual, then set this other new flag to say "ResolveViaICT on deploy"?
do i still get configchangetriggers if i set deployment mode to manual?
smarterclayton commentedon Feb 17, 2016
Triggers are just probably poorly named. Triggers are "Dependencies" that
are leveraged by the controller to assist users in making decisions. There
is "automatic" (always trigger), "refresh" (if something else changes and
doesn't specify, refresh this value via a client), and "manual" (i don't
need your help).
On Wed, Feb 17, 2016 at 3:38 PM, Ben Parees [email protected]
wrote:
bparees commentedon Feb 17, 2016
@smarterclayton ok, i'll buy that.
0xmichalis commentedon Feb 18, 2016
@ironcladlou do we really need new API for this? How about having the imagechange controller update the reference but not bump the version for triggering the new deployment? False for automatic is a variation of Paused. If a deployment is paused it won't trigger by updating its container.
ironcladlou commentedon Feb 18, 2016
How are references in the deploymentConfig pod spec updated during a manual deployment?
smarterclayton commentedon Feb 18, 2016
So these three cases need to work:
the latest values of any automatic tags (handled by deployment controller)
manual image and leave the others alone (handled by client code today, but
this is arguably an /instantiate endpoint)
each container and then post that to the deployment config (no one does
this, but this is arguably an /instantiate endpoint)
I would expect oc rollout --image to handle both 2 and 3 cleanly.
On Thu, Feb 18, 2016 at 1:08 PM, Dan Mace [email protected] wrote:
0xmichalis commentedon Feb 18, 2016
Same as automatic DCs are updated now, the only difference will be that lateVersion stays the same (so no new deployment runs).
0xmichalis commentedon Feb 18, 2016
@ironcladlou got this working locally, will submit a poc PR shortly.