Skip to content

libnetwork/netlabel: make consts actual consts, remove redundant utils#44683

Merged
thaJeztah merged 3 commits intomoby:masterfrom
thaJeztah:libnetwork_consts
Dec 22, 2022
Merged

libnetwork/netlabel: make consts actual consts, remove redundant utils#44683
thaJeztah merged 3 commits intomoby:masterfrom
thaJeztah:libnetwork_consts

Conversation

@thaJeztah
Copy link
Member

  • libnetwork/netlabel: make consts actual consts
  • libnetwork: controller: rename vars that collided or shadowed
  • libnetwork/netlabel: remove Key(), Value(), and KeyValue() utils

@thaJeztah thaJeztah added status/2-code-review area/networking Networking kind/refactor PR's that refactor, or clean-up code labels Dec 21, 2022
@thaJeztah thaJeztah added this to the v-next milestone Dec 21, 2022
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
- config collided with import
- cap collided with a built-in
- c collided with the "controller" receiver

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
These were only used in a single location, and in a rather bad way;
replace them with strings.Cut() which should be all we need for this.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@@ -103,21 +97,3 @@ func MakeKVProviderConfig(scope string) string {
func MakeKVClient(scope string) string {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW; this is the only function currently used. I want to dig a bit further, but from the looks of it, we only support 3 scopes;

  • swarm
  • global
  • local

So perhaps we should define consts for those cases only, and remove some of the abstraction here (keeping that for a further exercise)

@thaJeztah
Copy link
Member Author

This one should probably be fairly safe to get in; let me do so 👍

@thaJeztah thaJeztah merged commit 1eb09c8 into moby:master Dec 22, 2022
@thaJeztah thaJeztah deleted the libnetwork_consts branch December 22, 2022 20:55
akerouanton added a commit to akerouanton/docker that referenced this pull request Feb 9, 2023
- LocalKVProvider, LocalKVProviderConfig, LocalKVProvider,
GlobalKVProviderConfig are all unused since moby/libnetwork#908.
- MakeKVProvider, MakeKVProviderURL, MakeKVProviderConfig are unused
since moby#44683.
- MakeKVClient is unused since moby#44875

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
akerouanton added a commit to akerouanton/docker that referenced this pull request Feb 16, 2023
- LocalKVProvider, LocalKVProviderURL, LocalKVProviderConfig,
  GlobalKVProvider, GlobalKVProviderURL and GlobalKVProviderConfig
  are all unused since moby/libnetwork@be2b6962 (moby/libnetwork#908).
- GlobalKVClient is unused since 781e666a and c11c2a16.
- MakeKVProvider, MakeKVProviderURL and MakeKVProviderConfig are unused
  since moby/moby@96cfb076 (moby#44683).
- MakeKVClient is unused since moby/moby@142b5229 (moby#44875).

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
akerouanton added a commit to akerouanton/docker that referenced this pull request Feb 16, 2023
- LocalKVProvider, LocalKVProviderURL, LocalKVProviderConfig,
  GlobalKVProvider, GlobalKVProviderURL and GlobalKVProviderConfig
  are all unused since moby/libnetwork@be2b6962 (moby/libnetwork#908).
- GlobalKVClient is unused since 781e666a and c11c2a16.
- MakeKVProvider, MakeKVProviderURL and MakeKVProviderConfig are unused
  since moby/moby@96cfb076 (moby#44683).
- MakeKVClient is unused since moby/moby@142b5229 (moby#44875).

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
akerouanton added a commit to akerouanton/docker that referenced this pull request Mar 2, 2023
- LocalKVProvider, LocalKVProviderURL, LocalKVProviderConfig,
  GlobalKVProvider, GlobalKVProviderURL and GlobalKVProviderConfig
  are all unused since moby/libnetwork@be2b6962 (moby/libnetwork#908).
- GlobalKVClient is unused since 781e666a and c11c2a16.
- MakeKVProvider, MakeKVProviderURL and MakeKVProviderConfig are unused
  since moby/moby@96cfb076 (moby#44683).
- MakeKVClient is unused since moby/moby@142b5229 (moby#44875).

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
akerouanton added a commit to akerouanton/docker that referenced this pull request Mar 2, 2023
- LocalKVProvider, LocalKVProviderURL, LocalKVProviderConfig,
  GlobalKVProvider, GlobalKVProviderURL and GlobalKVProviderConfig
  are all unused since moby/libnetwork@be2b6962 (moby/libnetwork#908).
- GlobalKVClient is unused since 652d1bf and 5e9e400.
- MakeKVProvider, MakeKVProviderURL and MakeKVProviderConfig are unused
  since moby/moby@96cfb076 (moby#44683).
- MakeKVClient is unused since moby/moby@142b5229 (moby#44875).

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
akerouanton added a commit to akerouanton/docker that referenced this pull request Mar 6, 2023
- LocalKVProvider, LocalKVProviderURL, LocalKVProviderConfig,
  GlobalKVProvider, GlobalKVProviderURL and GlobalKVProviderConfig
  are all unused since moby/libnetwork@be2b6962 (moby/libnetwork#908).
- GlobalKVClient is unused since 652d1bf and 5e9e400.
- MakeKVProvider, MakeKVProviderURL and MakeKVProviderConfig are unused
  since moby/moby@96cfb076 (moby#44683).
- MakeKVClient is unused since moby/moby@142b5229 (moby#44875).

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
akerouanton added a commit to akerouanton/docker that referenced this pull request Mar 31, 2023
- LocalKVProvider, LocalKVProviderURL, LocalKVProviderConfig,
  GlobalKVProvider, GlobalKVProviderURL and GlobalKVProviderConfig
  are all unused since moby/libnetwork@be2b6962 (moby/libnetwork#908).
- GlobalKVClient is unused since 652d1bf and 5e9e400.
- MakeKVProvider, MakeKVProviderURL and MakeKVProviderConfig are unused
  since moby/moby@96cfb076 (moby#44683).
- MakeKVClient is unused since moby/moby@142b5229 (moby#44875).

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
akerouanton added a commit to akerouanton/docker that referenced this pull request Mar 31, 2023
- LocalKVProvider, LocalKVProviderURL, LocalKVProviderConfig,
  GlobalKVProvider, GlobalKVProviderURL and GlobalKVProviderConfig
  are all unused since moby/libnetwork@be2b6962 (moby/libnetwork#908).
- GlobalKVClient is unused since bb54332 and 06e41ba.
- MakeKVProvider, MakeKVProviderURL and MakeKVProviderConfig are unused
  since 96cfb07 (moby#44683).
- MakeKVClient is unused since 142b522 (moby#44875).

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
akerouanton added a commit to akerouanton/docker that referenced this pull request Apr 6, 2023
- LocalKVProvider, LocalKVProviderURL, LocalKVProviderConfig,
  GlobalKVProvider, GlobalKVProviderURL and GlobalKVProviderConfig
  are all unused since moby/libnetwork@be2b6962 (moby/libnetwork#908).
- GlobalKVClient is unused since 0fa873c and c8d2c6e.
- MakeKVProvider, MakeKVProviderURL and MakeKVProviderConfig are unused
  since 96cfb07 (moby#44683).
- MakeKVClient is unused since 142b522 (moby#44875).

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/networking Networking kind/refactor PR's that refactor, or clean-up code status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants