Skip to content

Commit

Permalink
Handle unspecified ports for pod creation
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdubr committed Jul 26, 2024
1 parent e16df11 commit 8e24853
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,22 @@ python setup.py install

Run `gradle build` to build the zip file. Then, copy the zip file to the `$RDECK_BASE\libext` folder.

## Testing

To run the tests specified in the `tox.ini` file, follow these steps:

- Install Tox: Ensure you have Tox installed. You can install it using pip:
```sh
pip install tox
```
- Run Tox: Execute Tox in the directory containing the `tox.ini` file. This will run the tests in all specified environments:
```sh
tox
```
- Run Specific Environment: If you want to run tests for a specific environment (e.g., Python 3.8), you can specify the environment:
```sh
tox -e py38
```

## Authentication

Expand Down
9 changes: 5 additions & 4 deletions contents/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,12 @@ def parseJson(obj):


def create_pod_template_spec(data):
ports = []

for port in data["ports"].split(','):
portDefinition = client.V1ContainerPort(container_port=int(port))
ports.append(portDefinition)
ports = []
if data["ports"]:
for port in data["ports"].split(','):
portDefinition = client.V1ContainerPort(container_port=int(port))
ports.append(portDefinition)

envs = []
if "environments" in data:
Expand Down

0 comments on commit 8e24853

Please sign in to comment.