Skip to content

Commit

Permalink
remove pykube-ng references
Browse files Browse the repository at this point in the history
  • Loading branch information
Fovty committed May 17, 2024
1 parent 99c4cb1 commit 70cf683
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 66 deletions.
4 changes: 2 additions & 2 deletions docs/howtos/write-an-operator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ You can now test the script locally with Pipenv_ and Minikube_ (run ``minikube s

.. code-block:: bash
pipenv install pykube-ng
pipenv install new-pykube
pipenv run python3 main.py
See the operator in action by creating a deployment with the right annotation:
Expand All @@ -51,7 +51,7 @@ Create a ``Dockerfile`` in the same directory as ``main.py``:
WORKDIR /
RUN pip3 install pykube-ng
RUN pip3 install new-pykube
COPY main.py /
Expand Down
56 changes: 0 additions & 56 deletions docs/index.rst

This file was deleted.

57 changes: 56 additions & 1 deletion docs/readme.rst
Original file line number Diff line number Diff line change
@@ -1 +1,56 @@
.. include:: ../README.rst
Pykube
======

.. image:: https://img.shields.io/pypi/v/new-pykube.svg
:target: https://pypi.python.org/pypi/new-pykube/

.. image:: https://img.shields.io/pypi/pyversions/new-pykube.svg
:target: https://pypi.python.org/pypi/new-pykube/

.. image:: https://img.shields.io/badge/license-apache-blue.svg
:target: https://pypi.python.org/pypi/new-pykube/

Pykube (new-pykube) is a lightweight Python 3+ client library for Kubernetes.

Installation
------------

To install pykube, use pip::

pip install new-pykube

Usage
-----

Query for all ready pods in a custom namespace:

.. code:: python
import operator
import pykube
api = pykube.HTTPClient(pykube.KubeConfig.from_file())
pods = pykube.Pod.objects(api).filter(namespace="gondor-system")
ready_pods = filter(operator.attrgetter("ready"), pods)
Documentation
-------------

.. toctree::
:maxdepth: 2
:glob:

howtos/index
api/modules
README <readme>
changelog
users



Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
4 changes: 2 additions & 2 deletions docs/users.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ Users

The following projects use Pykube:

* `kube-downscaler <https://codeberg.org/hjacobs/kube-downscaler/>`_
* `py-kube-downscaler <https://github.com/caas-team/py-kube-downscaler>`_
* `kube-janitor <https://codeberg.org/hjacobs/kube-janitor/>`_
* `kube-ops-view <https://codeberg.org/hjacobs/kube-ops-view/>`_
* `kube-resource-report <https://codeberg.org/hjacobs/kube-resource-report/>`_
* `kube-web-view <https://codeberg.org/hjacobs/kube-web-view/>`_
* `pytest-kind <https://pypi.org/project/pytest-kind/>`_

Do you know of a project using Pykube and it's not listed here? Please `open a PR <https://codeberg.org/hjacobs/pykube-ng/pulls>`_ to add it to the list.
Do you know of a project using Pykube and it's not listed here? Please `open a PR <https://github.com/caas-team/new-pykube/pulls>`_ to add it to the list.
2 changes: 1 addition & 1 deletion pykube/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def filename(self):
m = hashlib.md5()
m.update(self._bytes)

path = Path(f"{tempfile.gettempdir()}/pykube-ng.{m.hexdigest()}.crt")
path = Path(f"{tempfile.gettempdir()}/new-pykube.{m.hexdigest()}.crt")
if not path.exists() or path.stat().st_size == 0:
with open(path, "wb") as f:
f.write(self._bytes)
Expand Down
6 changes: 3 additions & 3 deletions pykube/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def _refresh_oidc_token(self, config):
if not oidc_auth_installed:
raise ImportError(
"missing dependencies for OIDC token refresh support "
"(try pip install pykube-ng[oidc]"
"(try pip install new-pykube[oidc]"
)
auth_config = config.user["auth-provider"]["config"]
if "idp-certificate-authority" in auth_config:
Expand Down Expand Up @@ -257,7 +257,7 @@ def _setup_request_auth(self, config, request, kwargs):
dependencies = [google_auth_installed, jsonpath_installed]
if not all(dependencies):
raise ImportError(
"missing dependencies for GCP support (try pip install pykube-ng[gcp]"
"missing dependencies for GCP support (try pip install new-pykube[gcp]"
)
auth_config = auth_provider.get("config", {})
if "cmd-path" in auth_config:
Expand Down Expand Up @@ -352,7 +352,7 @@ def __init__(
self.dry_run = dry_run

session = requests.Session()
session.headers["User-Agent"] = f"pykube-ng/{__version__}"
session.headers["User-Agent"] = f"new-pykube/{__version__}"
if not http_adapter:
http_adapter = self.http_adapter_cls(self.config)
session.mount("https://", http_adapter)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_http(monkeypatch):
mock_send.call_args[0][0].headers["Authorization"]
== "Basic YWRtOnNvbWVwYXNzd29yZA=="
)
assert mock_send.call_args[0][0].headers["User-Agent"] == f"pykube-ng/{__version__}"
assert mock_send.call_args[0][0].headers["User-Agent"] == f"new-pykube/{__version__}"
# check that the default HTTP timeout was set
assert mock_send.call_args[1]["timeout"] == DEFAULT_HTTP_TIMEOUT

Expand Down

0 comments on commit 70cf683

Please sign in to comment.