Balajee Venkatesh
Balajee Venkatesh

Reputation: 1099

OpenShift template "object already exists" error

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.

Upvotes: 1

Views: 955

Answers (1)

Vasilii Angapov
Vasilii Angapov

Reputation: 9022

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 -

Upvotes: 3

Related Questions