Bug 1662339

Summary: [3.11] Creating a template with a syntax error doesn't block a template instance from saying "created"
Product: OpenShift Container Platform Reporter: Ben Parees <bparees>
Component: TemplatesAssignee: Ben Parees <bparees>
Status: CLOSED ERRATA QA Contact: XiuJuan Wang <xiuwang>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.11.0CC: aos-bugs, jokerman, mmccomas, wzheng
Target Milestone: ---   
Target Release: 3.11.z   
Hardware: Unspecified   
OS: Unspecified   
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.
Story Points: ---
Clone Of: 1661845 Environment:
Last Closed: 2019-01-30 15:19:31 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 1661845    
Bug Blocks:    

Description Ben Parees 2018-12-27 20:05:26 UTC
+++ This bug was initially created as a clone of Bug #1661845 +++

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.

--- Additional comment from Clayton Coleman on 2018-12-24 02:19 UTC ---

--- Additional comment from Clayton Coleman on 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.

--- Additional comment from Clayton Coleman on 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.

--- Additional comment from Ben Parees on 2018-12-24 04:12:20 UTC ---

fix: https://github.com/openshift/origin/pull/21704

Comment 1 Ben Parees 2018-12-30 23:14:14 UTC

Comment 3 XiuJuan Wang 2019-01-22 03:33:20 UTC
templateinstance will fail if detect the object name is invalid.

    message: 'Deployment.apps "${{TEST}}" is invalid: metadata.name: Invalid value:
      "${{TEST}}": 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])?)*'')'
    reason: Failed
    status: "True"
    type: InstantiateFailure

Verified with 3.11.69 cluster:
Server https://104.***:443
openshift v3.11.69
kubernetes v1.11.0+d4cacc0

Comment 5 errata-xmlrpc 2019-01-30 15:19:31 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.