1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

B #-: Do not use ERB with trim mode (alma8 fix) (#3250)

(cherry picked from commit 0c6620c9a9d8cb3924b82507bd54d94a7e15e7c2)
This commit is contained in:
Michal Opala 2024-09-27 15:55:57 +02:00 committed by Ruben S. Montero
parent fd9daa2b26
commit ba8c46e8b0
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87

View File

@ -99,7 +99,7 @@ module VNMMAD
# Basically, we short-circuit any 169.254.16.9 communication and
# forcefully redirect every packet destined to 169.254.16.9 to be handled
# locally (regardless of the actual ARP resolution in guest VMs).
nft(ERB.new(<<~NFT, :trim_mode => '-').result(binding))
nft(ERB.new(<<~NFT).result(binding))
table bridge one_tproxy {
chain ch_<%= brdev %> {
type filter hook prerouting priority dstnat; policy accept;
@ -122,7 +122,7 @@ module VNMMAD
# defined in nftables, that way users can manually restart tproxy on demand
# without the need for providing any command line arguments.
# All maps are managed by the driver, proxies only read their contents.
nft(ERB.new(<<~NFT, :trim_mode => '-').result(binding))
nft(ERB.new(<<~NFT).result(binding))
table ip one_tproxy {
map ep_<%= brdev %> {
type inet_service : ipv4_addr \\
@ -132,19 +132,19 @@ module VNMMAD
flush map ip one_tproxy ep_<%= brdev %>;
<%- endpoints.each do |ep| -%>
<% endpoints.each do |ep| %>
add element ip one_tproxy ep_<%= brdev %> {
<%= ep[:service_port] %> : <%= ep[:remote_addr] %> \\
. <%= ep[:remote_port] %>
}
<%- end -%>
<% end %>
NFT
end
def self.disable_tproxy(nic, endpoints)
brdev = nic[:bridge]
nft(ERB.new(<<~NFT, :trim_mode => '-').result(binding))
nft(ERB.new(<<~NFT).result(binding))
table ip one_tproxy {
map ep_<%= brdev %> {
type inet_service : ipv4_addr \\
@ -155,7 +155,7 @@ module VNMMAD
delete map ip one_tproxy ep_<%= brdev %>;
NFT
nft(ERB.new(<<~NFT, :trim_mode => '-').result(binding))
nft(ERB.new(<<~NFT).result(binding))
table bridge one_tproxy {
chain ch_<%= brdev %> {
type filter hook prerouting priority dstnat; policy accept;