kubernator 1.0.23.dev20251007071019__py3-none-any.whl → 1.0.23.dev20251008231728__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.
Potentially problematic release.
This version of kubernator might be problematic. Click here for more details.
- kubernator/__init__.py +1 -1
- kubernator/plugins/kubectl.py +36 -4
- kubernator/plugins/minikube.py +19 -1
- {kubernator-1.0.23.dev20251007071019.dist-info → kubernator-1.0.23.dev20251008231728.dist-info}/METADATA +1 -1
- {kubernator-1.0.23.dev20251007071019.dist-info → kubernator-1.0.23.dev20251008231728.dist-info}/RECORD +10 -10
- {kubernator-1.0.23.dev20251007071019.dist-info → kubernator-1.0.23.dev20251008231728.dist-info}/WHEEL +0 -0
- {kubernator-1.0.23.dev20251007071019.dist-info → kubernator-1.0.23.dev20251008231728.dist-info}/entry_points.txt +0 -0
- {kubernator-1.0.23.dev20251007071019.dist-info → kubernator-1.0.23.dev20251008231728.dist-info}/namespace_packages.txt +0 -0
- {kubernator-1.0.23.dev20251007071019.dist-info → kubernator-1.0.23.dev20251008231728.dist-info}/top_level.txt +0 -0
- {kubernator-1.0.23.dev20251007071019.dist-info → kubernator-1.0.23.dev20251008231728.dist-info}/zip-safe +0 -0
kubernator/__init__.py
CHANGED
kubernator/plugins/kubectl.py
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
# limitations under the License.
|
|
17
17
|
#
|
|
18
18
|
|
|
19
|
+
import io
|
|
19
20
|
import json
|
|
20
21
|
import logging
|
|
21
22
|
import os
|
|
@@ -23,6 +24,8 @@ import tempfile
|
|
|
23
24
|
from pathlib import Path
|
|
24
25
|
from shutil import which, copy
|
|
25
26
|
|
|
27
|
+
import yaml
|
|
28
|
+
|
|
26
29
|
from kubernator.api import (KubernatorPlugin,
|
|
27
30
|
prepend_os_path,
|
|
28
31
|
StripNL,
|
|
@@ -89,15 +92,44 @@ class KubectlPlugin(KubernatorPlugin):
|
|
|
89
92
|
context.globals.kubectl = dict(version=version,
|
|
90
93
|
kubectl_file=kubectl_file,
|
|
91
94
|
stanza=self.stanza,
|
|
92
|
-
test=self.test_kubectl
|
|
95
|
+
test=self.test_kubectl,
|
|
96
|
+
run=self.run,
|
|
97
|
+
run_capturing=self.run_capturing,
|
|
98
|
+
get=self.get,
|
|
93
99
|
)
|
|
94
100
|
|
|
95
101
|
context.globals.kubectl.version = context.kubectl.test()
|
|
96
102
|
|
|
103
|
+
def run_capturing(self, *args, **kwargs):
|
|
104
|
+
return self.context.app.run_capturing_out(self.stanza() +
|
|
105
|
+
list(args),
|
|
106
|
+
stderr_logger,
|
|
107
|
+
**kwargs
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
def run(self, *args, **kwargs):
|
|
111
|
+
self.context.app.run(self.stanza() +
|
|
112
|
+
list(args),
|
|
113
|
+
stdout_logger,
|
|
114
|
+
stderr_logger,
|
|
115
|
+
**kwargs
|
|
116
|
+
).wait()
|
|
117
|
+
|
|
118
|
+
def get(self, resource_type, resource_name, namespace=None):
|
|
119
|
+
args = ["get", resource_type, resource_name]
|
|
120
|
+
if namespace:
|
|
121
|
+
args += ["-n", namespace]
|
|
122
|
+
args += ["-o", "yaml"]
|
|
123
|
+
|
|
124
|
+
res = list(yaml.safe_load_all(io.StringIO(self.context.kubectl.run_capturing(*args))))
|
|
125
|
+
if len(res):
|
|
126
|
+
if len(res) > 1:
|
|
127
|
+
return res
|
|
128
|
+
return res[0]
|
|
129
|
+
return None
|
|
130
|
+
|
|
97
131
|
def test_kubectl(self):
|
|
98
|
-
version_out: str = self.
|
|
99
|
-
["version", "--client=true", "-o", "json"],
|
|
100
|
-
stderr_logger)
|
|
132
|
+
version_out: str = self.run_capturing("version", "--client=true", "-o", "json")
|
|
101
133
|
|
|
102
134
|
version_out_js = json.loads(version_out)
|
|
103
135
|
kubectl_version = version_out_js["clientVersion"]["gitVersion"][1:]
|
kubernator/plugins/minikube.py
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
# See the License for the specific language governing permissions and
|
|
16
16
|
# limitations under the License.
|
|
17
17
|
#
|
|
18
|
-
|
|
18
|
+
import json
|
|
19
19
|
import logging
|
|
20
20
|
import os
|
|
21
21
|
import tempfile
|
|
@@ -224,6 +224,24 @@ class MinikubePlugin(KubernatorPlugin):
|
|
|
224
224
|
logger.info("Updating minikube profile %r context", minikube.profile)
|
|
225
225
|
self.cmd("update-context")
|
|
226
226
|
|
|
227
|
+
if minikube.k8s_version_tuple >= (1, 28):
|
|
228
|
+
logger.info("Disabling old storage addons")
|
|
229
|
+
self.cmd("addons", "disable", "storage-provisioner")
|
|
230
|
+
self.cmd("addons", "disable", "default-storageclass")
|
|
231
|
+
|
|
232
|
+
logger.info("Running initialization scripts for profile %r", minikube.profile)
|
|
233
|
+
self.context.app.register_plugin("kubectl", version=minikube.k8s_version)
|
|
234
|
+
if minikube.k8s_version_tuple >= (1, 28):
|
|
235
|
+
storage_class = self.context.kubectl.get("storageclass", "csi-hostpath-sc")
|
|
236
|
+
self.context.kubectl.run("delete", "storageclass", "csi-hostpath-sc")
|
|
237
|
+
storage_class["metadata"]["annotations"]["storageclass.kubernetes.io/is-default-class"] = "true"
|
|
238
|
+
storage_class["volumeBindingMode"] = "WaitForFirstConsumer"
|
|
239
|
+
|
|
240
|
+
def write_stdin():
|
|
241
|
+
return json.dumps(storage_class)
|
|
242
|
+
|
|
243
|
+
self.context.kubectl.run("create", "-f", "-", stdin=write_stdin)
|
|
244
|
+
|
|
227
245
|
def minikube_stop(self):
|
|
228
246
|
minikube = self.context.minikube
|
|
229
247
|
if self.minikube_is_running():
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kubernator
|
|
3
|
-
Version: 1.0.23.
|
|
3
|
+
Version: 1.0.23.dev20251008231728
|
|
4
4
|
Summary: Kubernator is the a pluggable framework for K8S provisioning
|
|
5
5
|
Home-page: https://github.com/karellen/kubernator
|
|
6
6
|
Author: Express Systems USA, Inc.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
kubernator/LICENSE,sha256=wKKdOCMTCPQRV5gDkVLAsXX8qSnRJ5owk7yWPO1KZNo,11387
|
|
2
|
-
kubernator/__init__.py,sha256=
|
|
2
|
+
kubernator/__init__.py,sha256=2aaiu4g6n1nK3G3TMavPBCgPb7S3rn_jWYKWeQaWw0I,933
|
|
3
3
|
kubernator/__main__.py,sha256=f0S60wgpLu--1UlOhzfWail-xt8zyIuODodX98_yPN0,707
|
|
4
4
|
kubernator/_json_path.py,sha256=pjQKXxgbpQWETYBIrIuJZHgugF92IbEAM19AC7JUmAQ,3162
|
|
5
5
|
kubernator/_k8s_client_patches.py,sha256=PEeWPInnW38NDyK7G24_Dmw-x7xHpN3vJWZeckdqgK0,76892
|
|
@@ -17,15 +17,15 @@ kubernator/plugins/k8s.py,sha256=XIHqFpdbRL57dnbgOonRD3Mxs9LVSUxQT-GPnpEyZyM,247
|
|
|
17
17
|
kubernator/plugins/k8s_api.py,sha256=PDa7MB9q3WMm_9tr8T6LY_ojrHpyGYiNTlvBZinbgFY,27379
|
|
18
18
|
kubernator/plugins/kops.py,sha256=-yhpEjydz9E7Ep24WtEs93rLTXtw4yakdgVqXlIj1ww,9688
|
|
19
19
|
kubernator/plugins/kubeconfig.py,sha256=uwtHmF2I6LiTPrC3M88G5SfYxDWtuh0MqcMfrHHoNRA,2178
|
|
20
|
-
kubernator/plugins/kubectl.py,sha256=
|
|
21
|
-
kubernator/plugins/minikube.py,sha256=
|
|
20
|
+
kubernator/plugins/kubectl.py,sha256=hV6rnTj0XmQe5QJp3p6fNK3EQrWdNlam0qxsK3IkD5g,5125
|
|
21
|
+
kubernator/plugins/minikube.py,sha256=zbboER1VsCvIsh-yUE3_XpzPNcT4c6vh1LigDonEm3U,12384
|
|
22
22
|
kubernator/plugins/template.py,sha256=542nyS4ZNgdwJHEoIA5aLP1d4C312ydd7sPM9ZFbHuI,8357
|
|
23
23
|
kubernator/plugins/terraform.py,sha256=a1MPl9G8Rznjd28uMRdYWrjpFDLlFAVmLFH4hFEsMsQ,5285
|
|
24
24
|
kubernator/plugins/terragrunt.py,sha256=-qN8tTqPUXJ9O7CEiJVUB0GSUQU3DUTkv-aWdIIsm7Q,5051
|
|
25
|
-
kubernator-1.0.23.
|
|
26
|
-
kubernator-1.0.23.
|
|
27
|
-
kubernator-1.0.23.
|
|
28
|
-
kubernator-1.0.23.
|
|
29
|
-
kubernator-1.0.23.
|
|
30
|
-
kubernator-1.0.23.
|
|
31
|
-
kubernator-1.0.23.
|
|
25
|
+
kubernator-1.0.23.dev20251008231728.dist-info/METADATA,sha256=0yPWkwLaU5qE8qcUzX-Rzw5tL_qprEbUVzv8hm44Gh4,10840
|
|
26
|
+
kubernator-1.0.23.dev20251008231728.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
27
|
+
kubernator-1.0.23.dev20251008231728.dist-info/entry_points.txt,sha256=IWDtHzyTleRqDSuVRXEr5GImrI7z_kh21t5DWZ8ldcQ,47
|
|
28
|
+
kubernator-1.0.23.dev20251008231728.dist-info/namespace_packages.txt,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
29
|
+
kubernator-1.0.23.dev20251008231728.dist-info/top_level.txt,sha256=_z1CxWeKMI55ckf2vC8HqjbCn_E2Y_P5RdrhE_QWcIs,11
|
|
30
|
+
kubernator-1.0.23.dev20251008231728.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
31
|
+
kubernator-1.0.23.dev20251008231728.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|