Skip to content

Commit

Permalink
fix: rename legacy-endpoints
Browse files Browse the repository at this point in the history
Signed-off-by: Seán C McCord <[email protected]>
  • Loading branch information
Ulexus committed Jun 25, 2021
1 parent b35c754 commit 0d26d30
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,6 @@ With v2, we now use the more efficient EndpointSlices instead of Endpoints.
While this will generally be an invisible change, your RBACs will likely need to
be updated from v1.
In particular, you will need access to the `endpointslices` resource in the `discovery.k8s.io` API Group.

There is an option to retain the old behaviour: `-legacy-endpoints`. This will
allow `dispatchers` to continue to work with older versions of Kuvbernetes.
6 changes: 3 additions & 3 deletions cmd/dispatchers/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var rpcHost string
var kubeCfg string

var apiAddr string
var legacyEndpointSlices bool
var legacyEndpoints bool

// KamailioStartupDebounceTimer is the amount of time to wait on startup to
// send an additional notify to kamailio.
Expand All @@ -47,7 +47,7 @@ func init() {
flag.StringVar(&rpcPort, "p", "9998", "Port for kamailio's RPC service")
flag.StringVar(&kubeCfg, "kubecfg", "", "Location of kubecfg file (if not running inside k8s)")
flag.StringVar(&apiAddr, "api", "", "Address on which to run web API service. Example ':8080'. (defaults to not run)")
flag.BoolVar(&legacyEndpointSlices, "legacy-endpointslices", false, "Use legacy v1beta1 EndpointSlices, for Kubernetes earlier than v1.21")
flag.BoolVar(&legacyEndpoints, "legacy-endpoints", false, "Use legacy Endpoints instead of EndpointSlices, for Kubernetes earlier than v1.21")
}

func main() {
Expand Down Expand Up @@ -101,7 +101,7 @@ func run() (err error) {
for _, v := range setDefinitions.list {
var ds sets.DispatcherSet

if legacyEndpointSlices {
if legacyEndpoints {
ds, err = sets.NewLegacyKubernetesSet(ctx, informerFactory, v.id, v.namespace, v.name, v.port)
} else {
ds, err = sets.NewKubernetesSet(ctx, informerFactory, v.id, v.namespace, v.name, v.port)
Expand Down

0 comments on commit 0d26d30

Please sign in to comment.