OpenShift template "object already exists" error

5/24/2019

I have developed an Openshift template which basically creates two objects (A cluster & a container operator).

I understand that templates run oc create under the hood. So, in case any of these two objects already exists then trying to create the objects through template would through an error. Is there any way to override this behaviour? I want my template to re-configure the object even if it exists.

-- Balajee Venkatesh
kubernetes
openshift

1 Answer

5/24/2019

You can use "oc process" which renders template into set of manifests:

oc process foo PARAM1=VALUE1 PARAM2=VALUE2 | oc apply -f -

or

oc process -f template.json PARAM1=VALUE1 PARAM2=VALUE2 | oc apply -f -
-- Vasily Angapov
Source: StackOverflow