cancel
Showing results for 
Search instead for 
Did you mean: 
Rajbatra
Mission Specialist
Mission Specialist
  • 13.1K Views

LAB 280 - Unable to save file through OC edit command

Jump to solution

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)
1 Solution

Accepted Solutions
chetantiwary
Moderator
Moderator
  • 8,226 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 ?

 

DO280-ch06s02.png

View solution in original post

Tags (3)
23 Replies
jordisola
Flight Engineer
Flight Engineer
  • 8,383 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

chetantiwary
Moderator
Moderator
  • 8,227 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 ?

 

DO280-ch06s02.png

Tags (3)
post2tr
Mission Specialist
Mission Specialist
  • 7,899 Views

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

0 Kudos
Chetan_Tiwary_
Community Manager
Community Manager
  • 7,896 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,

 

 

post2tr
Mission Specialist
Mission Specialist
  • 7,892 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

post2tr
Mission Specialist
Mission Specialist
  • 7,888 Views

DO280_Chapter-6_GE1.PNGDO280_Chapter-6_GE.PNG

Chetan_Tiwary_
Community Manager
Community Manager
  • 7,886 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.

DO280ch0602.png

 

DO280ch6s02_1.pngDo280ch06s02_2.png

0 Kudos
Chetan_Tiwary_
Community Manager
Community Manager
  • 7,881 Views

Hello ,

Can you match with the 3 screenshots above ?

0 Kudos
post2tr
Mission Specialist
Mission Specialist
  • 7,876 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 ? 

Join the discussion
You must log in to join this conversation.