Merge "Allow using non-default Redis database"

This commit is contained in:
Zuul 2024-10-09 17:33:17 +00:00 committed by Gerrit Code Review
commit e7b070a139
4 changed files with 17 additions and 0 deletions

View File

@ -571,6 +571,9 @@ task_flow_opts = [
cfg.StrOpt('jobboard_backend_namespace', default='octavia_jobboard',
help='Jobboard name that should be used to store taskflow '
'job id and claims for it.'),
cfg.IntOpt('jobboard_redis_backend_db',
default=0, min=0,
help='Database ID in redis server.'),
cfg.StrOpt('jobboard_redis_sentinel', default=None,
help='Sentinel name if it is used for Redis.'),
cfg.StrOpt('jobboard_redis_sentinel_username',

View File

@ -99,6 +99,7 @@ class RedisTaskFlowDriver(JobboardTaskFlowDriver):
'board': 'redis',
'host': CONF.task_flow.jobboard_backend_hosts[0],
'port': CONF.task_flow.jobboard_backend_port,
'db': CONF.task_flow.jobboard_redis_backend_db,
'namespace': CONF.task_flow.jobboard_backend_namespace,
'sentinel': CONF.task_flow.jobboard_redis_sentinel,
'sentinel_fallbacks': [

View File

@ -33,6 +33,7 @@ class TestRedisTaskFlowDriver(base.TestCase):
'board': 'redis',
'host': '127.0.0.1',
'port': 6379,
'db': 0,
'namespace': 'octavia_jobboard',
'sentinel': None,
'sentinel_fallbacks': [],
@ -65,6 +66,7 @@ class TestRedisTaskFlowDriver(base.TestCase):
'board': 'redis',
'host': '127.0.0.1',
'port': 6379,
'db': 0,
'namespace': 'octavia_jobboard',
'password': 'redispass',
'sentinel': None,
@ -100,6 +102,7 @@ class TestRedisTaskFlowDriver(base.TestCase):
'board': 'redis',
'host': '127.0.0.1',
'port': 6379,
'db': 0,
'namespace': 'octavia_jobboard',
'username': 'redisuser',
'password': 'redispass',
@ -142,6 +145,7 @@ class TestRedisTaskFlowDriver(base.TestCase):
'board': 'redis',
'host': '127.0.0.1',
'port': 6379,
'db': 0,
'namespace': 'octavia_jobboard',
'sentinel': None,
'sentinel_fallbacks': [],
@ -179,6 +183,7 @@ class TestRedisTaskFlowDriver(base.TestCase):
'board': 'redis',
'host': 'host1',
'port': 26379,
'db': 0,
'namespace': 'octavia_jobboard',
'sentinel': 'mymaster',
'sentinel_fallbacks': ['host2:26379', 'host3:26379'],
@ -220,6 +225,7 @@ class TestRedisTaskFlowDriver(base.TestCase):
'board': 'redis',
'host': 'host1',
'port': 26379,
'db': 0,
'namespace': 'octavia_jobboard',
'password': 'redispass',
'sentinel': 'mymaster',
@ -267,6 +273,7 @@ class TestRedisTaskFlowDriver(base.TestCase):
'board': 'redis',
'host': 'host1',
'port': 26379,
'db': 0,
'namespace': 'octavia_jobboard',
'username': 'redisuser',
'password': 'redispass',
@ -328,6 +335,7 @@ class TestRedisTaskFlowDriver(base.TestCase):
'board': 'redis',
'host': 'host1',
'port': 26379,
'db': 0,
'namespace': 'octavia_jobboard',
'sentinel': 'mymaster',
'sentinel_fallbacks': ['host2:26379', 'host3:26379'],

View File

@ -0,0 +1,5 @@
---
features:
- |
The new ``[task_flow] jobboard_redis_backend_db`` option has been added.
This option allows using non default database in redis as backend.