Skip to content

Commit be0c73a

Browse files
authored
Python kopf 1.35.4 (#580)
* Python kopf s2i v1.35.4 * Update for python-kopf-s2i with odo 2.5
1 parent 93b6502 commit be0c73a

6 files changed

Lines changed: 55 additions & 80 deletions

File tree

build-s2i-python-kopf/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ FROM registry.access.redhat.com/ubi8/python-39:latest
22

33
MAINTAINER Johnathan Kupferer <[email protected]>
44

5-
ENV OPENSHIFT_CLIENT_VERSION=4.8.2 \
6-
HELM_VERSION=3.6.3
5+
ENV OPENSHIFT_CLIENT_VERSION=4.10.9 \
6+
HELM_VERSION=3.8.2
77

88
LABEL io.k8s.description="Python Kopf - Kubernetes Operator Framework" \
99
io.k8s.display-name="Kopf Operator" \
Lines changed: 18 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,27 @@
1-
schemaVersion: 2.0.0
2-
metadata:
3-
name: kopf-simple
4-
version: 1.0.0
5-
components:
6-
- name: s2i-builder
7-
container:
8-
env:
9-
- name: ODO_S2I_SCRIPTS_URL
10-
value: /usr/libexec/s2i
11-
- name: ODO_S2I_SCRIPTS_PROTOCOL
12-
value: image://
13-
- name: ODO_S2I_SRC_BIN_PATH
14-
value: /tmp
15-
- name: ODO_S2I_DEPLOYMENT_DIR
16-
value: ""
17-
- name: ODO_S2I_WORKING_DIR
18-
value: /opt/app-root/src
19-
- name: ODO_S2I_BUILDER_IMG
20-
value: quay.io/redhat-cop/python-kopf-s2i:latest
21-
- name: ODO_SRC_BACKUP_DIR
22-
value: /opt/app-root/src-backup
23-
- name: ODO_S2I_CONVERTED_DEVFILE
24-
value: "true"
25-
image: quay.io/redhat-cop/python-kopf-s2i:latest
26-
mountSources: true
27-
sourceMapping: /tmp/projects
281
commands:
29-
- id: s2i-assemble
30-
exec:
31-
commandLine: /opt/odo/bin/s2i-setup && /opt/odo/bin/assemble-and-restart
2+
- exec:
3+
commandLine: /usr/libexec/s2i/assemble
324
component: s2i-builder
335
group:
346
isDefault: true
357
kind: build
36-
- id: s2i-run
37-
exec:
38-
commandLine: /opt/odo/bin/run
8+
workingDir: ${PROJECT_SOURCE}
9+
id: s2i-assemble
10+
- exec:
11+
commandLine: /usr/libexec/s2i/run
3912
component: s2i-builder
4013
group:
4114
isDefault: true
4215
kind: run
16+
workingDir: ${PROJECT_SOURCE}
17+
id: s2i-run
18+
components:
19+
- container:
20+
image: quay.io/redhat-cop/python-kopf-s2i
21+
mountSources: true
22+
sourceMapping: /tmp/projects
23+
name: s2i-builder
24+
metadata:
25+
name: kopf-simple
26+
version: 1.0.0
27+
schemaVersion: 2.0.0
Lines changed: 18 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,27 @@
1-
schemaVersion: 2.0.0
2-
metadata:
3-
name: openshift-template-deployer
4-
version: 1.0.0
5-
components:
6-
- name: s2i-builder
7-
container:
8-
env:
9-
- name: ODO_S2I_SCRIPTS_URL
10-
value: /usr/libexec/s2i
11-
- name: ODO_S2I_SCRIPTS_PROTOCOL
12-
value: image://
13-
- name: ODO_S2I_SRC_BIN_PATH
14-
value: /tmp
15-
- name: ODO_S2I_DEPLOYMENT_DIR
16-
value: ""
17-
- name: ODO_S2I_WORKING_DIR
18-
value: /opt/app-root/src
19-
- name: ODO_S2I_BUILDER_IMG
20-
value: quay.io/redhat-cop/python-kopf-s2i:latest
21-
- name: ODO_SRC_BACKUP_DIR
22-
value: /opt/app-root/src-backup
23-
- name: ODO_S2I_CONVERTED_DEVFILE
24-
value: "true"
25-
image: quay.io/redhat-cop/python-kopf-s2i:latest
26-
mountSources: true
27-
sourceMapping: /tmp/projects
281
commands:
29-
- id: s2i-assemble
30-
exec:
31-
commandLine: /opt/odo/bin/s2i-setup && /opt/odo/bin/assemble-and-restart
2+
- exec:
3+
commandLine: /usr/libexec/s2i/assemble
324
component: s2i-builder
335
group:
346
isDefault: true
357
kind: build
36-
- id: s2i-run
37-
exec:
38-
commandLine: /opt/odo/bin/run
8+
workingDir: ${PROJECT_SOURCE}
9+
id: s2i-assemble
10+
- exec:
11+
commandLine: /usr/libexec/s2i/run
3912
component: s2i-builder
4013
group:
4114
isDefault: true
4215
kind: run
16+
workingDir: ${PROJECT_SOURCE}
17+
id: s2i-run
18+
components:
19+
- container:
20+
image: quay.io/redhat-cop/python-kopf-s2i
21+
mountSources: true
22+
sourceMapping: /tmp/projects
23+
name: s2i-builder
24+
metadata:
25+
name: openshift-template-deployer
26+
version: 1.0.0
27+
schemaVersion: 2.0.0
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
kopf==1.35.3
2-
kubernetes==12.0.1
3-
openshift==0.12.1
4-
pykube-ng==21.3.0
1+
kopf==1.35.4
2+
kubernetes==23.6.0
3+
openshift==0.13.1
4+
pykube-ng==22.1.0

build-s2i-python-kopf/s2i/assemble

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,23 @@ shopt -s dotglob
1010

1111

1212
mkdir /opt/app-root/src -p
13-
cp --preserve=mode --recursive /tmp/src/operator /opt/app-root/
14-
rm -rf /tmp/src/operator
15-
cp --preserve=mode --recursive /tmp/src/* /opt/app-root/src/
16-
rm -rf /tmp/src
13+
if [[ -d /tmp/src ]]; then
14+
cp --preserve=mode --recursive /tmp/src/operator /opt/app-root/
15+
rm -rf /tmp/src/operator
16+
cp --preserve=mode --recursive /tmp/src/* /opt/app-root/src/
17+
cd /opt/app-root/src
18+
rm -rf /tmp/src
19+
else
20+
cp --preserve=mode --recursive operator /opt/app-root/
21+
fi
1722

1823
if [[ -s /opt/app-root/src/requirements.txt ]]; then
19-
pip3 install --upgrade --cache-dir /tmp/.pip-cache -r /opt/app-root/src/requirements.txt
24+
pip3 install --upgrade --cache-dir /tmp/.pip-cache -r requirements.txt
2025
rm -rf /tmp/.pip-cache
2126
fi
2227

23-
if [[ -s /opt/app-root/src/kopf-opt.sh ]]; then
24-
mv /opt/app-root/src/kopf-opt.sh /opt/app-root/kopf-opt.sh
28+
if [[ -s kopf-opt.sh ]]; then
29+
mv kopf-opt.sh /opt/app-root/kopf-opt.sh
2530
fi
2631

2732
# Fix up permissions.

build-s2i-python-kopf/version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":"v1.35.3"}
1+
{"version":"v1.35.4"}

0 commit comments

Comments
 (0)