Disk size SI units #302

Merged
tobru merged 3 commits from 287-disk-size-unit into main 2025-11-20 14:59:19 +00:00
2 changed files with 6 additions and 2 deletions
Showing only changes of commit 0a621f6372 - Show all commits

View file

@ -6,7 +6,7 @@ from django.forms.models import ModelForm, ModelFormMetaclass
from servala.core.crd.utils import deslugify
from servala.core.models import ControlPlaneCRD
from servala.frontend.forms.widgets import DynamicArrayWidget
from servala.frontend.forms.widgets import DynamicArrayWidget, NumberInputWithAddon
# Fields that must be present in every form
MANDATORY_FIELDS = ["name"]
@ -27,6 +27,11 @@ DEFAULT_FIELD_CONFIGS = {
"help_text": "Domain names for accessing this service",
"required": False,
},
"spec.parameters.size.disk": {
"type": "number",
"label": "Disk size",
"addon_text": "Gi",
},
}

View file

@ -8,7 +8,6 @@ from servala.core.crd import generate_custom_form_class
from servala.core.crd.forms import DEFAULT_FIELD_CONFIGS, MANDATORY_FIELDS
from servala.core.forms import ServiceDefinitionAdminForm
from servala.core.models import ControlPlaneCRD
from servala.frontend.forms.widgets import NumberInputWithAddon
def test_custom_model_form_class_returns_class_when_form_config_exists():