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?
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
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.
'oc edit oauth' works
but it would be nice to understand why 'oc replace -f oauth-htpasswd.yaml' doesn't work
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
Yes, After removing CreationTimeStamp, geration, resource version & UUID field we can able to replave the file.
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.