Commit Graph
50 Commits
Author SHA1 Message Date
Maksim NabokikhandGitHub 9bee809252 feat(crd): add CRD handling behavior and configuration options (#4543)
Signed-off-by: maksim.nabokikh <max.nabokih@gmail.com>
2026-02-15 21:56:29 +01:00
Rene DekkerandGitHub 9355759813 fix(storage/kubernetes): Only wrap IPv6 addresses in brackets (#4388)
The Kubernetes client code was wrapping all IP addresses (both IPv4 and
IPv6) in square brackets when constructing the API server URL. This was
based on an incorrect assumption that IPv4 addresses in brackets are valid
in a URL.

Recent versions of Go (1.25.2 and later) have stricter URL parsing
that conforms to RFC 3986. This causes a failure when running Dex in a
Kubernetes environment where the KUBERNETES_SERVICE_HOST is an IPv4
address, leading to the error "invalid IPv6 host".

This commit changes the logic to only wrap IPv6 addresses in square
brackets. It uses `ip.To4() == nil` to reliably detect if an IP address
is IPv6 before wrapping it. This ensures that URLs are correctly
formatted for both IPv4 and IPv6 addresses, fixing the incompatibility
with newer Go versions.

Signed-off-by: Rene Dekker <rene@tigera.io>
2025-11-03 10:50:25 +01:00
Maksim NabokikhandGitHub 7e2225c0e6 Do not wrap Kubernetes Address in brackets (#4363)
Signed-off-by: maksim.nabokikh <max.nabokih@gmail.com>
2025-10-23 11:29:25 +02:00
Sean LiaoandGitHub 0b6a78397e use slog for structured logging (#3502)
Signed-off-by: Sean Liao <sean+git@liao.dev>
2024-06-01 20:15:58 +04:00
7225198ae7 Update max length of kubernetes object to fit kubernetes policy (#3439)
Signed-off-by: Denys Romanenko <65756796+RomanenkoDenys@users.noreply.github.com>
Signed-off-by: Maksim Nabokikh <max.nabokih@gmail.com>
Co-authored-by: Maksim Nabokikh <max.nabokih@gmail.com>
2024-03-28 20:58:59 +01:00
Josh Soref 255d5ecfb7 spelling: characters
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-27 09:02:32 -04:00
Daniel LipovetskyandGitHub 07d7913049 chore: Upgrade golangci-lint to v1.50.1 from v1.46.0 (#2790) 2023-01-19 22:14:58 +01:00
Maksim NabokikhandGitHub 1e116f66ca fix: prevent server side request forgery using Kubernetes storage (#2479)
Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
2023-01-08 20:58:31 +04:00
Michael Kelly 9079c31637 Fix formatting
Signed-off-by: Michael Kelly <mkelly@arista.com>
2022-06-09 08:21:13 -07:00
Michael Kelly a51d12056f Tweaks based on review comments
Signed-off-by: Michael Kelly <mkelly@arista.com>
2022-06-09 08:21:03 -07:00
Michael Kelly 6c99a9b99d s/getUrl/getURL
golang prefers URL not Url

Signed-off-by: Michael Kelly <mkelly@arista.com>
2022-06-09 08:20:48 -07:00
Michael Kelly 502a2d0d4a Limit the amount of objects we attempt to GC on each cycle
If something causes the number k8s resources to increase beyond a
certain threshold, garbage collection can fail because the query to
retrieve those resources will time out, resulting in a perpetual cycle
of being unable to garbage collect resources.

In lieu of trying to get *every* object each cycle, we can limit the
number of resources retrieved per GC cycle to some reasonable number.

Signed-off-by: Michael Kelly <mkelly@arista.com>
2022-05-20 09:18:05 -07:00
Eng Zer Jun f0186ff265 refactor: move from io/ioutil to io and os package
The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil. This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2021-09-17 14:12:39 +08:00
m.nabokikh d413870f6e feat: Update token periodically if Dex is running in Kubernetes cluster
Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
2021-07-12 13:00:46 +04:00
Maksim NabokikhandGitHub 823484f024 Merge pull request #2092 from flant/kubernetes-fallback-to-namespace-file
fix: read namespace from file for Kubernetes storage client
2021-07-10 09:23:57 +04:00
m.nabokikh 0754c30ac2 fix: get namespace from file for Kubernetes storage client
Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
2021-06-10 20:01:14 +04:00
m.nabokikh 7a2472555a feat: Create CRDs as apiextensions.k8s.io/v1
Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
2021-06-10 20:00:49 +04:00
Mark Sagi-Kazar af9dfd4a29 Remove copypasta dependency 2020-06-30 13:12:36 +02:00
Jerry Sun 3a3a2bcc86 Wrap Kubernetes host address in square brackets
When constructing the host address string, the address is
not wrapped in square brackets. This does not work in IPv6
Kubernetes deployments. This commit adds square brackets
around the address. IPv4 was also tested to ensure it works
with wrapped address.

Signed-off-by: Jerry Sun <jerry.sun@windriver.com>
2020-02-06 14:52:54 -05:00
Mark Sagi-Kazar 142c96c210 Fix stylecheck 2019-12-18 15:50:36 +01:00
Michael Venezia 395febf808 storage/kubernetes: Removing Kubernetes TPR support
Third Party Resources (TPR) have been removed from Kubernetes for
roughly 2 years.  This commit removes the support dex had for them.

Documentation has been updated to reflect this and to instruct users
on how to migrate from TPR-powered dex environment to a Custom Resource
Defintion (CRD) based one that dex > v2.17 will support
2019-08-14 09:28:18 -04:00
Mark Sagi-Kazar be581fa7ff Add logger interface and stop relying on Logrus directly 2019-02-22 13:38:57 +01:00
Haines ChanandHaines Chan b78b8aeee0 Replace "GET", "POST" to http.MethodGet and http.MethodPost 2018-12-27 16:27:36 +08:00
Stephan Renatus b9f6594bf0 *: github.com/coreos/dex -> github.com/dexidp/dex
Signed-off-by: Stephan Renatus <srenatus@chef.io>
2018-09-05 17:57:08 +02:00
rithu leena johnandGitHub 42ef8fd802 Merge pull request #1072 from ericchiang/k8s-test
*: run kubernetes tests in travis
2017-10-31 10:34:26 -07:00