Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nuvolaris/nuvolaris#355 #145

Merged
merged 1 commit into from
Mar 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion nuvolaris/operator_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import nuvolaris.config as cfg
import nuvolaris.util as ut
import nuvolaris.whisk_actions_deployer as system
import nuvolaris.redis as redis

from nuvolaris.nuvolaris_metadata import NuvolarisMetadata

Expand Down Expand Up @@ -75,10 +76,15 @@ def whisk_post_resume(name):
"""
Executes a set of common operations after the operator resumes, which is also the scenario
triggered by a nuv update operator
- restore redis nuvolaris namespace if redis is active
- annotate operator deployed components version
- redeploys system actions
"""
logging.info(f"*** whisk_post_resume {name}")
logging.info(f"*** whisk_post_resume {name}")

if cfg.get("components.redis"):
redis.restore_nuvolaris_db_user()

annotate_operator_components_version()
sysres = system.deploy_whisk_system_action()

Expand Down
4 changes: 4 additions & 0 deletions nuvolaris/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ def wait_for_redis_ready():
# dynamically detect redis pod and wait for readiness
util.wait_for_pod_ready("{.items[?(@.metadata.labels.name == 'redis')].metadata.name}")

def restore_nuvolaris_db_user():
data = util.get_redis_config_data()
create_nuvolaris_db_user(data)

def create_nuvolaris_db_user(data):
logging.info(f"authorizing redis for namespace nuvolaris")
try:
Expand Down
2 changes: 1 addition & 1 deletion nuvolaris/templates/redis-conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ data:
# The filename where to dump the DB (uncomment the line)
dbfilename dump.rdb

# the direcotry where redis will store data.
# the directory where redis will store data.
dir /bitnami/redis/data
{% endif %}

Expand Down