Label Value Pod Mock CKA Series

In this question, we need to find out, value of one of the label pod named as component, all semes be fine but still in result section, it considered as wrong:

Seems to be working

From the cat command I see on your screenshot, it is missing --context cluster1 in the script.

please help me understand, why it is necessary to add --context cluster, when I already switched contexts.
Also, my command which is without “–context cluster,” is givng the same result and desired output.

I think the idea is that the script will get the right result whatever the current context is set to. This is quite common when creating automaton.

You don’t want to have to tell the user “you must set the context to such and such a cluster before you run my script”.

The script by specifying the context it wants will always get the desired result without either changing the user’s context unexpectedly or requiring the user to set it first.

Thanks, Will check and get back, Can you please respond on my other two questions.
(PVC Storage Mock Series Question)
(CKA Mock Test - Core DNS Pods)