k8s-helper-cli 0.4.1__py3-none-any.whl → 0.4.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
k8s_helper/__init__.py CHANGED
@@ -20,7 +20,7 @@ from .utils import (
20
20
  create_service_manifest
21
21
  )
22
22
 
23
- __version__ = "0.4.0"
23
+ __version__ = "0.4.2"
24
24
  __author__ = "Harshit Chatterjee"
25
25
  __email__ = "harshitchatterjee50@gmail.com"
26
26
 
k8s_helper/core.py CHANGED
@@ -1964,15 +1964,33 @@ scrape_configs:
1964
1964
  raise e
1965
1965
 
1966
1966
  # ClusterRoleBinding
1967
- cluster_role_binding = client.V1ClusterRoleBinding(
1968
- metadata=client.V1ObjectMeta(name="prometheus"),
1969
- subjects=[
1970
- client.V1Subject(
1967
+ # Create subject with version compatibility
1968
+ try:
1969
+ # Try V1Subject first (older versions)
1970
+ subject = client.V1Subject(
1971
+ kind="ServiceAccount",
1972
+ name="prometheus",
1973
+ namespace=namespace
1974
+ )
1975
+ except AttributeError:
1976
+ # Try RbacV1Subject (newer versions)
1977
+ try:
1978
+ subject = client.RbacV1Subject(
1971
1979
  kind="ServiceAccount",
1972
1980
  name="prometheus",
1973
1981
  namespace=namespace
1974
1982
  )
1975
- ],
1983
+ except AttributeError:
1984
+ # Manual construction as fallback
1985
+ subject = {
1986
+ 'kind': 'ServiceAccount',
1987
+ 'name': 'prometheus',
1988
+ 'namespace': namespace
1989
+ }
1990
+
1991
+ cluster_role_binding = client.V1ClusterRoleBinding(
1992
+ metadata=client.V1ObjectMeta(name="prometheus"),
1993
+ subjects=[subject],
1976
1994
  role_ref=client.V1RoleRef(
1977
1995
  kind="ClusterRole",
1978
1996
  name="prometheus",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: k8s-helper-cli
3
- Version: 0.4.1
3
+ Version: 0.4.2
4
4
  Summary: A simplified Python wrapper for common Kubernetes operations
5
5
  Author-email: Harshit Chatterjee <harshitchatterjee50@gmail.com>
6
6
  License-Expression: MIT
@@ -0,0 +1,11 @@
1
+ k8s_helper/__init__.py,sha256=YuM-ES4NKCK-M1VusIhUSIsO8vigHDWGPyAS6bvShgw,2666
2
+ k8s_helper/cli.py,sha256=ngXnZ-6EaTm9hCViLPOLZya4HtFDsqpPbLYnOBEfQmA,79400
3
+ k8s_helper/config.py,sha256=P7YdfyvCHprrNs2J9DRb3RrClylfTTh5hfTtDzLug0A,6867
4
+ k8s_helper/core.py,sha256=HCsDx8xApBvgDooR3XqaW2ZeIzQU35oGm6rfjTBzYVc,110654
5
+ k8s_helper/utils.py,sha256=wYgTd5ktyuI-EiVcfW7FrxA7MzXY5odrEKQgmMVdueY,9496
6
+ k8s_helper_cli-0.4.2.dist-info/licenses/LICENSE,sha256=tXPvVl3gLVc6e0qCEoLH9KjeA7z4JVL78UybpvGtBCw,1096
7
+ k8s_helper_cli-0.4.2.dist-info/METADATA,sha256=p6tE1EFVcCIGx5vwv-L-EDB-K5VRbOtAXcc5z2K5dXM,30789
8
+ k8s_helper_cli-0.4.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
9
+ k8s_helper_cli-0.4.2.dist-info/entry_points.txt,sha256=IoCMWUZ6mn90LwzQzEy5YkWOwvogDdZ6ycqUWAzCFTQ,50
10
+ k8s_helper_cli-0.4.2.dist-info/top_level.txt,sha256=x9A1jflyer-z2cFnkqk5B42juoH2q0fy5hkT9upsTG8,11
11
+ k8s_helper_cli-0.4.2.dist-info/RECORD,,
@@ -1,11 +0,0 @@
1
- k8s_helper/__init__.py,sha256=XDUF1icyJlQZbTC8B1N4sI8nxUs9X9nJO2EOHzVVq4E,2666
2
- k8s_helper/cli.py,sha256=ngXnZ-6EaTm9hCViLPOLZya4HtFDsqpPbLYnOBEfQmA,79400
3
- k8s_helper/config.py,sha256=P7YdfyvCHprrNs2J9DRb3RrClylfTTh5hfTtDzLug0A,6867
4
- k8s_helper/core.py,sha256=g6PjbbOqfc9n6CbSJLmglxaDLYdLZltc1V2z0bxpAHk,109980
5
- k8s_helper/utils.py,sha256=wYgTd5ktyuI-EiVcfW7FrxA7MzXY5odrEKQgmMVdueY,9496
6
- k8s_helper_cli-0.4.1.dist-info/licenses/LICENSE,sha256=tXPvVl3gLVc6e0qCEoLH9KjeA7z4JVL78UybpvGtBCw,1096
7
- k8s_helper_cli-0.4.1.dist-info/METADATA,sha256=xwNsN6p-TUlQLnN-9HtMEu-Z5cnvlRIFt4F8SmfKzKM,30789
8
- k8s_helper_cli-0.4.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
9
- k8s_helper_cli-0.4.1.dist-info/entry_points.txt,sha256=IoCMWUZ6mn90LwzQzEy5YkWOwvogDdZ6ycqUWAzCFTQ,50
10
- k8s_helper_cli-0.4.1.dist-info/top_level.txt,sha256=x9A1jflyer-z2cFnkqk5B42juoH2q0fy5hkT9upsTG8,11
11
- k8s_helper_cli-0.4.1.dist-info/RECORD,,