Skip to content

Commit

Permalink
Attach proxy pod to our podman network
Browse files Browse the repository at this point in the history
  • Loading branch information
aaannz authored and cbosdo committed Apr 24, 2024
1 parent 4090edb commit 3b03c97
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mgrpxy/shared/podman/podman.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ func GenerateSystemdService(httpdImage string, saltBrokerImage string, squidImag
Ports: ports,
HttpProxyFile: httpProxyConfig,
Args: strings.Join(podmanArgs, " "),
Network: podman.UyuniNetwork,
}
if err := generateSystemdFile(dataPod, "pod"); err != nil {
return err
Expand Down Expand Up @@ -99,7 +100,7 @@ func generateSystemdFile(template utils.Template, service string) error {
const systemdPath = "/etc/systemd/system"
path := path.Join(systemdPath, name)
if err := utils.WriteTemplateToFile(template, path, 0644, true); err != nil {
return fmt.Errorf(L("failed to generate systemd file: %s"), path)
return fmt.Errorf(L("failed to generate systemd file %s: %s"), path, err)
}
return nil
}
Expand Down
2 changes: 2 additions & 0 deletions mgrpxy/shared/templates/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ ExecStartPre=/bin/rm -f %t/uyuni-proxy-pod.pid %t/uyuni-proxy-pod.pod-id
ExecStartPre=/usr/bin/podman pod create --infra-conmon-pidfile %t/uyuni-proxy-pod.pid \
--pod-id-file %t/uyuni-proxy-pod.pod-id --name uyuni-proxy-pod \
--network {{ .Network }} \
{{- range .Ports }}
-p {{ .Exposed }}:{{ .Port }}{{ if .Protocol }}/{{ .Protocol }}{{ end }} \
{{- end }}
Expand All @@ -52,6 +53,7 @@ type PodTemplateData struct {
Ports []types.PortMap
HttpProxyFile string
Args string
Network string
}

// Render will create the systemd configuration file.
Expand Down
1 change: 1 addition & 0 deletions uyuni-tools.changes.oholecek.setup_proxy_pod_correct_net
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Attach proxy pod to our podman network

0 comments on commit 3b03c97

Please sign in to comment.