Hi,
I am doing Lab, there i am trying to save file through OC edit command, but it is showing error.
student@workstation ~]$ oc edit deployment/hello
A copy of your changes has been stored to "/tmp/oc-edit-1fi7k.yaml"
error: Edit cancelled, no valid changes were saved.
Let us know , how to save file through oc edit command?
Thanks
Rajkumar Batra
Hi RajBatra,
I have just completed the lab for DO280 ch06s02 and it went smooth without any issues. are you editing the hello deployment as explained in the course ?
Hi Rakjumar
Seems that the changes you are doing in the deployment are being rejected when sent back to OCP.
This may be caused by many reasons, like invalid values, wrong format, etc.
Can you clarify what exact changes are you applying?
Kind regards
Jordi Sola
Is this issue fixed ? i am facing the same error in DO280 Guided exercise
Hello ,
I don't think this was an issue because it went smooth for me.
Could you please redo the exercise and share here the screenshot if you face the issue again ?
Regards,
hi Chetan ,
Doing the DO280 Lab .. not sure why the edit not get succesfull . i faced the same error as reported above . Not sure any indentation issue .. i tried several times..
extract from the book .
4.1. Log in to your OpenShift cluster as the developer user.
[student@workstation ~]$ oc login -u developer -p developer
Login successful.
...output omitted...
Using project "schedule-pods".
4.2. Modify the deployment resource for the hello application to select a development
node. Make sure to add the node selector the spec group in the template section.
[student@workstation ~]$ oc edit deployment/hello
Add the highlighted lines below to the deployment resource, indenting as shown.
DO280-OCP4.5-en-2-20201110 187
Chapter 6 | Controlling Pod Scheduling
...output omitted...
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
nodeSelector:
env: dev
restartPolicy: Always
...output omitted...
The following output from oc edit is displayed after you save your changes.
deployment.apps/hello edited
Hello ,
I again created lab and have re-executed the lab exercise without any issues.
So, it again confirms there is no issues as such in this part.
I would request you to carefully edit the file with proper indentation and ensure no other errors while editing , save the file with :wq! and it will work.
Hello ,
Can you match with the 3 screenshots above ?
hi ,
i have shared my screenshots above which u can see the nodeSelector entry i edited correctly and when i save and exit got the error .
i did many times .. only this particular task in the whole D0280 got issue which i am unable to find the issue still .
Do you want to setup zoom session to see while i am doing the lab ?
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.