config.yaml is not setting up a new context

I have a kubernetes Config file such as:

apiVersion: v1
kind: Config
preferences: {}
contexts:
- context:
    cluster: test-sim-development
    namespace: test-sim
    user: developer
  name: test-sim

When I issue a command such as:

kubectl config --kubeconfig infra_k8/config.yaml set-context test-sim && kubectl config use-context test-sim

I get back the following error output:

Context "test-sim" modified.
error: no context exists with the name: "test-sim"

Why is it not finding the “test-sim” name? It is clearly referenced according to the kubernetes docs.

Go to Source
Author: Nona