Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: kubernetes/endpointslice
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.29.15
Choose a base ref
...
head repository: kubernetes/endpointslice
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.30.0
Choose a head ref

Commits on Jun 8, 2022

  1. Generate go.work files

    This creates go.work and enables Go Workspaces.  This is a file that
    includes info on k/k and all the staging modules.
    
    This depends on go 1.22 and setting FORCE_HOST_GO=true (for kube
    scripts, which try to be hermetic).
    
    Make this part of the normal update/verify sequence.
    
    The top-level go.work file contains no replace statements. Instead, the
    replace statements in the individual go.mod files are used. For this to
    work, replace statements in the individual go.mod files have to be
    consistent.
    
    hack/tools has different dependencies and can't be in the main
    workspace, so this adds a go.work just for that.  Without this, go tries
    to consider all deps in all modules and pick one that works for all.
    This is problematic because there are so many of them that it is
    difficult to manage.
    
    Likewise for k8s.io/code-generator/examples and
    k8s.io/kms/internal/plugins/_mock - add trivial go.work files.
    
    For example k/k depends on an older version of a lib that gloangci-lint
    needs (transitively) and it breaks.
    
    This also updates vendor (needed to make go happy), and removes
    vendor'ed symlinks.  This breaks a LOT of our build tools, which will be
    fixed subsequently.
    
    Result: `go` commands work across modules:
    
    Before:
    ```
    $ go list ./pkg/proxy/iptables/ ./staging/src/k8s.io/api/core/v1/
    main module (k8s.io/kubernetes) does not contain package k8s.io/kubernetes/staging/src/k8s.io/api/core/v1
    
    $ go build ./pkg/proxy/iptables/ ./staging/src/k8s.io/api
    main module (k8s.io/kubernetes) does not contain package k8s.io/kubernetes/staging/src/k8s.io/api
    
    $ go test ./pkg/proxy/iptables/ ./staging/src/k8s.io/api
    main module (k8s.io/kubernetes) does not contain package k8s.io/kubernetes/staging/src/k8s.io/api
    ```
    
    After:
    ```
    $ go list ./pkg/proxy/iptables/ ./staging/src/k8s.io/api/core/v1/
    k8s.io/kubernetes/pkg/proxy/iptables
    k8s.io/api/core/v1
    
    $ go build ./pkg/proxy/iptables/ ./staging/src/k8s.io/api
    
    $ go test ./pkg/proxy/iptables/ ./staging/src/k8s.io/api
    ok  	k8s.io/kubernetes/pkg/proxy/iptables	0.360s
    ok  	k8s.io/api	2.302s
    ```
    
    Result: `make` fails:
    
    ```
    $ make
    go version go1.22rc1 linux/amd64
    +++ [0106 12:11:03] Building go targets for linux/amd64
        k8s.io/kubernetes/cmd/kube-proxy (static)
        k8s.io/kubernetes/cmd/kube-apiserver (static)
        k8s.io/kubernetes/cmd/kube-controller-manager (static)
        k8s.io/kubernetes/cmd/kubelet (non-static)
        k8s.io/kubernetes/cmd/kubeadm (static)
        k8s.io/kubernetes/cmd/kube-scheduler (static)
        k8s.io/component-base/logs/kube-log-runner (static)
        k8s.io/kube-aggregator (static)
        k8s.io/apiextensions-apiserver (static)
        k8s.io/kubernetes/cluster/gce/gci/mounter (static)
        k8s.io/kubernetes/cmd/kubectl (static)
        k8s.io/kubernetes/cmd/kubectl-convert (static)
        github.com/onsi/ginkgo/v2/ginkgo (non-static)
        k8s.io/kubernetes/test/e2e/e2e.test (test)
        k8s.io/kubernetes/test/conformance/image/go-runner (non-static)
        k8s.io/kubernetes/cmd/kubemark (static)
        github.com/onsi/ginkgo/v2/ginkgo (non-static)
        k8s.io/kubernetes/test/e2e_node/e2e_node.test (test)
    test/e2e/e2e.go:35:2: cannot find package "k8s.io/api/apps/v1" in any of:
    	/home/thockin/src/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/api/apps/v1 (vendor tree)
    	/home/thockin/src/kubernetes/_output/local/.gimme/versions/go1.22rc1.linux.amd64/src/k8s.io/api/apps/v1 (from $GOROOT)
    	/home/thockin/src/kubernetes/_output/local/go/src/k8s.io/api/apps/v1 (from $GOPATH)
    	... more ...
    	... more ...
    	... more ...
    !!! [0106 12:13:41] Call tree:
    !!! [0106 12:13:41]  1: /home/thockin/src/kubernetes/hack/lib/golang.sh:948 kube::golang::build_binaries_for_platform(...)
    !!! [0106 12:13:41]  2: hack/make-rules/build.sh:27 kube::golang::build_binaries(...)
    !!! [0106 12:13:41] Call tree:
    !!! [0106 12:13:41]  1: hack/make-rules/build.sh:27 kube::golang::build_binaries(...)
    !!! [0106 12:13:41] Call tree:
    !!! [0106 12:13:41]  1: hack/make-rules/build.sh:27 kube::golang::build_binaries(...)
    make: *** [Makefile:96: all] Error 1
    ```
    
    Again, this requires go 1.22 (e.g. gotip), as go 1.21.x does not have
    `go work vendor` support.
    
    TO REPEAT:
        ( \
          ./hack/update-go-workspace.sh; \
          ./hack/update-vendor.sh; \
          ./hack/update-go-workspace.sh; \
        )
    
    Kubernetes-commit: 65b841c077e0d3282d28b9199aec72d23d045104
    pohly authored and k8s-publishing-bot committed Jun 8, 2022
    Copy the full SHA
    03f6a22 View commit details

Commits on Oct 17, 2023

  1. Update vendoring to take new CBOR library dependency.

    Kubernetes-commit: 09a1abda998fc37e2e29a120a82be7c6271656e0
    benluddy authored and k8s-publishing-bot committed Oct 17, 2023
    Copy the full SHA
    a3b954b View commit details

Commits on Nov 7, 2023

  1. dependencies: zapr v1.3.0, zap v1.26.0

    The new zapr adds support for slog. The new zap has various improvements. It no
    longer depends on go.uber.org/atomic which enables dropping it from the
    Kubernetes dependencies. github.com/pkg/errors is also no longer needed.
    
    Kubernetes-commit: 166b71757b95de9a9898fcca79d60518e66a6813
    pohly authored and k8s-publishing-bot committed Nov 7, 2023
    Copy the full SHA
    52dc70e View commit details

Commits on Nov 8, 2023

  1. update go.mod

    Signed-off-by: cpanato <ctadeu@gmail.com>
    
    Kubernetes-commit: 9e5b8402bb95eb82541099e77c3a8b0ccd31297f
    cpanato authored and k8s-publishing-bot committed Nov 8, 2023
    Copy the full SHA
    a1f39dd View commit details

Commits on Nov 13, 2023

  1. Merge pull request #121808 from cpanato/go-update-main

    [go] Bump images, dependencies and versions to go 1.21.4
    
    Kubernetes-commit: 6ba7258a0f3f73629560fc30016b2e35c8e7ae9c
    k8s-publishing-bot committed Nov 13, 2023
    Copy the full SHA
    8ac0f51 View commit details
  2. Re-vendor k8s.io/kube-openapi

    ./hack/pin-dependency.sh k8s.io/kube-openapi 778a5567bc1edaed92a4de9c07f90199c67953fa
    
    ./hack/update-vendor.sh
    
    Kubernetes-commit: 1f55357d9937f076f532a2c1aa104593b9f6c49a
    thockin authored and k8s-publishing-bot committed Nov 13, 2023
    Copy the full SHA
    515b9c5 View commit details

Commits on Dec 14, 2023

  1. Merge pull request #121759 from thockin/fix_api_violations

    Fix "list_type_missing" API violations in meta/v1
    
    Kubernetes-commit: 8a22571ebb7628b2dd2c2faf453293040b7efaef
    k8s-publishing-bot committed Dec 14, 2023
    Copy the full SHA
    a3b6b90 View commit details
  2. Merge pull request #121773 from pohly/zapr-update

    dependencies: zapr v1.3.0, zap v1.26.0
    
    Kubernetes-commit: e12d4b63d64a1dd3497cb8063efb2588c04abdc1
    k8s-publishing-bot committed Dec 14, 2023
    Copy the full SHA
    1e92792 View commit details

Commits on Dec 19, 2023

  1. dependencies: gomega v1.30.0 + ginkgo v2.13.2

    The new gomega.BeTrueBecause and gomega.BeFalseBecause are going to be useful
    for kubernetes/kubernetes#105678.
    
    Kubernetes-commit: c8f9ebfb72b6569b4e2ec9733f6998afc6602135
    pohly authored and k8s-publishing-bot committed Dec 19, 2023
    Copy the full SHA
    3108529 View commit details

Commits on Dec 20, 2023

  1. Merge pull request #122395 from pohly/ginkgo-gomega-update

    dependencies: gomega v1.30.0 + ginkgo v2.13.2
    
    Kubernetes-commit: 7897910469aa091ebf6576740d055a7137fa147c
    k8s-publishing-bot committed Dec 20, 2023
    Copy the full SHA
    2dfdaad View commit details
  2. .*: bump golang.org/x/tools to v0.16.1

    Bumping tools to include the fix for a nil pointer
    deref error in go/types. See golang/go#64812
    for more details.
    
    This fix is needed for when we bump to go1.22.
    
    Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>
    
    Kubernetes-commit: a8da4202c0ac785d57b545e6e310fd754888b50e
    MadhavJivrajani authored and k8s-publishing-bot committed Dec 20, 2023
    Copy the full SHA
    7a46d12 View commit details
  3. Merge pull request #122412 from MadhavJivrajani/bump-go-tools

    [go1.22] .*: bump golang.org/x/tools to v0.16.1
    
    Kubernetes-commit: 8a4403a9e5127d2ec3f596c4ce75663e5392cb18
    k8s-publishing-bot committed Dec 20, 2023
    Copy the full SHA
    d511d39 View commit details

Commits on Jan 2, 2024

  1. Update goleak from v1.2.1 to v1.3.0

    Signed-off-by: bzsuni <bingzhe.sun@daocloud.io>
    
    Kubernetes-commit: 5405dd0f9b801a94f0e74c140231dc0ec7a85499
    bzsuni authored and k8s-publishing-bot committed Jan 2, 2024
    Copy the full SHA
    26fd12e View commit details
  2. Merge pull request #121602 from bzsuni/cleanup/goleak

    Update goleak from v1.2.1 to v1.3.0
    
    Kubernetes-commit: c1c68acf29247479c870116d6539c49687ddefdc
    k8s-publishing-bot committed Jan 2, 2024
    Copy the full SHA
    1fa38ec View commit details

Commits on Jan 11, 2024

  1. bump klog to v2.120.0

    Kubernetes-commit: 3c86d21316c25b52a1cf3f9703a0bc2cbe97131c
    pacoxu authored and k8s-publishing-bot committed Jan 11, 2024
    Copy the full SHA
    4eec95d View commit details
  2. Merge pull request #122706 from pacoxu/klog-upgrade

    bump klog to  v2.120.0
    
    Kubernetes-commit: 823ecb58f68fbe0a4b37b32e11e75c6f2e0f467c
    k8s-publishing-bot committed Jan 11, 2024
    Copy the full SHA
    49c6f77 View commit details

Commits on Jan 18, 2024

  1. dependencies: ginkgo v2.15.0, gomega v1.31.0

    The main reason for updating is support for reporting the cause of context
    cancellation: Ginkgo provides that information when canceling a context and
    Gomega polling code includes that when generating a failure message.
    
    Kubernetes-commit: 18f0af1f000f95749ca1ea075d62ca89e86bb7da
    pohly authored and k8s-publishing-bot committed Jan 18, 2024
    Copy the full SHA
    695de3d View commit details
  2. dependencies: klog v2.120.1

    Kubernetes-commit: e2222f1e304831cbbc57b61afa373612297055fb
    pohly authored and k8s-publishing-bot committed Jan 18, 2024
    Copy the full SHA
    08ff0e5 View commit details
  3. Merge pull request #122839 from pohly/ginkgo-gomega-update

    dependencies: ginkgo v2.15.0, gomega v1.31.0
    
    Kubernetes-commit: c82da711b0e2184f851675aac4596bbd0f74763f
    k8s-publishing-bot committed Jan 18, 2024
    Copy the full SHA
    eb645c9 View commit details
  4. Merge pull request #122842 from pohly/klog-update

    dependencies: klog v2.120.1
    
    Kubernetes-commit: b27b56a46c4c1e6be0dc2b1a0230d86223a7e903
    k8s-publishing-bot committed Jan 18, 2024
    Copy the full SHA
    80c31ba View commit details

Commits on Feb 10, 2024

  1. Merge pull request #121486 from benluddy/cbor-stub

    KEP-4222: Add stub CBOR serializer.
    
    Kubernetes-commit: 48228bf9dbac308f43abd59a53fdc069fbddee0f
    k8s-publishing-bot committed Feb 10, 2024
    Copy the full SHA
    349c149 View commit details

Commits on Feb 12, 2024

  1. Bump github.com/fxamacker/cbor/v2 to v2.6.0.

    Kubernetes-commit: aac43dc96f2b679f0ab030fd3512c7e03b0f2df4
    benluddy authored and k8s-publishing-bot committed Feb 12, 2024
    Copy the full SHA
    779fb62 View commit details

Commits on Feb 15, 2024

  1. Merge pull request #123250 from benluddy/dep-bump-cbor-v2.6.0

    Bump github.com/fxamacker/cbor/v2 to v2.6.0.
    
    Kubernetes-commit: e305e773bbfe8c5bdf9c57881a875e168b004b8c
    k8s-publishing-bot committed Feb 15, 2024
    Copy the full SHA
    b1cb77f View commit details

Commits on Feb 16, 2024

  1. Update x/crypto to 0.19.

    Main reason is to pick up updated CA roots.
    
    Full diff: golang/crypto@v0.16.0...v0.19.0
    
    Kubernetes-commit: d3a0e296defbb0b55e591e273004e79e7ebfb1fd
    hoskeri authored and k8s-publishing-bot committed Feb 16, 2024
    Copy the full SHA
    267be74 View commit details

Commits on Feb 21, 2024

  1. Merge pull request #123348 from hoskeri/update-go-x-crypto-19

    Update x/crypto to 0.19.
    
    Kubernetes-commit: 9a9028983806af26e7b48223f3a92922e94725df
    k8s-publishing-bot committed Feb 21, 2024
    Copy the full SHA
    4d31d3d View commit details

Commits on Feb 24, 2024

  1. Add trafficdist package for handling reconciliation of new field

    Kubernetes-commit: 9513f75089fc3f708126134b97814beb3589693d
    gauravkghildiyal authored and k8s-publishing-bot committed Feb 24, 2024
    Copy the full SHA
    c8cf52d View commit details
  2. Start reconciling on the new field

    Kubernetes-commit: 51a3fa2e6ff7b7b08eec34126479745c1d75e615
    gauravkghildiyal authored and k8s-publishing-bot committed Feb 24, 2024
    Copy the full SHA
    9412873 View commit details

Commits on Feb 27, 2024

  1. Re-vendor latest kube-openapi and gengo/v2

    ./hack/pin-dependency.sh k8s.io/kube-openapi latest
    ./hack/pin-dependency.sh k8s.io/gengo/v2 latest
    ./hack/update-vendor.sh
    
    Kubernetes-commit: 6f2f3735e04df5e4822176a2784069634c3c74a3
    thockin authored and k8s-publishing-bot committed Feb 27, 2024
    Copy the full SHA
    30ba189 View commit details
  2. Remove old gengo detritus

    Kubernetes-commit: 812d5fff4011df4693dcdace516feec30ebff8ba
    thockin authored and k8s-publishing-bot committed Feb 27, 2024
    Copy the full SHA
    d4943b7 View commit details

Commits on Feb 29, 2024

  1. Fix up go.mod files after reviews

    Because of how the previous 100+ commits were done, so changes snuck
    thru that properly belong in earlier commits but it's not really
    possible to do that without a lot of effort.
    
    We agreed it was OK to "spackle" these cracks with a final commit.
    
    Kubernetes-commit: 21715e6bbd19c932576ff268843d8ead3edb05e4
    thockin authored and k8s-publishing-bot committed Feb 29, 2024
    Copy the full SHA
    43a8f6c View commit details
  2. Add new metric servicesCountByTrafficDistribution

    Kubernetes-commit: 606cae9b4790cd611f4b321f7e65fd9ce4f476f3
    gauravkghildiyal authored and k8s-publishing-bot committed Feb 29, 2024
    Copy the full SHA
    480a50e View commit details

Commits on Mar 1, 2024

  1. Merge pull request #123529 from thockin/go-workspaces

     Go workspaces for k/k and k/staging/*
    
    Kubernetes-commit: df366107d16aa2e2cdd620be41e592184f379da4
    k8s-publishing-bot committed Mar 1, 2024
    Copy the full SHA
    20f88c7 View commit details

Commits on Mar 4, 2024

  1. Add options construct to EndpointSlice NewReconciler for the new traf…

    …ficDistributionEnabled field
    
    Kubernetes-commit: ec6fd2befac30ebb7dfb55b94d8c9874489a3902
    gauravkghildiyal authored and k8s-publishing-bot committed Mar 4, 2024
    Copy the full SHA
    d049007 View commit details

Commits on Mar 5, 2024

  1. Merge pull request #123487 from gauravkghildiyal/kep-4444

    Introduce trafficDistribution field for Kubernetes Services
    
    Kubernetes-commit: a76a3e031fc950a9c2429e611fd0bb00a117b1fc
    k8s-publishing-bot committed Mar 5, 2024
    Copy the full SHA
    8121d6e View commit details

Commits on Mar 27, 2024

  1. Bump github.com/golang/protobuf v1.5.4, google.golang.org/protobuf v1…

    ….33.0
    
    Kubernetes-commit: c6673d2346c814ddb4629c569bdc659ffa0c583f
    liggitt authored and k8s-publishing-bot committed Mar 27, 2024
    Copy the full SHA
    701483e View commit details

Commits on Apr 3, 2024

  1. Update x/net for CVE-2023-45288

    Signed-off-by: Davanum Srinivas <davanum@gmail.com>
    
    Kubernetes-commit: 99fac38d2864e6bc9bb7cd1743d658caa1360c0c
    dims authored and k8s-publishing-bot committed Apr 3, 2024
    Copy the full SHA
    139d3c2 View commit details

Commits on Apr 5, 2024

  1. Merge remote-tracking branch 'origin/master' into release-1.30

    Kubernetes-commit: 255e7919bcb340043b0d235f883fe070017ce18f
    k8s-publishing-bot committed Apr 5, 2024
    Copy the full SHA
    f23f177 View commit details

Commits on Apr 17, 2024

  1. Copy the full SHA
    f6d7ff5 View commit details
Showing with 1,142 additions and 92 deletions.
  1. +14 −21 go.mod
  2. +32 −36 go.sum
  3. +54 −4 metrics/cache.go
  4. +96 −0 metrics/cache_test.go
  5. +17 −1 metrics/metrics.go
  6. +63 −4 reconciler.go
  7. +253 −26 reconciler_test.go
  8. +143 −0 trafficdist/trafficdist.go
  9. +470 −0 trafficdist/trafficdist_test.go
35 changes: 14 additions & 21 deletions go.mod
Original file line number Diff line number Diff line change
@@ -2,17 +2,17 @@

module k8s.io/endpointslice

go 1.21.3
go 1.22.0

require (
github.com/davecgh/go-spew v1.1.1
github.com/google/go-cmp v0.6.0
github.com/stretchr/testify v1.8.4
k8s.io/api v0.0.0-20231101171312-cd0ecb048ea5
k8s.io/apimachinery v0.0.0-20231101171057-16d50e6708ce
k8s.io/client-go v0.0.0-20231101171620-66e57f767515
k8s.io/component-base v0.0.0-20231101172256-4b808112b779
k8s.io/klog/v2 v2.110.1
k8s.io/api v0.30.0
k8s.io/apimachinery v0.30.0
k8s.io/client-go v0.30.0
k8s.io/component-base v0.30.0
k8s.io/klog/v2 v2.120.1
k8s.io/utils v0.0.0-20230726121419-3b25d923346b
)

@@ -22,13 +22,13 @@ require (
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.3.0 // indirect
@@ -46,26 +46,19 @@ require (
github.com/prometheus/common v0.44.0 // indirect
github.com/prometheus/procfs v0.10.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/oauth2 v0.10.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.3.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.31.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)

replace (
k8s.io/api => k8s.io/api v0.0.0-20231101171312-cd0ecb048ea5
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20231101171057-16d50e6708ce
k8s.io/client-go => k8s.io/client-go v0.0.0-20231101171620-66e57f767515
k8s.io/component-base => k8s.io/component-base v0.0.0-20231101172256-4b808112b779
)
68 changes: 32 additions & 36 deletions go.sum
Original file line number Diff line number Diff line change
@@ -12,8 +12,8 @@ github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxER
github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84=
github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY=
github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE=
github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=
github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE=
@@ -28,12 +28,10 @@ github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I=
github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
@@ -68,10 +66,10 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4=
github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o=
github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg=
github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY=
github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM=
github.com/onsi/gomega v1.31.0 h1:54UJxxj6cPInHS3a35wm6BK/F9nHYueZ1NVujHDrnXE=
github.com/onsi/gomega v1.31.0/go.mod h1:DW9aCi7U6Yi40wNVAvT6kzFnEVEI5n3DloYBiKiT6zk=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
@@ -109,8 +107,8 @@ golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8=
golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -120,33 +118,31 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek=
golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8=
golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.12.0 h1:YW6HUoUmYBpwSgyaGaZq1fHjrBjX1rlpZ54T6mu2kss=
golang.org/x/tools v0.12.0/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM=
golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ=
golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
@@ -158,18 +154,18 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
k8s.io/api v0.0.0-20231101171312-cd0ecb048ea5 h1:ZfnjV6xXqx4UGcyZm6uANo3TRx2ZzzARWc4sJzdRXOg=
k8s.io/api v0.0.0-20231101171312-cd0ecb048ea5/go.mod h1:pe4ymgKfZ6OhusBquRSk+Kqm3zLI7wDLZQoGKcHdLLc=
k8s.io/apimachinery v0.0.0-20231101171057-16d50e6708ce h1:oOZHk+iB3pNz2vb9yXNUWs6fQDcsINJePa5YxiAU0Z4=
k8s.io/apimachinery v0.0.0-20231101171057-16d50e6708ce/go.mod h1:yFk3nwBh/jXlkMvRKH7BKtX7saT1lRmmGV6Ru0cTSUA=
k8s.io/client-go v0.0.0-20231101171620-66e57f767515 h1:iAC4m6tArcsiOFI2QMYzpMxGVksKBSH7k5whcUJLtHw=
k8s.io/client-go v0.0.0-20231101171620-66e57f767515/go.mod h1:BuOU+TpCaVunHx4J07MTcND+TbxdXG/OLKFu6HXF4Mc=
k8s.io/component-base v0.0.0-20231101172256-4b808112b779 h1:Z7qdGV7DKgU9asDkQQusUK8Gzl0dDHrOS59H6+6z80s=
k8s.io/component-base v0.0.0-20231101172256-4b808112b779/go.mod h1:nC9MQrFtSP4UJAAPfBF4KVVbenBrNryFuAZJI0T3tp0=
k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0=
k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo=
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780=
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA=
k8s.io/api v0.30.0 h1:siWhRq7cNjy2iHssOB9SCGNCl2spiF1dO3dABqZ8niA=
k8s.io/api v0.30.0/go.mod h1:OPlaYhoHs8EQ1ql0R/TsUgaRPhpKNxIMrKQfWUp8QSE=
k8s.io/apimachinery v0.30.0 h1:qxVPsyDM5XS96NIh9Oj6LavoVFYff/Pon9cZeDIkHHA=
k8s.io/apimachinery v0.30.0/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc=
k8s.io/client-go v0.30.0 h1:sB1AGGlhY/o7KCyCEQ0bPWzYDL0pwOZO4vAtTSh/gJQ=
k8s.io/client-go v0.30.0/go.mod h1:g7li5O5256qe6TYdAMyX/otJqMhIiGgTapdLchhmOaY=
k8s.io/component-base v0.30.0 h1:cj6bp38g0ainlfYtaOQuRELh5KSYjhKxM+io7AUIk4o=
k8s.io/component-base v0.30.0/go.mod h1:V9x/0ePFNaKeKYA3bOvIbrNoluTSG+fSJKjLdjOoeXQ=
k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw=
k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag=
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98=
k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI=
k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
58 changes: 54 additions & 4 deletions metrics/cache.go
Original file line number Diff line number Diff line change
@@ -20,15 +20,17 @@ import (
"math"
"sync"

corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/types"
endpointsliceutil "k8s.io/endpointslice/util"
)

// NewCache returns a new Cache with the specified endpointsPerSlice.
func NewCache(endpointsPerSlice int32) *Cache {
return &Cache{
maxEndpointsPerSlice: endpointsPerSlice,
cache: map[types.NamespacedName]*ServicePortCache{},
maxEndpointsPerSlice: endpointsPerSlice,
cache: map[types.NamespacedName]*ServicePortCache{},
servicesByTrafficDistribution: make(map[string]map[types.NamespacedName]bool),
}
}

@@ -40,7 +42,7 @@ type Cache struct {
maxEndpointsPerSlice int32

// lock protects changes to numEndpoints, numSlicesActual, numSlicesDesired,
// and cache.
// cache and servicesByTrafficDistribution
lock sync.Mutex
// numEndpoints represents the total number of endpoints stored in
// EndpointSlices.
@@ -52,8 +54,18 @@ type Cache struct {
// cache stores a ServicePortCache grouped by NamespacedNames representing
// Services.
cache map[types.NamespacedName]*ServicePortCache
// Tracks all services partitioned by their trafficDistribution field.
//
// The type should be read as map[trafficDistribution]setOfServices
servicesByTrafficDistribution map[string]map[types.NamespacedName]bool
}

const (
// Label value for cases when service.spec.trafficDistribution is set to an
// unknown value.
trafficDistributionImplementationSpecific = "ImplementationSpecific"
)

// ServicePortCache tracks values for total numbers of desired endpoints as well
// as the efficiency of EndpointSlice endpoints distribution for each unique
// Service Port combination.
@@ -124,20 +136,53 @@ func (c *Cache) UpdateServicePortCache(serviceNN types.NamespacedName, spCache *
c.updateMetrics()
}

func (c *Cache) UpdateTrafficDistributionForService(serviceNN types.NamespacedName, trafficDistributionPtr *string) {
c.lock.Lock()
defer c.lock.Unlock()

defer c.updateMetrics()

for _, serviceSet := range c.servicesByTrafficDistribution {
delete(serviceSet, serviceNN)
}

if trafficDistributionPtr == nil {
return
}

trafficDistribution := *trafficDistributionPtr
// If we don't explicitly recognize a value for trafficDistribution, it should
// be treated as an implementation specific value. All such implementation
// specific values should use the label value "ImplementationSpecific" to not
// explode the metric labels cardinality.
if trafficDistribution != corev1.ServiceTrafficDistributionPreferClose {
trafficDistribution = trafficDistributionImplementationSpecific
}
serviceSet, ok := c.servicesByTrafficDistribution[trafficDistribution]
if !ok {
serviceSet = make(map[types.NamespacedName]bool)
c.servicesByTrafficDistribution[trafficDistribution] = serviceSet
}
serviceSet[serviceNN] = true
}

// DeleteService removes references of a Service from the global cache and
// updates the corresponding metrics.
func (c *Cache) DeleteService(serviceNN types.NamespacedName) {
c.lock.Lock()
defer c.lock.Unlock()

for _, serviceSet := range c.servicesByTrafficDistribution {
delete(serviceSet, serviceNN)
}

if spCache, ok := c.cache[serviceNN]; ok {
actualSlices, desiredSlices, endpoints := spCache.totals(int(c.maxEndpointsPerSlice))
c.numEndpoints = c.numEndpoints - endpoints
c.numSlicesDesired -= desiredSlices
c.numSlicesActual -= actualSlices
c.updateMetrics()
delete(c.cache, serviceNN)

}
}

@@ -147,6 +192,11 @@ func (c *Cache) updateMetrics() {
NumEndpointSlices.WithLabelValues().Set(float64(c.numSlicesActual))
DesiredEndpointSlices.WithLabelValues().Set(float64(c.numSlicesDesired))
EndpointsDesired.WithLabelValues().Set(float64(c.numEndpoints))

ServicesCountByTrafficDistribution.Reset()
for trafficDistribution, services := range c.servicesByTrafficDistribution {
ServicesCountByTrafficDistribution.WithLabelValues(trafficDistribution).Set(float64(len(services)))
}
}

// numDesiredSlices calculates the number of EndpointSlices that would exist
Loading