cancel
Showing results for 
Search instead for 
Did you mean: 
Rajbatra
Mission Specialist
Mission Specialist
  • 1,748 Views

LAB 280 - Unable to save file through OC edit command

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

Labels (1)
0 Kudos
20 Replies
jordisola
Flight Engineer
Flight Engineer
  • 1,730 Views

Re: LAB 280 - Unable to save file through OC edit command

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

Reply
Loading...
chetantiwary
Cadet
Cadet
  • 1,573 Views

Re: LAB 280 - Unable to save file through OC edit command

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 ?

 

DO280-ch06s02.png

Tags (3)
0 Kudos
Reply
Loading...
post2tr
Mission Specialist
Mission Specialist
  • 1,246 Views

Re: LAB 280 - Unable to save file through OC edit command

Is this issue fixed ? i am facing the same error in DO280 Guided exercise

0 Kudos
Reply
Loading...
chetan_tiwary
Flight Engineer
Flight Engineer
  • 1,243 Views

Re: LAB 280 - Unable to save file through OC edit command

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,

 

 

Reply
Loading...
post2tr
Mission Specialist
Mission Specialist
  • 1,239 Views

Re: LAB 280 - Unable to save file through OC edit command

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

0 Kudos
Reply
Loading...
post2tr
Mission Specialist
Mission Specialist
  • 1,235 Views

Re: LAB 280 - Unable to save file through OC edit command

DO280_Chapter-6_GE1.PNGDO280_Chapter-6_GE.PNG

0 Kudos
Reply
Loading...
chetan_tiwary
Flight Engineer
Flight Engineer
  • 1,233 Views

Re: LAB 280 - Unable to save file through OC edit command

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.

DO280ch0602.png

 

DO280ch6s02_1.pngDo280ch06s02_2.png

0 Kudos
Reply
Loading...
chetan_tiwary
Flight Engineer
Flight Engineer
  • 1,228 Views

Re: LAB 280 - Unable to save file through OC edit command

Hello ,

Can you match with the 3 screenshots above ?

0 Kudos
Reply
Loading...
post2tr
Mission Specialist
Mission Specialist
  • 1,223 Views

Re: LAB 280 - Unable to save file through OC edit command

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 ? 

0 Kudos
Reply
Loading...
Join the discussion
You must log in to join this conversation.