Validation for a output in mock exame

Hi KodeKloud,

I have face an possible bug in mock exam for CKA.

The questions asks for:

There is a script located at /root/pod-cka26-arch.sh on the student-node. Update this script to add a command to filter/display the label with value component of the pod called kube-apiserver-cluster1-controlplane (on cluster1) using jsonpath.

my answer:

k get pods -n kube-system kube-apiserver-cluster1-controlplane -o jsonpath=β€˜{.metadata.labels.component}’

But in the end of exame, this asnwer has not pass and the expected answer was:

kubectl --context cluster1 get pod -n kube-system kube-apiserver-cluster1-controlplane -o jsonpath=β€˜{.metadata.labels.component}’

Which give me some doubts:

For all answer in the Official exame:

  • A) Why my answer is wrong ?

  • B) Do I need to always use the kubectl instead K ?

  • C) Once in the beggning I’m setting the context, should I uses the --context in all questions also ?

The likely problem here is the use of the β€œk” alias in your answer; aliases only resolve in certain contexts, and in scripts, they generally do not. So the grader won’t approve this as a result.

The grader really should allow for an answer w/o the --context flag, but I’d recommend fixing the alias issue before we worry about that.

1 Like

Hello Rob,

Now again almost the same error:

it is expected informed in the end of exame the following setence:

kubectl --context cluster1 get pod -n kube-system kube-apiserver-cluster1-controlplane -o jsonpath=β€˜{.metadata.labels.component}’

Once more, my answer now it is:

kubectl get pod --namespace=kube-system kube-apiserver-cluster1-controlplane -o jsonpath=β€˜{.metadata.labels.component}’

And get an error again, I’m almost concerned that KodeKloud is requiring the context data in the answer to validate.

Remember that beggning of file there is the #! /bin/bash due the script, and this is not being deleted !

Maybe is a internal validation by Kodecloud need get be reviewed, anyway Thank you Rob

The Ultimate Mock Exams are relatively new, and grading variable input can be difficult to get right; before I started my support gig with KodeKloud, I did renewed my CKA, so I have also reported my share of validation issues :slight_smile: We fix them as we find them, to make the grader code more robust.

Try adding the --context flag and see if it makes the grader STFU (F is for β€œfutz”) If it does, it sounds even more like a legit grader issue – and it already sounds like a legit grader issue.