Skip to content

Commit

Permalink
Merge pull request #11 from ycedres/delete-salt-user-exporter
Browse files Browse the repository at this point in the history
Avoid conflict with Salt user in exporter container
  • Loading branch information
meaksh authored Jan 30, 2024
2 parents 08ceebf + 74f8ef3 commit 1ce90dc
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 11 deletions.
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ install_requires =
Click
rich
requests
jinja2

[options.packages.find]
where=src
Expand Down
4 changes: 4 additions & 0 deletions src/uyuni_health_check/exporter/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ COPY requirements.txt /opt/
RUN zypper -n ref
RUN zypper -n install python3-PyYAML python3-salt python3-pip postgresql
RUN pip3.6 install -r /opt/requirements.txt
# We remove the user salt (and group salt) to prevent conflicts in the shared volume
# with the salt user that we will create later during container creation
# according to the container host
RUN userdel salt

COPY uyuni_health_exporter.py /opt/
COPY config.yml /opt/
Expand Down
34 changes: 23 additions & 11 deletions src/uyuni_health_check/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,23 +515,35 @@ def run_loki(server, supportconfig_path=None, verbose=False):
if server:
transfer_image(server, "promtail")

podman(
podman_args = [
"run",
"--replace",
"-d",
"-v",
f"{promtail_cfg}:/etc/promtail/config.yml",
"-v",
"/var/log/:/var/log/",
]

if supportconfig_path:
podman_args.extend(
[
"-v",
f"{supportconfig_path}:{supportconfig_path}",
]
)

podman_args.extend(
[
"run",
"--replace",
"-d",
"-v",
f"{promtail_cfg}:/etc/promtail/config.yml",
"-v",
"/var/log/:/var/log/",
"-v",
f"{supportconfig_path}:{supportconfig_path}",
"--name",
"promtail",
"--pod",
"uyuni-health-check",
"promtail",
],
]
)
podman(
podman_args,
server,
console=console,
)
Expand Down

0 comments on commit 1ce90dc

Please sign in to comment.