fix access problems (#15)

* fix access problems and add  Add bulk job max settings to api

filter workflow job nodes better

This will both improve performance by limiting the queryset for the node
sublists as well as fix our access problem.

override can_read instead of modify queryset in access.py

We do this because we are not going to expose bulk jobs to the list
views, which is complicatd and has poor performance implications.

Instead, we just care about individual Workflows that clients get linked
to not being broken.

fix comment

remove the get functions from the conf.py for bulk api max value

comment the api expose of the bulk job variables

reformt conf.py with make black

trailing space

add more assertion to the bulk host create test
This commit is contained in:
Elijah DeLee
2023-02-28 23:14:06 -05:00
parent 4b9ca3deee
commit 3efc7d5bc4
6 changed files with 56 additions and 7 deletions

View File

@@ -775,6 +775,27 @@ register(
help_text=_('Indicates whether the instance is part of a kubernetes-based deployment.'),
)
# TODO : Commenting below bulk job settings because of failing conftest import. Figure out the conftest issue and then uncomment
# register(
# 'BULK_JOB_MAX_LAUNCH',
# field_class=fields.IntegerField,
# default=100,
# label=_('Max jobs to allow bulk jobs to launch'),
# help_text=_('Max jobs to allow bulk jobs to launch'),
# category=_('Bulk Actions'),
# category_slug='bulk',
# )
#
# register(
# 'BULK_HOST_MAX_CREATE',
# field_class=fields.IntegerField,
# default=1000,
# label=_('Max number of hosts to allow to be created in a single bulk action'),
# help_text=_('Max number of hosts to allow to be created in a single bulk action'),
# category=_('Bulk Actions'),
# category_slug='bulk',
# )
def logging_validate(serializer, attrs):
if not serializer.instance or not hasattr(serializer.instance, 'LOG_AGGREGATOR_HOST') or not hasattr(serializer.instance, 'LOG_AGGREGATOR_TYPE'):