
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 14.4K Views
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
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 8,923 Views
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 ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 9,080 Views
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 8,924 Views

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 8,596 Views
Is this issue fixed ? i am facing the same error in DO280 Guided exercise

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 8,593 Views
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,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 8,589 Views
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 8,585 Views

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 8,583 Views
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 8,578 Views
Hello ,
Can you match with the 3 screenshots above ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 8,573 Views
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 ?