Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use poetry for build backend #1292

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
b2903ea
Release 4.12.0
myakove Sep 9, 2022
fda2257
removing matchlabels (#806) (#813)
cnv-qe-bot Sep 12, 2022
1a73183
Release 4.12.1
myakove Sep 12, 2022
b5025e2
add two new apiGroup (#817) (#819)
cnv-qe-bot Sep 14, 2022
f9a50d7
remove FLAVOR_KUBEVIRT_IO (#821)
dbasunag Sep 14, 2022
358b30d
release-it: use change log from git
myakove Sep 20, 2022
8ff7347
Release 4.12.2
myakove Sep 20, 2022
f98c8fe
Removing matchLabels from vmi_selector (#830) (#831)
cnv-qe-bot Sep 21, 2022
4b4dec7
Fix add_rule in ClusterRole (#828) (#833)
cnv-qe-bot Sep 22, 2022
120e341
WaitingForVolumeBinding VM status (#835) (#836)
cnv-qe-bot Sep 28, 2022
8372832
Release 4.12.3
myakove Sep 28, 2022
a34b7f9
pre-commit: update plugins (#840) (#842)
cnv-qe-bot Oct 1, 2022
14f6369
Add APIServer resource (#824) (#852)
cnv-qe-bot Oct 2, 2022
995f05f
support subscription with separate name from package name (#855) (#857)
cnv-qe-bot Oct 20, 2022
1c4c0ec
Release 4.12.4
myakove Oct 20, 2022
40d74c6
Method to wait for vm status ready (#854) (#859)
cnv-qe-bot Oct 24, 2022
bb30b92
Release 4.12.5
myakove Oct 24, 2022
1f04854
Rename vm.wait_for_status_ready (#864) (#866)
cnv-qe-bot Oct 25, 2022
87f24af
Release 4.12.6
myakove Oct 25, 2022
4b24fe3
Change cluster preference from NamespacedResource to Resource (#863) …
cnv-qe-bot Oct 25, 2022
fb286bc
test_resources_definitions: take the name from the code (#870) (#872)
cnv-qe-bot Oct 25, 2022
a93ae6b
remove publish-to-pypi workflow
myakove Oct 25, 2022
6384d9c
code-check add python 3.11 (#882) (#884)
cnv-qe-bot Oct 25, 2022
bfc1158
Release 4.12.7
myakove Oct 26, 2022
d211f94
add new exception, as it is recoverable (#896) (#898)
cnv-qe-bot Oct 31, 2022
882068f
Release 4.12.8
myakove Nov 1, 2022
32160bc
Use one logger from Resource class (#904) (#906)
cnv-qe-bot Nov 2, 2022
13daa34
Fix duplicate logs (#923) (#925)
cnv-qe-bot Nov 2, 2022
d67b141
Fix VM wait_for_status calls (#937) (#939)
cnv-qe-bot Nov 2, 2022
f35d1e4
Remove vm wait_for_status function (#916) (#922)
adolfo-ab Nov 2, 2022
e7d41fe
create(), remove body args (#943) (#947)
cnv-qe-bot Nov 7, 2022
01526b7
Release 4.12.9
myakove Nov 8, 2022
4873019
nad: add support for linux-bridge and ovs (#935) (#965)
cnv-qe-bot Nov 9, 2022
2844b1a
Release 4.12.10
myakove Nov 9, 2022
2d40bf1
Release 4.12.11
myakove Nov 9, 2022
d627637
Fix the typo in VM status (#958) (#961)
cnv-qe-bot Nov 10, 2022
e2b9469
Node Health Check was incorrectly mentioned as namespace dependent in…
geetikakay Nov 14, 2022
232d3a7
Added resource scheduler. This is a cluster wide resource. (#959) (#967)
geetikakay Nov 14, 2022
4aee586
Release 4.12.12
myakove Nov 14, 2022
8e6f6fc
rename all res to self.res (#945) (#969)
myakove Nov 14, 2022
af7bc1e
Release 4.12.13
myakove Nov 14, 2022
d3804cf
Release 4.12.14
myakove Nov 14, 2022
2369307
Add controller revision resource (#978) (#981)
cnv-qe-bot Nov 21, 2022
ae26fbf
Release 4.12.15
rnetser Nov 21, 2022
901fa54
watcher function to watch the resource using Kubernetes watch api. (#…
cnv-qe-bot Nov 29, 2022
a72d30e
Fix skip_existing_resource_creation_teardown to_dict call (#986) (#992)
cnv-qe-bot Nov 30, 2022
c4864e6
Release 4.12.16
myakove Nov 30, 2022
141249f
create(): Fix initial_resource_version call if the client do not have…
cnv-qe-bot Dec 3, 2022
0a8304a
Release 4.12.17
myakove Dec 3, 2022
fb409a8
fix usage of self.to_dict() in some methods (#1002) (#1006)
cnv-qe-bot Dec 7, 2022
f6536da
Release 4.12.18
myakove Dec 7, 2022
c8dc193
Add code examples (#1004) (#1008)
cnv-qe-bot Dec 7, 2022
48eb7bd
Change DataVolume class to work with garbage collector enabled (#957)…
cnv-qe-bot Dec 11, 2022
db9ccba
Release 4.12.19
myakove Dec 11, 2022
38fe318
auto-cherry-pick: [v4.12] add retry on exception and timeout_seconds …
cnv-qe-bot Dec 12, 2022
e3a9a26
Release 4.12.20
myakove Dec 12, 2022
86817bf
Remove kube_v1_api function (#1016) (#1025)
cnv-qe-bot Dec 14, 2022
8957df9
Add to_yaml() function (#1031) (#1033)
cnv-qe-bot Dec 19, 2022
a9a04f3
remove unused files: scripts/release.sh CHANGELOG.md (#1027) (#1035)
cnv-qe-bot Dec 19, 2022
8980c5c
Add MetalLB and it's resources (#988) (#1045)
myakove Dec 20, 2022
d818b51
Release 4.12.21
myakove Dec 20, 2022
c5afb86
Allow templates from all namespaces to be processed (#1003) (#1049)
cnv-qe-bot Dec 28, 2022
cde58f9
Release 4.12.22
rnetser Dec 28, 2022
483b1c0
VMExport: add status Ready, remove token required (#1048) (#1051)
cnv-qe-bot Jan 1, 2023
766b4f6
Release 4.12.23
myakove Jan 1, 2023
b6af1af
Add commiter name to change log
myakove Jan 4, 2023
9f81c08
Remove code-check github action, use tox (#1065) (#1067)
cnv-qe-bot Jan 16, 2023
dc51541
add ForbiddenError to the retry list and add default exceptions to a …
cnv-qe-bot Jan 17, 2023
2e30f4f
Release 4.12.24
myakove Jan 18, 2023
7e5b650
Release 4.12.25
myakove Jan 18, 2023
df5e0e3
create endpoints resource (#1084) (#1088)
cnv-qe-bot Jan 24, 2023
526fcfd
Release 4.12.26
rnetser Jan 24, 2023
1c4642d
Adding hypervisor connection uri for rhel9 machine type in 4.13 (#109…
akri3i Feb 14, 2023
23aad07
Release 4.12.27
myakove Feb 14, 2023
74bfe9a
Update pre-commit hooks (#1110)
myakove Feb 17, 2023
9004d81
Refactor role example (#1118) (#1119)
Anatw Feb 19, 2023
8749792
Add functionality to role.py and refactor clusetr_role.py (#994) (#1063)
cnv-qe-bot Feb 21, 2023
07191fe
Convert setup.py/cfg to pyproject.toml (#1116) (#1122) (#1124)
myakove Feb 21, 2023
690862d
Release 4.12.28
myakove Feb 21, 2023
3998f20
Fix local pip install
myakove Feb 21, 2023
872cc29
Reformat black and isort (#1138) (#1140) (#1142)
redhat-qe-bot Mar 13, 2023
65e23f3
Release 4.12.29
rnetser Mar 13, 2023
8b4b363
Add operator resource (#1144) (#1146) (#1148)
redhat-qe-bot Mar 19, 2023
958fec0
Release 4.12.30
myakove Mar 19, 2023
129e5e5
release-it: set npm publish to false
myakove Mar 19, 2023
0970d26
TimeoutSampler - update docstring (#1152) (#1154) (#1156)
redhat-qe-bot Mar 28, 2023
de70a34
Release 4.12.31
myakove Mar 29, 2023
fa65e30
release-it: read version from VERSION file (#1169) (#1171)
redhat-qe-bot Mar 29, 2023
805753a
Release 4.12.32
myakove Mar 29, 2023
73290ff
Adding a new status constant ERROR_UNSCHEDULABLE under vm status (#11…
redhat-qe-bot Apr 4, 2023
ebb7990
Add label parameter to Resource object (#1192) (#1199)
redhat-qe-bot Apr 24, 2023
a0185ea
Release 4.12.33
rnetser Apr 24, 2023
a8d3a7d
Fix pre-commit issues (#1221)
myakove May 10, 2023
7e97ad8
Resources - support different API groups for resources with the same …
redhat-qe-bot May 10, 2023
c315aa4
Release 4.12.35
myakove May 10, 2023
2a23737
Omit secret data - cherry-pick 4.12 (#1228)
omrirh May 21, 2023
9e4547d
Release 4.12.36
rnetser May 21, 2023
0f5c98b
Refactor node_network_configuration_policy resource (#1202) (#1240)
Anatw Jun 14, 2023
e37cd9f
Release 4.12.37
myakove Jun 14, 2023
9560faa
Use poetry as build backend (#1284) (#1286) (#1290)
redhat-qe-bot Jul 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3
Expand Down
19 changes: 0 additions & 19 deletions .github/workflows/create-auto-pr-for-merge-pr-in-main.yml.bak

This file was deleted.

21 changes: 0 additions & 21 deletions .github/workflows/upload-to-pypi.yml.bak

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,5 @@ local-cluster/_hco/

# nmp
node_modules/
package.json
package-lock.json
7 changes: 0 additions & 7 deletions .isort.cfg

This file was deleted.

12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ default_language_version:

repos:
- repo: https://github.com/myint/autoflake
rev: "v1.4"
rev: "v2.0.2"
hooks:
- id: autoflake
args:
Expand All @@ -12,7 +12,7 @@ repos:
- --remove-all-unused-imports

- repo: https://github.com/hadialqattan/pycln
rev: "v2.1.1"
rev: "v2.1.3"
hooks:
- id: pycln

Expand All @@ -22,12 +22,12 @@ repos:
- id: isort

- repo: https://github.com/psf/black
rev: "22.6.0"
rev: "23.1.0"
hooks:
- id: black

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.3.0"
rev: "v4.4.0"
hooks:
- id: check-merge-conflict
- id: debug-statements
Expand All @@ -38,7 +38,7 @@ repos:
- id: check-builtin-literals

- repo: https://github.com/PyCQA/flake8
rev: "5.0.4"
rev: "6.0.0"
hooks:
- id: flake8
args: [--max-line-length=120]
Expand All @@ -51,6 +51,6 @@ repos:
]

- repo: https://github.com/Yelp/detect-secrets
rev: v1.3.0
rev: v1.4.0
hooks:
- id: detect-secrets
25 changes: 7 additions & 18 deletions .release-it.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"npm": {
"publish": false
},
"git": {
"requireCleanWorkingDir": true,
"requireBranch": false,
Expand All @@ -18,7 +21,7 @@
"--follow-tags"
],
"pushRepo": "",
"changelog": "npx auto-changelog --stdout --commit-limit false -u --template https://raw.githubusercontent.com/release-it/release-it/master/templates/changelog-compact.hbs"
"changelog": "git log --pretty=format:\"* %s (%h) by %cn on %as\" ${from}...${to}"
},
"github": {
"release": true,
Expand All @@ -36,23 +39,9 @@
"web": false
},
"plugins": {
"@j-ulrich/release-it-regex-bumper": {
"out": [
{
"files": [
"setup.cfg"
],
"search": "\\d+\\.\\d+\\.\\d+",
"replace": "{{version}}"
},
{
"files": [
"setup.cfg"
],
"search": "v\\d+\\.\\d+\\.\\d+",
"replace": "v{{version}}"
}
]
"@release-it/bumper": {
"in": "VERSION",
"out": "VERSION"
}
}
}
110 changes: 0 additions & 110 deletions CHANGELOG.md

This file was deleted.

107 changes: 3 additions & 104 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ export GITHUB_TOKEN=<your_github_token>
* [release-it](https://github.com/release-it/release-it)
```bash
sudo npm install --global release-it
npm install --save-dev @j-ulrich/release-it-regex-bumper
rm -f package.json package-lock.json
npm install --save-dev @release-it/bumper
```
### usage:
* Create a release, run from the relevant branch.
Expand All @@ -50,110 +49,10 @@ To change log level export OPENSHIFT_PYTHON_WRAPPER_LOG_LEVEL:
export OPENSHIFT_PYTHON_WRAPPER_LOG_LEVEL=<LOG_LEVEL> # can be: "DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"
```

## Examples
### Client
```python
client = DynamicClient(client=kubernetes.config.new_client_from_config())
```
The examples given below are relevant to all resources. For simplicity we will use the resource - Namespace.
### Import
Import Namespace:
```python
from resources.namespace import Namespace
```
### Create
Create a Namespace:
```python
ns = Namespace(name="namespace-example-1")
ns.create()
```
Will return ``True`` if creation succeeded.

We can also use the ``with`` statement which ensures automatic clean-up of the code executed:
```python
with Namespace(name="namespace-example-2") as ns:
yield ns
```
``teardown=False`` - Disables clean-up after execution.
### Wait
Wait for Namespace to be in status ``Active``:
```python
ns.wait_for_status(status=Namespace.Status.ACTIVE, timeout=120)
```
Will raise a ``TimeoutExpiredError`` if Namespace is not in the desired status.
### Delete
Delete the Namespace
```python
ns.delete()
```
Will return ``False`` if not found.
### Exists
Checks if Namespace exists on the server:
```python
ns.exists
```
Will return ``None`` if not found.
### Get
Query to get Pods (resource) in the connected cluster with label of ``label_example=example``. Returns a ``generator`` of the resource - ``pod``
```python
for pod in Pod.get(dyn_client=client, label_selector="label_example=example")):
pod.log()
```
We can also get the name of the Node that the ``pod`` is running on:
```python
pod.node.name
```
### VM
Start:
```python
with VirtualMachine(
name="vm-example",
namespace="namespace-example",
node_selector="worker-node-example",
) as vm:
vm.start()
```
Stop:
```python
vm.stop()
```
Restart:
```python
vm.restart()
```
Get VMI:
```python
test_vmi = vm.vmi
```
After having a VMI, we can wait until VMI is in running state:
```python
test_vmi.wait_until_running()
```
Will raise ``TimeoutExpiredError`` if VMI failed to run.

Then, we can get the Pod that is in Running state and execute a command on it:
```python
command_output = test_vmi.virt_launcher_pod.execute(command="command-example")
```
If no Pod was found, will raise ``ResourceNotFoundError``.

### NNCP Capture Syntax
Using capture syntax to switch ipv4 config between interfaces
```python
with NodeNetworkConfigurationPolicy(
name="capture_nncp",
capture={'first-nic': 'interfaces.name=="ens8"',
'second-nic': 'interfaces.name=="ens9"'},
teardown=False, # Capture doesn't support reverting config on teardown
...
) as nncp:
nncp.add_interface(name="{{ capture.first-nic.interfaces.0.name }}", set_ipv4="{{ capture.second-nic.interfaces.0.ipv4 }}")
nncp.add_interface(name="{{ capture.second-nic.interfaces.0.name }}", set_ipv4="{{ capture.first-nic.interfaces.0.ipv4 }}")
yield nncp
```

## Code check
We use pre-commit for code check.
```bash
pre-commit install
```

Some code examples locate at `examples` directory
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4.12.37
Loading