Bug 1661845 - Creating a template with a syntax error doesn't block a template instance from saying "created"
Summary: Creating a template with a syntax error doesn't block a template instance fro...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Templates
Version: 3.11.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 4.1.0
Assignee: Ben Parees
QA Contact: XiuJuan Wang
URL:
Whiteboard:
Depends On:
Blocks: 1662339
TreeView+ depends on / blocked
 
Reported: 2018-12-24 02:16 UTC by Clayton Coleman
Modified: 2019-06-04 10:41 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Improper error checking ignored errors from object creation during template instantiation. Consequence: Template instances would report successful instantiation when in some objects in the template had failed to be created. Fix: Errors on creation are properly checked now. Result: The template instance will report failure if any object within it cannot be created.
Clone Of:
: 1662339 (view as bug list)
Environment:
Last Closed: 2019-06-04 10:41:27 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
TemplateInstance that should have failed (18.58 KB, text/plain)
2018-12-24 02:19 UTC, Clayton Coleman
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:0758 0 None None None 2019-06-04 10:41:33 UTC

Description Clayton Coleman 2018-12-24 02:16:39 UTC
While testing out use of ${{ }} in a template instance for use in api.ci, the template instance was listed as "successfully created" but one of the objects in the instance was not created.

The template instance should have caused a failure.

Comment 1 Clayton Coleman 2018-12-24 02:19:16 UTC
Created attachment 1516471 [details]
TemplateInstance that should have failed

Comment 2 Clayton Coleman 2018-12-24 02:19:43 UTC
The bug in this case is the double replacement isn't being evaluated correctly causing the pod resources not to be valid Pod yaml.

Comment 3 Clayton Coleman 2018-12-24 02:39:22 UTC
The injected replacement was not valid JSON.  So the pod creation failed, but the template instance didn't capture that.  Should have failed the template instance.

Comment 4 Ben Parees 2018-12-24 04:12:20 UTC
fix: https://github.com/openshift/origin/pull/21704

Comment 5 XiuJuan Wang 2019-01-22 03:21:29 UTC
templateinstance will fail if detect the object name is invalid.

Conditions:		 
    Type:		InstantiateFailure
    Status:		True
    LastTransitionTime:	2019-01-22 03:18:41 +0000 UTC
    Reason:		Failed
    Message:		DeploymentConfig "invalidname!@#$%!^(MISSING)&*" is invalid: metadata.name: Invalid value: "invalidname!@#$%!^(MISSING)&*": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')

Verified with 3.10.101 cluster:
Server https://ip-172-18-1-65.ec2.internal:443
openshift v3.10.101
kubernetes v1.10.0+b81c8f8

Comment 8 errata-xmlrpc 2019-06-04 10:41:27 UTC
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-2019:0758


Note You need to log in before you can comment on or make changes to this bug.