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', cfg.StrOpt('jobboard_backend_namespace', default='octavia_jobboard',
help='Jobboard name that should be used to store taskflow ' help='Jobboard name that should be used to store taskflow '
'job id and claims for it.'), '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, cfg.StrOpt('jobboard_redis_sentinel', default=None,
help='Sentinel name if it is used for Redis.'), help='Sentinel name if it is used for Redis.'),
cfg.StrOpt('jobboard_redis_sentinel_username', cfg.StrOpt('jobboard_redis_sentinel_username',

View File

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

View File

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