Skip to content

Commit

Permalink
Add missing required deps to kube-downscaler
Browse files Browse the repository at this point in the history
Signed-off-by: Furkan Türkal <[email protected]>
  • Loading branch information
Dentrax committed Nov 6, 2023
1 parent f353e48 commit 469b8f2
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 12 deletions.
26 changes: 14 additions & 12 deletions kube-downscaler.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
package:
name: kube-downscaler
version: 23.2.0
epoch: 6
epoch: 7
description: Scale down Kubernetes deployments after work hours
copyright:
- license: GPL-3.0-or-later
dependencies:
runtime:
- python3
- py3-pykube-ng
- py3-pytz

environment:
contents:
Expand All @@ -14,6 +19,9 @@ environment:
- build-base
- python3
- python3-dev
- py3-urllib3
- py3-idna
- py3-charset-normalizer
- poetry

pipeline:
Expand All @@ -23,18 +31,12 @@ pipeline:
tag: ${{package.version}}
expected-commit: c005fc8840500da7c4e2c024ff4ad77eaf470075

- runs: |
mkdir -p ${{targets.destdir}}/usr/lib/python3.11/site-packages
poetry config virtualenvs.create false
# Patch CVE-2022-23491, CVE-2023-32681, CVE-2023-37920 and GHSA-v8gr-m533-ghj9
poetry update certifi requests cryptography --only main
poetry lock
- uses: patch
with:
patches: 0001-use-setuptools.patch

poetry install --no-interaction --only main --no-ansi -vvv
mv /usr/lib/python3.11/site-packages/* ${{targets.destdir}}/usr/lib/python3.11/site-packages
mv kube_downscaler/ ${{targets.destdir}}/
sed -i "s/__version__ = .*/__version__ = '${{package.version}}'/" ${{targets.destdir}}/kube_downscaler/__init__.py
- name: Python Build
uses: python/build-wheel

- uses: strip

Expand Down
50 changes: 50 additions & 0 deletions kube-downscaler/0001-use-setuptools.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Poerty keep tries to downgrade packages for some reason, lets use `setup.py`.
From 81d3142295029e2e0aba7f49db75fde676f6fffb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Furkan=20T=C3=BCrkal?= <[email protected]>
Date: Mon, 6 Nov 2023 21:26:03 +0300
Subject: [PATCH] use setuptools
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Furkan Türkal <[email protected]>
---
setup.py | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
create mode 100644 setup.py

diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..7124e92
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,26 @@
+from setuptools import setup, find_packages
+
+setup(
+ name="kube-downscaler",
+ version="2020.1.1.dev0",
+ description="Scale down Kubernetes deployments after work hours",
+ author="Henning Jacobs",
+ author_email="[email protected]",
+ packages=find_packages(),
+ install_requires=[
+ "pykube-ng",
+ "pytz",
+ ],
+ extras_require={
+ "dev": [
+ "coverage",
+ "coveralls",
+ "flake8",
+ "pytest",
+ "pytest-cov",
+ "black==22.3.0",
+ "mypy==0.761",
+ "pre-commit==2.9.2",
+ ],
+ },
+)
--
2.39.2 (Apple Git-143)

0 comments on commit 469b8f2

Please sign in to comment.