From 7101e439efd398183bda24308c35104a88a26975 Mon Sep 17 00:00:00 2001 From: Juan Font Date: Wed, 17 Apr 2024 16:42:50 +0000 Subject: [PATCH] Remove unused node check interval --- config-example.yaml | 6 ------ hscontrol/types/config.go | 16 ---------------- integration/hsic/config.go | 2 -- 3 files changed, 24 deletions(-) diff --git a/config-example.yaml b/config-example.yaml index ac0a5eb8..0f1c2412 100644 --- a/config-example.yaml +++ b/config-example.yaml @@ -137,12 +137,6 @@ disable_check_updates: false # Time before an inactive ephemeral node is deleted? ephemeral_node_inactivity_timeout: 30m -# Period to check for node updates within the tailnet. A value too low will severely affect -# CPU consumption of Headscale. A value too high (over 60s) will cause problems -# for the nodes, as they won't get updates or keep alive messages frequently enough. -# In case of doubts, do not touch the default 10s. -node_update_check_interval: 10s - database: type: sqlite diff --git a/hscontrol/types/config.go b/hscontrol/types/config.go index f8073608..20591a6c 100644 --- a/hscontrol/types/config.go +++ b/hscontrol/types/config.go @@ -46,7 +46,6 @@ type Config struct { GRPCAddr string GRPCAllowInsecure bool EphemeralNodeInactivityTimeout time.Duration - NodeUpdateCheckInterval time.Duration PrefixV4 *netip.Prefix PrefixV6 *netip.Prefix IPAllocation IPAllocationStrategy @@ -233,8 +232,6 @@ func LoadConfig(path string, isFile bool) error { viper.SetDefault("ephemeral_node_inactivity_timeout", "120s") - viper.SetDefault("node_update_check_interval", "10s") - viper.SetDefault("tuning.batch_change_delay", "800ms") viper.SetDefault("tuning.node_mapsession_buffered_chan_size", 30) @@ -290,15 +287,6 @@ func LoadConfig(path string, isFile bool) error { ) } - maxNodeUpdateCheckInterval, _ := time.ParseDuration("60s") - if viper.GetDuration("node_update_check_interval") > maxNodeUpdateCheckInterval { - errorText += fmt.Sprintf( - "Fatal config error: node_update_check_interval (%s) is set too high, must be less than %s", - viper.GetString("node_update_check_interval"), - maxNodeUpdateCheckInterval, - ) - } - if errorText != "" { // nolint return errors.New(strings.TrimSuffix(errorText, "\n")) @@ -714,10 +702,6 @@ func GetHeadscaleConfig() (*Config, error) { "ephemeral_node_inactivity_timeout", ), - NodeUpdateCheckInterval: viper.GetDuration( - "node_update_check_interval", - ), - Database: GetDatabaseConfig(), TLS: GetTLSConfig(), diff --git a/integration/hsic/config.go b/integration/hsic/config.go index d66fd34c..7953799e 100644 --- a/integration/hsic/config.go +++ b/integration/hsic/config.go @@ -73,7 +73,6 @@ database: type: sqlite3 sqlite.path: /tmp/integration_test_db.sqlite3 ephemeral_node_inactivity_timeout: 30m -node_update_check_interval: 10s prefixes: v6: fd7a:115c:a1e0::/48 v4: 100.64.0.0/10 @@ -116,7 +115,6 @@ func DefaultConfigEnv() map[string]string { "HEADSCALE_DATABASE_TYPE": "sqlite", "HEADSCALE_DATABASE_SQLITE_PATH": "/tmp/integration_test_db.sqlite3", "HEADSCALE_EPHEMERAL_NODE_INACTIVITY_TIMEOUT": "30m", - "HEADSCALE_NODE_UPDATE_CHECK_INTERVAL": "10s", "HEADSCALE_PREFIXES_V4": "100.64.0.0/10", "HEADSCALE_PREFIXES_V6": "fd7a:115c:a1e0::/48", "HEADSCALE_DNS_CONFIG_BASE_DOMAIN": "headscale.net",