Bug 1357668
| Summary: | Cannot create EAP quick start application - invalid imagestreamtag | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | Mike Fiedler <mifiedle> |
| Component: | openshift-controller-manager | Assignee: | Michail Kargakis <mkargaki> |
| Status: | CLOSED ERRATA | QA Contact: | zhou ying <yinzhou> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 3.3.0 | CC: | aos-bugs, bparees, jokerman, mfojtik, mifiedle, mkargaki, mmccomas, rcernich, tdawson, vlaad |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: |
We were defaulting the type for ImageChangeTriggers in deployment configs unconditionally to ImageStreamTag. Fixtures that were using ImageStream would be invalidated once validation would come across a trigger of ImageStreamTag type and an ImageStream value. We changed defaulting to default to ImageStreamTag iff there is no type specified. Otherwise, if a type is specified, it is handled correctly by conversion in order to maintain backwards comp and transform old data.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-09-27 09:40:36 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Mike Fiedler
2016-07-18 19:58:29 UTC
Where did you get your template from? the template I see has an ImageStream for the trigger, not an imagestreamtag: https://github.com/jboss-openshift/application-templates/blob/master/eap/eap64-basic-s2i.json#L236 which admittedly is a little weird (i think that means it defaults to latest on the imagestream). It was the one created in the openshift namespace during install (BYO playbook)
root@ip-172-31-18-111: ~/svt/openshift_scalability/content/golang # oc get template eap64-basic-s2i -o yaml -n openshift
apiVersion: v1
kind: Template
labels:
template: eap64-basic-s2i
xpaas: 1.2.0
metadata:
annotations:
description: Application template for EAP 6 applications built using S2I.
iconClass: icon-jboss
tags: eap,javaee,java,jboss,xpaas
version: 1.2.0
creationTimestamp: 2016-07-18T18:33:27Z
name: eap64-basic-s2i
namespace: openshift
resourceVersion: "382"
selfLink: /oapi/v1/namespaces/openshift/templates/eap64-basic-s2i
uid: 1e7bdd22-4d16-11e6-a2c8-020b345ecfd3
objects:
- apiVersion: v1
kind: Service
metadata:
annotations:
description: The web server's http port.
labels:
application: ${APPLICATION_NAME}
name: ${APPLICATION_NAME}
spec:
ports:
- port: 8080
targetPort: 8080
selector:
deploymentConfig: ${APPLICATION_NAME}
- apiVersion: v1
id: ${APPLICATION_NAME}-http
kind: Route
metadata:
annotations:
description: Route for application's http service.
labels:
application: ${APPLICATION_NAME}
name: ${APPLICATION_NAME}
spec:
host: ${HOSTNAME_HTTP}
to:
name: ${APPLICATION_NAME}
- apiVersion: v1
kind: ImageStream
metadata:
labels:
application: ${APPLICATION_NAME}
name: ${APPLICATION_NAME}
- apiVersion: v1
kind: BuildConfig
metadata:
labels:
application: ${APPLICATION_NAME}
name: ${APPLICATION_NAME}
spec:
output:
to:
kind: ImageStreamTag
name: ${APPLICATION_NAME}:latest
source:
contextDir: ${CONTEXT_DIR}
git:
ref: ${SOURCE_REPOSITORY_REF}
uri: ${SOURCE_REPOSITORY_URL}
type: Git
strategy:
sourceStrategy:
forcePull: true
from:
kind: ImageStreamTag
name: jboss-eap64-openshift:1.2
namespace: ${IMAGE_STREAM_NAMESPACE}
type: Source
triggers:
- github:
secret: ${GITHUB_WEBHOOK_SECRET}
type: GitHub
- generic:
secret: ${GENERIC_WEBHOOK_SECRET}
type: Generic
- imageChange: {}
type: ImageChange
- type: ConfigChange
- apiVersion: v1
kind: DeploymentConfig
metadata:
labels:
application: ${APPLICATION_NAME}
name: ${APPLICATION_NAME}
spec:
replicas: 1
selector:
deploymentConfig: ${APPLICATION_NAME}
strategy:
type: Recreate
template:
metadata:
labels:
application: ${APPLICATION_NAME}
deploymentConfig: ${APPLICATION_NAME}
name: ${APPLICATION_NAME}
spec:
containers:
- env:
- name: OPENSHIFT_KUBE_PING_LABELS
value: application=${APPLICATION_NAME}
- name: OPENSHIFT_KUBE_PING_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: HORNETQ_CLUSTER_PASSWORD
value: ${HORNETQ_CLUSTER_PASSWORD}
- name: HORNETQ_QUEUES
value: ${HORNETQ_QUEUES}
- name: HORNETQ_TOPICS
value: ${HORNETQ_TOPICS}
- name: JGROUPS_CLUSTER_PASSWORD
value: ${JGROUPS_CLUSTER_PASSWORD}
image: ${APPLICATION_NAME}
imagePullPolicy: Always
livenessProbe:
exec:
command:
- /bin/bash
- -c
- /opt/eap/bin/livenessProbe.sh
name: ${APPLICATION_NAME}
ports:
- containerPort: 8778
name: jolokia
protocol: TCP
- containerPort: 8080
name: http
protocol: TCP
- containerPort: 8888
name: ping
protocol: TCP
readinessProbe:
exec:
command:
- /bin/bash
- -c
- /opt/eap/bin/readinessProbe.sh
terminationGracePeriodSeconds: 60
triggers:
- imageChangeParams:
automatic: true
containerNames:
- ${APPLICATION_NAME}
from:
kind: ImageStream
name: ${APPLICATION_NAME}
type: ImageChange
- type: ConfigChange
parameters:
- description: The name for the application.
name: APPLICATION_NAME
required: true
value: eap-app
- description: 'Custom hostname for http service route. Leave blank for default hostname,
e.g.: <application-name>-<project>.<default-domain-suffix>'
name: HOSTNAME_HTTP
- description: Git source URI for application
name: SOURCE_REPOSITORY_URL
required: true
value: https://github.com/jboss-developer/jboss-eap-quickstarts
- description: Git branch/tag reference
name: SOURCE_REPOSITORY_REF
value: 6.4.x
- description: Path within Git project to build; empty for root project directory.
name: CONTEXT_DIR
value: kitchensink
- description: Queue names
name: HORNETQ_QUEUES
- description: Topic names
name: HORNETQ_TOPICS
- description: HornetQ cluster admin password
from: '[a-zA-Z0-9]{8}'
generate: expression
name: HORNETQ_CLUSTER_PASSWORD
required: true
- description: GitHub trigger secret
from: '[a-zA-Z0-9]{8}'
generate: expression
name: GITHUB_WEBHOOK_SECRET
required: true
- description: Generic build trigger secret
from: '[a-zA-Z0-9]{8}'
generate: expression
name: GENERIC_WEBHOOK_SECRET
required: true
- description: Namespace in which the ImageStreams for Red Hat Middleware images are
installed. These ImageStreams are normally installed in the openshift namespace.
You should only need to modify this if you've installed the ImageStreams in a
different namespace/project.
name: IMAGE_STREAM_NAMESPACE
required: true
value: openshift
- description: JGroups cluster password
from: '[a-zA-Z0-9]{8}'
generate: expression
name: JGROUPS_CLUSTER_PASSWORD
required: true
i think this is a bug in the template, but i'm not sure why you're the first to hit it. The API for deploymentconfigs says the From reference must be to an ImageStreamTag, not an ImageStream. Also the error message is not good if it's trying to tell you "you used an ImageStream but you have to use an ImageStreamTag", so CCing Michalis. actually i'm sending this to the platform team... if this used to work, it needs to keep working. (and if it's not going to work, the error message needs to make it clearer the it's the type of reference that is the problem, not the "eap-app" value. if this is something that needs to be fixed in the templates, which it appears it is, we should probably fix it quickly as we're rolling out updates this week and next. creating issue in CLOUD jira to track this. The ImageStreamTag name needs to change and include the tag (":latest"). I would also suggest changing "ImageStream" to "ImageStreamTag". The error message is fixed in https://github.com/openshift/origin/pull/9925
Michail, the ImageStream type needs to be supported, it was previously supported, which is why this template used to work. There even exists conversion logic in deployments to convert an ImageStream type to an ImageStreamTag by appending :latest. so we've broken api compatibility. The correct value here is to have an "ImageStreamTag" but "ImageStream" will continue to work because we are defaulting unconditionally to "ImageStreamTag" in order to transform old data (remember https://github.com/openshift/origin/issues/2511 ?) Commit pushed to master at https://github.com/openshift/origin https://github.com/openshift/origin/commit/6b2111311cf3b3aa53a975b9f939a9277915d0d2 Bug 1357668: update error message on invalid tags in ICTs Needs to be in MODIFIED until it is in a puddle based on IRC discussion i think this needs to go back to assigned so the api-breaking new defaulting logic can be removed. Fix is in the queue: https://github.com/openshift/origin/pull/9952 *** Bug 1358898 has been marked as a duplicate of this bug. *** Confirmed with aim :devenv-rhel7_4707,the issue has fixed.
openshift version
openshift v1.3.0-alpha.2+f6f7de3
kubernetes v1.3.0+57fb9ac
etcd 2.3.0+git
[root@ip-172-18-14-122 amd64]# oc new-app --template eap64-basic-s2i
--> Deploying template "eap64-basic-s2i" in project "openshift"
eap64-basic-s2i
---------
Application template for EAP 6 applications built using S2I.
* With parameters:
* APPLICATION_NAME=eap-app
* HOSTNAME_HTTP=
* SOURCE_REPOSITORY_URL=https://github.com/jboss-developer/jboss-eap-quickstarts
* SOURCE_REPOSITORY_REF=6.4.x
* CONTEXT_DIR=kitchensink
* HORNETQ_QUEUES=
* HORNETQ_TOPICS=
* HORNETQ_CLUSTER_PASSWORD=gyuntw2n # generated
* GITHUB_WEBHOOK_SECRET=smGkqICx # generated
* GENERIC_WEBHOOK_SECRET=vKEprG2Y # generated
* IMAGE_STREAM_NAMESPACE=openshift
* JGROUPS_CLUSTER_PASSWORD=rLfRfI3R # generated
* AUTO_DEPLOY_EXPLODED=false
--> Creating resources with label app=eap-app ...
service "eap-app" created
route "eap-app" created
imagestream "eap-app" created
buildconfig "eap-app" created
deploymentconfig "eap-app" created
--> Success
Build scheduled, use 'oc logs -f bc/eap-app' to track its progress.
Run 'oc status' to view your app.
This bug was verified against an origin build, not an OSE build. This should be in OSE v3.3.0.14 and newer. Confirmed with ose3.3.0.14, the issue has fixed:
[root@zhouy testjson]# oc version
oc v3.3.0.14
kubernetes v1.3.0+57fb9ac
features: Basic-Auth GSSAPI Kerberos SPNEGO
OpenShift v3.3.0.14
Kubernetes v1.3.0+57fb9ac
[root@zhouy testjson]# oc new-app --template eap64-basic-s2i
--> Deploying template "eap64-basic-s2i" in project "openshift"
eap64-basic-s2i
---------
Application template for EAP 6 applications built using S2I.
* With parameters:
* APPLICATION_NAME=eap-app
* HOSTNAME_HTTP=
* SOURCE_REPOSITORY_URL=https://github.com/jboss-developer/jboss-eap-quickstarts
* SOURCE_REPOSITORY_REF=6.4.x
* CONTEXT_DIR=kitchensink
* HORNETQ_QUEUES=
* HORNETQ_TOPICS=
* HORNETQ_CLUSTER_PASSWORD=Vaxbmn8e # generated
* GITHUB_WEBHOOK_SECRET=fuQQ2REy # generated
* GENERIC_WEBHOOK_SECRET=GdpJ77Ke # generated
* IMAGE_STREAM_NAMESPACE=openshift
* JGROUPS_CLUSTER_PASSWORD=o43v4exs # generated
* AUTO_DEPLOY_EXPLODED=false
--> Creating resources with label app=eap-app ...
service "eap-app" created
route "eap-app" created
imagestream "eap-app" created
buildconfig "eap-app" created
deploymentconfig "eap-app" created
--> Success
Build scheduled, use 'oc logs -f bc/eap-app' to track its progress.
Run 'oc status' to view your app.
[root@zhouy testjson]# oc get build
NAME TYPE FROM STATUS STARTED DURATION
eap-app-1 Source Git@8d9b0b3 Complete About an hour ago 9m37s
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2016:1933 |