From 6b8285f9657c94483b9cd4789d0217c4307049d7 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 11 Nov 2025 12:40:08 +0100 Subject: [PATCH] libnetwork/discoverapi: use DiscoveryType for enum This type describes the options defined as consts below it, so make those consts typed. While updating, I also removed the use of iota to prevent accidentally changing their values (and if this API is implemented elsewhere) (but mostly because I'm not a fan of iota ':)) Signed-off-by: Sebastiaan van Stijn --- daemon/libnetwork/discoverapi/discoverapi.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/daemon/libnetwork/discoverapi/discoverapi.go b/daemon/libnetwork/discoverapi/discoverapi.go index 565a5c35af..56b2fe5a07 100644 --- a/daemon/libnetwork/discoverapi/discoverapi.go +++ b/daemon/libnetwork/discoverapi/discoverapi.go @@ -14,12 +14,9 @@ type Discover interface { type DiscoveryType int const ( - // NodeDiscovery represents Node join/leave events provided by discovery - NodeDiscovery = iota + 1 - // EncryptionKeysConfig represents the initial key(s) for performing datapath encryption - EncryptionKeysConfig - // EncryptionKeysUpdate represents an update to the datapath encryption key(s) - EncryptionKeysUpdate + NodeDiscovery DiscoveryType = 1 // NodeDiscovery represents Node join/leave events provided by discovery. + EncryptionKeysConfig DiscoveryType = 2 // EncryptionKeysConfig represents the initial key(s) for performing datapath encryption. + EncryptionKeysUpdate DiscoveryType = 3 // EncryptionKeysUpdate represents an update to the datapath encryption key(s). ) // NodeDiscoveryData represents the structure backing the node discovery data json string