How can I rename route that has been created via web console? I go to Applications>Routes, selected route name, then Action>Edit YAML and I want to achieve the following change, from test.site into old.test.site
Current route yml config
...
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.siteAttempt
...
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.siteI get the following error messages:
Failed to process the resource. Reason: Route "test" is invalid: spec.host: Invalid value: "old.test.site": field is immutable
As Graham Dumpleton wrote:
As far as I know you can't edit the host in place for an existing route. From the command line try
oc get route test -o yaml > route.yamlThen edit the route.yaml and run
oc replace route test -f route.yaml The replace action may allow you to do it. Else after editing local copy, try
oc delete route testand
oc apply route test -f route.yamlIn doing this, when edit the file, you can delete the whole status section.
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.