Skip to content

Commit

Permalink
install: Ignore Cluster$interface deprecation
Browse files Browse the repository at this point in the history
The idea is that until v7.1, zeekctl continues to populate the interface
in cluster-layout.zeek just as before, but accesses by users will cause
deprecation warnings.
  • Loading branch information
awelzel committed Nov 2, 2023
1 parent 81e8c48 commit 1c65c6e
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ZeekControl/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ def use_port(self, node):

ostr = "# Automatically generated. Do not edit.\n"
ostr += "redef Cluster::manager_is_logger = %s;\n" % manager_is_logger
ostr += "@pragma push ignore-deprecations\n"
ostr += "redef Cluster::nodes = {\n"

# Control definition. For now just reuse the manager information.
Expand All @@ -211,6 +212,7 @@ def use_port(self, node):
ostr += '\t["time-machine"] = [$node_type=Cluster::TIME_MACHINE, $ip=%s, $p=%s],\n' % (config.Config.timemachinehost, config.Config.timemachineport)

ostr += "};\n"
ostr += "@pragma pop ignore-deprecations\n"

try:
with open(filename, "w") as out:
Expand Down
2 changes: 2 additions & 0 deletions testing/Baseline/command.install-layout-files/logger
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
# Automatically generated. Do not edit.
redef Cluster::manager_is_logger = F;
@pragma push ignore-deprecations
redef Cluster::nodes = {
["control"] = [$node_type=Cluster::CONTROL, $ip=127.0.0.1, $p=27760/tcp],
["logger"] = [$node_type=Cluster::LOGGER, $ip=127.0.0.1, $p=27761/tcp],
Expand All @@ -9,3 +10,4 @@ redef Cluster::nodes = {
["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=27764/tcp, $interface="eth0", $manager="manager"],
["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=27765/tcp, $interface="eth1", $manager="manager"],
};
@pragma pop ignore-deprecations
2 changes: 2 additions & 0 deletions testing/Baseline/command.install-layout-files/no-logger
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
# Automatically generated. Do not edit.
redef Cluster::manager_is_logger = T;
@pragma push ignore-deprecations
redef Cluster::nodes = {
["control"] = [$node_type=Cluster::CONTROL, $ip=127.0.0.1, $p=27760/tcp],
["manager"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=27761/tcp],
["proxy-1"] = [$node_type=Cluster::PROXY, $ip=127.0.0.1, $p=27762/tcp, $manager="manager"],
["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=27763/tcp, $interface="eth0", $manager="manager"],
["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=27764/tcp, $interface="eth1", $manager="manager"],
};
@pragma pop ignore-deprecations
2 changes: 2 additions & 0 deletions testing/Baseline/command.install-layout-files/two-loggers
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
# Automatically generated. Do not edit.
redef Cluster::manager_is_logger = F;
@pragma push ignore-deprecations
redef Cluster::nodes = {
["control"] = [$node_type=Cluster::CONTROL, $ip=127.0.0.1, $p=27760/tcp],
["logger-1"] = [$node_type=Cluster::LOGGER, $ip=127.0.0.1, $p=27761/tcp],
Expand All @@ -10,3 +11,4 @@ redef Cluster::nodes = {
["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=27765/tcp, $interface="eth0", $manager="manager"],
["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=27766/tcp, $interface="eth1", $manager="manager"],
};
@pragma pop ignore-deprecations
2 changes: 2 additions & 0 deletions testing/Baseline/command.install-zeekport/no-logger
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
# Automatically generated. Do not edit.
redef Cluster::manager_is_logger = T;
@pragma push ignore-deprecations
redef Cluster::nodes = {
["control"] = [$node_type=Cluster::CONTROL, $ip=127.0.0.1, $p=41234/tcp],
["manager"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=41235/tcp],
["proxy-1"] = [$node_type=Cluster::PROXY, $ip=127.0.0.1, $p=41236/tcp, $manager="manager"],
["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=41237/tcp, $interface="eth0", $manager="manager"],
["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=41238/tcp, $interface="eth1", $manager="manager"],
};
@pragma pop ignore-deprecations
2 changes: 2 additions & 0 deletions testing/Baseline/command.install-zeekport/two-loggers
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
# Automatically generated. Do not edit.
redef Cluster::manager_is_logger = F;
@pragma push ignore-deprecations
redef Cluster::nodes = {
["control"] = [$node_type=Cluster::CONTROL, $ip=127.0.0.1, $p=41234/tcp],
["logger-1"] = [$node_type=Cluster::LOGGER, $ip=127.0.0.1, $p=41235/tcp],
Expand All @@ -10,3 +11,4 @@ redef Cluster::nodes = {
["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=41239/tcp, $interface="eth0", $manager="manager"],
["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=41240/tcp, $interface="eth1", $manager="manager"],
};
@pragma pop ignore-deprecations
2 changes: 2 additions & 0 deletions testing/Baseline/command.install-zeekport/two-proxies
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
# Automatically generated. Do not edit.
redef Cluster::manager_is_logger = F;
@pragma push ignore-deprecations
redef Cluster::nodes = {
["control"] = [$node_type=Cluster::CONTROL, $ip=127.0.0.1, $p=41234/tcp],
["logger"] = [$node_type=Cluster::LOGGER, $ip=127.0.0.1, $p=41235/tcp],
Expand All @@ -10,3 +11,4 @@ redef Cluster::nodes = {
["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=41239/tcp, $interface="eth0", $manager="manager"],
["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=41240/tcp, $interface="eth1", $manager="manager"],
};
@pragma pop ignore-deprecations

0 comments on commit 1c65c6e

Please sign in to comment.