Skip to content

Commit

Permalink
nfs: move IP to before nfsserver
Browse files Browse the repository at this point in the history
When the nfsserver is started before the IP is assigned, it actually
listens on all interfaces. Move the IP address to that it gets started
before the nfsserver, where it should be.

A corresponding migration for this already exists.
  • Loading branch information
chrboe committed Nov 6, 2023
1 parent 6bd8938 commit 2337e32
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions pkg/nfs/resource_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,15 @@ func (r *ResourceConfig) ToPromoter(deployment []client.ResourceWithVolumes) (*r
)
}

agents = append(agents, &reactor.ResourceAgent{
Type: "ocf:heartbeat:IPaddr2",
Name: "service_ip",
Attributes: map[string]string{
"ip": r.ServiceIP.IP().String(),
"cidr_netmask": strconv.Itoa(r.ServiceIP.Prefix()),
},
})

agents = append(agents, &reactor.ResourceAgent{
Type: "ocf:heartbeat:nfsserver",
Name: "nfsserver",
Expand Down Expand Up @@ -463,8 +472,6 @@ func (r *ResourceConfig) ToPromoter(deployment []client.ResourceWithVolumes) (*r
}
}

agents = append(agents, &reactor.ResourceAgent{Type: "ocf:heartbeat:IPaddr2", Name: "service_ip", Attributes: map[string]string{"ip": r.ServiceIP.IP().String(), "cidr_netmask": strconv.Itoa(r.ServiceIP.Prefix())}})

agents = append(agents, &reactor.ResourceAgent{
Type: "ocf:heartbeat:portblock",
Name: "portunblock",
Expand Down

0 comments on commit 2337e32

Please sign in to comment.