Skip to content

Commit

Permalink
Add public network to quota classes (#157)
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Berendt <[email protected]>
  • Loading branch information
berendt committed Dec 6, 2023
1 parent b974ee1 commit a234d2e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions etc/classes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ okeanos:
volume_types:
- hdd
- ssd
public_network: public

testbed:
parent: default
Expand Down
5 changes: 5 additions & 0 deletions releasenotes/notes/public-network-d0da1ce1481bf807.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
features:
- |
With the `public_network` parameter it is now possible to enable a public
network on a project with the help of a quota class.
17 changes: 14 additions & 3 deletions src/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,19 @@ def check_quota(project, cloud):


def manage_external_network_rbacs(project, domain):
if check_bool(project, "has_public_network") or check_bool(
project, "show_public_network"
if "quotaclass" in project:
quotaclass = get_quotaclass(project.quotaclass)
else:
logger.warning(f"{project.name} - quotaclass not set --> use default")
if domain.name.startswith("ok"):
quotaclass = get_quotaclass("okeanos")
else:
quotaclass = get_quotaclass("basic")

if (
check_bool(project, "has_public_network")
or check_bool(project, "show_public_network")
or "public_network" in quotaclass
):
if "public_network" in project:
public_net_name = project.public_network
Expand Down Expand Up @@ -273,7 +284,7 @@ def manage_external_network_rbacs(project, domain):

def check_volume_types(project, domain):
if "quotaclass" in project:
quotaclass = project.quotaclass
quotaclass = get_quotaclass(project.quotaclass)
else:
logger.warning(f"{project.name} - quotaclass not set --> use default")
if domain.name.startswith("ok"):
Expand Down

0 comments on commit a234d2e

Please sign in to comment.