Skip to content

Commit

Permalink
Use host network for podman containers
Browse files Browse the repository at this point in the history
Fixes: https://issues.redhat.com/browse/ECOPROJECT-2316

This PR changes the network of the containers to be host network, because
of the mechanis we report the credenetials URL. In order to get the real
host IP instead of the container IP.

Signed-off-by: Ondra Machacek <[email protected]>
  • Loading branch information
machacekondra committed Nov 6, 2024
1 parent 3757cd9 commit 88a66d0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
14 changes: 3 additions & 11 deletions data/ignition.template
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,6 @@ storage:
name: core
group:
name: core
- path: /home/core/.config/containers/systemd/agent.network
contents:
inline: |
[Network]
user:
name: core
group:
name: core
- path: /home/core/.config/containers/systemd/planner-agent.container
mode: 0644
contents:
Expand All @@ -95,8 +87,8 @@ storage:
Exec= -config /agent/config/config.yaml
PublishPort=3333:3333
Volume=/home/core/.migration-planner:/agent:Z
Environment=OPA_SERVER=opa:8181
Network=agent.network
Environment=OPA_SERVER=127.0.0.1:8181
Network=host
UserNS=keep-id:uid=1001

[Install]
Expand All @@ -115,7 +107,7 @@ storage:
Entrypoint=/usr/bin/opa
PublishPort=8181:8181
Exec=run --server /usr/share/opa/policies
Network=agent.network
Network=host

[Install]
WantedBy=multi-user.target default.target
8 changes: 8 additions & 0 deletions test/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,16 @@ var _ = Describe("e2e", func() {

Context("Flow", func() {
It("Up to date", func() {
// Check that planner-agent serivce is running
r := agent.IsServiceRunning(agentIP, "planner-agent")
Expect(r).To(BeTrue())

// Check that proper IP is reported
s, err := svc.GetSource()
Expect(err).To(BeNil())
Expect(s.CredentialUrl).To(Equal(fmt.Sprintf("http://%s:3333", agentIP)))

// Put the vCenter credentials and check that source is up to date eventually
err = agent.Login(fmt.Sprintf("https://%s:8989/sdk", systemIP), "user", "pass")
Expect(err).To(BeNil())
Eventually(func() bool {
Expand Down

0 comments on commit 88a66d0

Please sign in to comment.