<p>How can I rename route that has been created via web console?
I go to <code>Applications&gt;Routes</code>, selected route name, then <code>Action&gt;Edit YAML</code> and I want to achieve the following change, from <code>test.site</code> into <code>old.test.site</code></p>

<p><strong>Current route yml config</strong></p>

<pre><code>...
metadata:
  name: test
  selfLink: /oapi/v1/namespaces/keycloak/routes/test
...
spec:
  host: test.site
...
status:
  ingress:
    - conditions:
        - lastTransitionTime: '2017-12-13T02:19:22Z'
          status: 'True'
          type: Admitted
      host: test.site
</code></pre>

<p><strong>Attempt</strong></p>

<pre><code>...
metadata:
  name: test
  selfLink: /oapi/v1/namespaces/keycloak/routes/test
...
spec:
  host: old.test.site
...
status:
  ingress:
    - conditions:
        - lastTransitionTime: '2017-12-13T02:19:22Z'
          status: 'True'
          type: Admitted
      host: old.test.site
</code></pre>

<p>I get the following error messages:</p>

<blockquote>
  <p>Failed to process the resource.
  Reason: Route "test" is invalid: spec.host: Invalid value: "old.test.site": field is immutable</p>
</blockquote>

johntanquinco
<p>As <a href="https://stackoverflow.com/users/128141/graham-dumpleton">Graham Dumpleton</a> wrote:</p>

<p>As far as I know you can't edit the host in place for an existing route. From the command line try </p>

<pre><code>oc get route test -o yaml &gt; route.yaml
</code></pre>

<p>Then edit the  <code>route.yaml</code>  and run </p>

<pre><code>oc replace route test -f route.yaml 
</code></pre>

<p>The  <code>replace</code>  action may allow you to do it. 
 Else after editing local copy, try </p>

<pre><code>oc delete route test
</code></pre>

<p>and  </p>

<pre><code>oc apply route test -f route.yaml
</code></pre>

<p>In doing this, when edit the file, you can delete the whole  <code>status</code>  section. </p>

<p>But keep in mind there are exist some fields which are required and you cannot delete them.  That's why you had a problem with modification. </p>
