fannullone
Flight Engineer
Flight Engineer
  • 482 Views

can not replace oauth/cluster

Jump to solution

When I try to modify this resource I always get the following error; for instance if I want to add htpasswd:

[student@workstation ~]$ oc replace -f oauth-htpasswd.yaml
Error from server (Conflict): error when replacing "oauth-htpasswd.yaml": Operation cannot be fulfilled on oauths.config.openshift.io "cluster": the object has been modified; please apply your changes to the latest version and try again
[student@workstation ~]$

Any idea how to achieve it?

Labels (1)
1 Solution

Accepted Solutions
Natalie_Lind
Flight Engineer
Flight Engineer
  • 446 Views

Hi there! I wonder if the metadata in the oauth.yaml file is what's causing the conflict. When I create that file with the oc get command, my file includes the creationTimestamp, generation, resource version, and UID fields. I was able to use the oc replace command with this file without experiencing the error, but I did that quickly after generating the YAML file. I found this KB article regarding a similar error with the oc apply command and it suggests that outdated metadata prevents the YAML file from being applied. https://access.redhat.com/solutions/6428441

Natalie Watkins
Manager - Technical Training, OpenShift Platforms
Product & Technical Learning

View solution in original post

3 Replies
ecrookshanks
Mission Specialist
Mission Specialist
  • 476 Views

I'm not sure about that error, I will have to do a little digging.  However, it is easier just to edit that resource in place.  if you type "oc edit oauth" you can edit the content directly on the server.  They actually do that in step 9.3 of the lab.

fannullone
Flight Engineer
Flight Engineer
  • 459 Views

'oc edit oauth' works

but it would be nice to understand why 'oc replace -f oauth-htpasswd.yaml' doesn't work

Natalie_Lind
Flight Engineer
Flight Engineer
  • 447 Views

Hi there! I wonder if the metadata in the oauth.yaml file is what's causing the conflict. When I create that file with the oc get command, my file includes the creationTimestamp, generation, resource version, and UID fields. I was able to use the oc replace command with this file without experiencing the error, but I did that quickly after generating the YAML file. I found this KB article regarding a similar error with the oc apply command and it suggests that outdated metadata prevents the YAML file from being applied. https://access.redhat.com/solutions/6428441

Natalie Watkins
Manager - Technical Training, OpenShift Platforms
Product & Technical Learning
Join the discussion
You must log in to join this conversation.