Repository: kubernetes-client/python (python)

Issue:
Version 32.0.0 gke-gcloud-auth-plugin configuration break
**What happened (please include outputs or screenshots)**:

Attempting to run a simple test program to merely load configuration breaks with a json.dumps TypeError error when using a configuration file similar to those generated by executing the `gcloud container clusters get-credentials <cluster> --region <region> --project <gcp_project>` command with the `gke-gcloud-auth-plugin` authentication helper installed:
```
$ cat test.py
from kubernetes import client, config
config.load_kube_config()
$ KUBECONFIG=config python test.py
ERROR:root:Object of type ConfigNode is not JSON serializable
```

**What you expected to happen**:

Empty output (provided a valid non-example configuration is provided and one has the gcloud auth plugin installed).

**How to reproduce it (as minimally and precisely as possible)**:

Create a test Kubernetes configuration file as follows as a file called `config`:
```
apiVersion: v1
kind: Config
preferences: {}
contexts:
- context:
    cluster: test-cluster
    user: test-user
  name: test
clusters:
- cluster:
    certificate-authority-data: bm90X2FfcmVhbF9jZXJ0Cg==
    server: https://w.x.y.z
  name: test-cluster
users:
- name: test-user
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1beta1
      command: gke-gcloud-auth-plugin
      installHint: Install gke-gcloud-auth-plugin for use with kubectl by following
        https://cloud.google.com/kubernetes-engine/docs/how-to/cluster-access-for-kubectl#install_plugin
      provideClusterInfo: true
current-context: test
```

Create a `test.py` script as follows:
```
from kubernetes import client, config
config.load_kube_config()
```

Ensure kubernetes 32.0.0 is installed (31.0.0 works for me):
```
pip install kubernetes==32.0.0
```

Execute the script, specifying the `KUBECONFIG` environment variable to override the default location to your test file:
```
KUBECONFIG=config python test.py
```

You should receive the following error message from the default logger due to the error being caught and logged without a stacktrace:
```
ERROR:root:Object of type ConfigNode is not JSON serializable
```

**Anything else we need to know?**:

This is likely due to the call here passing in a `kubernetes_exec_info` structure containing a ConfigNode instance rather than serializable Python native types:
https://github.com/kubernetes-client/python/blob/v32.0.0/kubernetes/base/config/exec_provider.py#L76

I haven't looked extensively into what could have changed between versions, but version 31.0.0 appears to work; FWIW here's the requirements.txt for a more-involved test project where version 31.0.0 appears to function with the test file; swapping kubernetes==32.0.0 in breaks it:
```
toml==0.10.2
typer==0.15.1
google-cloud-logging==3.11.3
kubernetes==31.0.0
```

I'm also using pyenv with a virtualenv whereas the `gke-gcloud-auth-plugin` binary likely uses the system python installation; this shouldn't matter as it's invoked in a subprocess, just as relative versus absolute path in the kube config for it likewise doesn't make a difference. You shouldn't need to even install it to reproduce, as it fails prior to the subprocess call AFAICT; that said, I haven't tried it on a totally 100% clean system without it installed.

**Environment**:
- Kubernetes version (`kubectl version`):
```
Client Version: v1.31.2
Kustomize Version: v5.4.2
Server Version: v1.31.4-gke.1256000
```

- OS:
Mac OSX 12.6.1

- Python version (`python --version`)
```
Python 3.9.20
```

- Python client version (`pip list | grep kubernetes`)
```
kubernetes                     32.0.0
```

Pull request:
Fix exec provider
<!--  Thanks for sending a pull request!  Here are some tips for you:

1. If this is your first time, please read our contributor guidelines: https://git.k8s.io/community/contributors/guide/first-contribution.md#your-first-contribution and developer guide https://git.k8s.io/community/contributors/devel/development.md#development-guide
2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request. For reference on required PR/issue labels, read here:
https://git.k8s.io/community/contributors/devel/sig-release/release.md#issuepr-kind-label
3. Ensure you have added or ran the appropriate tests for your PR: https://git.k8s.io/community/contributors/devel/sig-testing/testing.md
4. If you want *faster* PR reviews, read how: https://git.k8s.io/community/contributors/guide/pull-requests.md#best-practices-for-faster-reviews
5. If the PR is unfinished, see how to mark it: https://git.k8s.io/community/contributors/guide/pull-requests.md#marking-unfinished-pull-requests
-->

#### What type of PR is this?

/kind bug
/kind regression

<!--
Add one of the following kinds:
/kind cleanup
/kind documentation
/kind feature
/kind design

Optionally add one or more of the following kinds if applicable:
/kind api-change
/kind deprecation
/kind failing-test
/kind flake
-->

#### What this PR does / why we need it:

The `ExecProvider` has a regression, probably due to 8c60fe94e06b8364d95cd35c22fdaf3177c1c564, resulting in broken auth when using the exec provider in provided kubeconfig.

#### Which issue(s) this PR fixes:

Fixes #2334

<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
_If PR is about `failing-tests or flakes`, please post the related issues/tests in a comment and do not use `Fixes`_*
-->

#### Special notes for your reviewer:

#### Does this PR introduce a user-facing change?

<!--
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".

For more information on release notes see: https://git.k8s.io/community/contributors/guide/release-notes.md
-->

```release-note
Fixes bug that would fail authentication when using the exec-provider with a specific cluster selected
```

#### Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

<!--
This section can be blank if this pull request does not require a release note.

When adding links which point to resources within git repositories, like
KEPs or supporting documentation, please reference a specific commit and avoid
linking directly to the master branch. This ensures that links reference a
specific point in time, rather than a document that may change over time.

See here for guidance on getting permanent links to files: https://help.github.com/en/articles/getting-permanent-links-to-files

Please use the following format for linking documentation:
- [KEP]: <link>
- [Usage]: <link>
- [Other doc]: <link>
-->

```docs

```


Patch:
diff --git a/kubernetes/base/config/exec_provider.py b/kubernetes/base/config/exec_provider.py
index 317a56695..03dc0386e 100644
--- a/kubernetes/base/config/exec_provider.py
+++ b/kubernetes/base/config/exec_provider.py
@@ -71,7 +71,7 @@ class ExecProvider(object):
         if previous_response:
             kubernetes_exec_info['spec']['response'] = previous_response
         if self.cluster:
-            kubernetes_exec_info['spec']['cluster'] = self.cluster
+            kubernetes_exec_info['spec']['cluster'] = self.cluster.value
 
         self.env['KUBERNETES_EXEC_INFO'] = json.dumps(kubernetes_exec_info)
         process = subprocess.Popen(


Test patch:
diff --git a/kubernetes/base/config/exec_provider_test.py b/kubernetes/base/config/exec_provider_test.py
index 9ff62d12e..fc4944b22 100644
--- a/kubernetes/base/config/exec_provider_test.py
+++ b/kubernetes/base/config/exec_provider_test.py
@@ -175,7 +175,7 @@ class ExecProviderTest(unittest.TestCase):
         instance = mock.return_value
         instance.wait.return_value = 0
         instance.communicate.return_value = (self.output_ok, '')
-        ep = ExecProvider(self.input_with_cluster, None, {'server': 'name.company.com'})
+        ep = ExecProvider(self.input_with_cluster, None, ConfigNode("cluster", {'server': 'name.company.com'}))
         result = ep.run()
         self.assertTrue(isinstance(result, dict))
         self.assertTrue('token' in result)