-
Notifications
You must be signed in to change notification settings - Fork 0
feat: moved to multicluster-provider #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 11 commits
f4ce3f1
4999ab2
82ce421
70e5a05
c04cab2
b5a328d
903e39a
e84c1f7
9919cf0
3f5976f
fea6b34
b8f3ade
1be4f83
0c9ac2d
1aa7ca0
a5efb28
36eff27
907f251
c7193e2
b366f2b
98ab379
70b65c2
ad6be7a
e9b4c33
5c4741d
e3b5705
7d6d82c
330ffe4
282ef8b
5b62aa1
3ab0b6e
3225d75
d01584a
bcc07f3
988e7b7
b808fd2
1869a61
e8beffd
779f42c
f6bab1c
97cc1c0
4494be2
409185a
662bcef
e695399
73cc293
00c6e87
ffa9ba8
f664fa9
b1b9c7d
9c8652a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -130,6 +130,9 @@ func isDiscoveryRequest(req *http.Request) bool { | |
| if len(parts) >= 5 && parts[0] == "services" && parts[2] == "clusters" { | ||
|
||
| // Handle virtual workspace prefixes first: /services/<service>/clusters/<workspace>/api | ||
| parts = parts[4:] // Remove /services/<service>/clusters/<workspace> prefix | ||
| } else if len(parts) >= 3 && parts[0] == "services" { | ||
| // Handle APIExport virtual workspace pattern: /services/<service>/api | ||
| parts = parts[2:] // Remove /services/<service> prefix | ||
| } else if len(parts) >= 3 && parts[0] == "clusters" { | ||
| // Handle KCP workspace prefixes: /clusters/<workspace>/api | ||
| parts = parts[2:] // Remove /clusters/<workspace> prefix | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,6 @@ import ( | |
| "github.com/platform-mesh/golang-commons/logger" | ||
| "k8s.io/client-go/rest" | ||
| "sigs.k8s.io/controller-runtime/pkg/client" | ||
| "sigs.k8s.io/controller-runtime/pkg/kcp" | ||
|
|
||
| "github.com/platform-mesh/kubernetes-graphql-gateway/common/auth" | ||
| appConfig "github.com/platform-mesh/kubernetes-graphql-gateway/common/config" | ||
|
|
@@ -120,12 +119,8 @@ func (tc *TargetCluster) connect(appCfg appConfig.Config, metadata *ClusterMetad | |
| }) | ||
| } | ||
|
|
||
| // Create client - use KCP-aware client only for KCP mode, standard client otherwise | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. multicluster-runtime uses standard client.WithWatch internally for each cluster it manages. |
||
| if appCfg.EnableKcp { | ||
| tc.client, err = kcp.NewClusterAwareClientWithWatch(tc.restCfg, client.Options{}) | ||
| } else { | ||
| tc.client, err = client.NewWithWatch(tc.restCfg, client.Options{}) | ||
| } | ||
| // multicluster-runtime uses standard client.WithWatch internally for each cluster it manages. | ||
| tc.client, err = client.NewWithWatch(tc.restCfg, client.Options{}) | ||
| if err != nil { | ||
| return fmt.Errorf("failed to create cluster client: %w", err) | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,14 +3,20 @@ module github.com/platform-mesh/kubernetes-graphql-gateway | |
| go 1.24.3 | ||
vertex451 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| replace ( | ||
| github.com/google/cel-go => github.com/google/cel-go v0.26.1 | ||
| // this PR introduces newer version of graphiQL that supports headers | ||
| // https://github.com/graphql-go/handler/pull/93 | ||
| github.com/graphql-go/handler => github.com/vertex451/handler v0.0.0-20250124125145-ed328e3cf42a | ||
|
|
||
| // Pin versions to match multicluster-provider requirements | ||
| golang.org/x/net => golang.org/x/net v0.40.0 | ||
| k8s.io/api => k8s.io/api v0.33.3 | ||
| k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.33.3 | ||
| k8s.io/apimachinery => k8s.io/apimachinery v0.33.3 | ||
| k8s.io/client-go => k8s.io/client-go v0.32.4 | ||
| sigs.k8s.io/controller-runtime => github.com/kcp-dev/controller-runtime v0.19.0-kcp.1.0.20250129100209-5eaf4c7b6056 | ||
| k8s.io/apiserver => k8s.io/apiserver v0.33.3 | ||
| k8s.io/client-go => k8s.io/client-go v0.33.3 | ||
| k8s.io/component-base => k8s.io/component-base v0.33.3 | ||
| k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20250701173324-9bd5c66d9911 | ||
| sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.21.0 | ||
|
||
| ) | ||
coderabbitai[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| require ( | ||
|
|
@@ -24,25 +30,27 @@ require ( | |
| github.com/hashicorp/go-multierror v1.1.1 | ||
| github.com/kcp-dev/kcp/sdk v0.28.1 | ||
| github.com/kcp-dev/logicalcluster/v3 v3.0.5 | ||
| github.com/kcp-dev/multicluster-provider v0.0.0-20250827085327-2b5ca378b7b4 | ||
| github.com/pkg/errors v0.9.1 | ||
| github.com/platform-mesh/account-operator v0.1.24 | ||
| github.com/platform-mesh/golang-commons v0.1.24 | ||
| github.com/prometheus/client_golang v1.23.0 | ||
| github.com/platform-mesh/account-operator v0.1.28 | ||
| github.com/platform-mesh/golang-commons v0.1.29 | ||
| github.com/prometheus/client_golang v1.23.2 | ||
| github.com/rs/zerolog v1.34.0 | ||
| github.com/spf13/cobra v1.9.1 | ||
| github.com/spf13/viper v1.20.1 | ||
| github.com/spf13/cobra v1.10.1 | ||
| github.com/spf13/viper v1.21.0 | ||
| github.com/stretchr/testify v1.11.1 | ||
| go.opentelemetry.io/otel v1.38.0 | ||
| go.opentelemetry.io/otel/trace v1.38.0 | ||
| golang.org/x/exp v0.0.0-20250819193227-8b4c13bb791b | ||
| golang.org/x/text v0.28.0 | ||
| golang.org/x/text v0.29.0 | ||
| gopkg.in/yaml.v3 v3.0.1 | ||
| k8s.io/api v0.33.3 | ||
| k8s.io/apiextensions-apiserver v0.33.3 | ||
| k8s.io/apimachinery v0.33.3 | ||
| k8s.io/client-go v0.33.3 | ||
| k8s.io/kube-openapi v0.0.0-20250701173324-9bd5c66d9911 | ||
| sigs.k8s.io/controller-runtime v0.22.0 | ||
| sigs.k8s.io/controller-runtime v0.22.1 | ||
| sigs.k8s.io/multicluster-runtime v0.21.0-alpha.9 | ||
| ) | ||
|
|
||
| require ( | ||
|
|
@@ -54,10 +62,10 @@ require ( | |
| github.com/cenkalti/backoff/v5 v5.0.3 // indirect | ||
| github.com/cespare/xxhash/v2 v2.3.0 // indirect | ||
| github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect | ||
| github.com/emicklei/go-restful/v3 v3.12.1 // indirect | ||
| github.com/emicklei/go-restful/v3 v3.12.2 // indirect | ||
| github.com/evanphx/json-patch/v5 v5.9.11 // indirect | ||
| github.com/felixge/httpsnoop v1.0.4 // indirect | ||
| github.com/fxamacker/cbor/v2 v2.7.0 // indirect | ||
| github.com/fxamacker/cbor/v2 v2.9.0 // indirect | ||
| github.com/getsentry/sentry-go v0.35.1 // indirect | ||
| github.com/go-jose/go-jose/v4 v4.1.1 // indirect | ||
| github.com/go-logr/logr v1.4.3 // indirect | ||
|
|
@@ -69,35 +77,34 @@ require ( | |
| github.com/go-openapi/swag v0.23.0 // indirect | ||
| github.com/go-viper/mapstructure/v2 v2.4.0 // indirect | ||
| github.com/gogo/protobuf v1.3.2 // indirect | ||
| github.com/golang/protobuf v1.5.4 // indirect | ||
| github.com/google/btree v1.1.3 // indirect | ||
| github.com/google/cel-go v0.26.0 // indirect | ||
| github.com/google/go-cmp v0.7.0 // indirect | ||
| github.com/google/uuid v1.6.0 // indirect | ||
| github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.2 // indirect | ||
| github.com/hashicorp/errwrap v1.1.0 // indirect | ||
| github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect | ||
| github.com/inconshreveable/mousetrap v1.1.0 // indirect | ||
| github.com/josharian/intern v1.0.0 // indirect | ||
| github.com/json-iterator/go v1.1.12 // indirect | ||
| github.com/kcp-dev/apimachinery/v2 v2.0.1-0.20250512171935-ebb573a40077 // indirect | ||
| github.com/kcp-dev/apimachinery/v2 v2.0.1-0.20250728122101-adbf20db3e51 // indirect | ||
| github.com/mailru/easyjson v0.9.0 // indirect | ||
| github.com/mattn/go-colorable v0.1.14 // indirect | ||
| github.com/mattn/go-isatty v0.0.20 // indirect | ||
| github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect | ||
| github.com/modern-go/reflect2 v1.0.2 // indirect | ||
| github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect | ||
| github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect | ||
| github.com/onsi/gomega v1.36.2 // indirect | ||
| github.com/pelletier/go-toml/v2 v2.2.3 // indirect | ||
| github.com/pelletier/go-toml/v2 v2.2.4 // indirect | ||
| github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect | ||
| github.com/prometheus/client_model v0.6.2 // indirect | ||
| github.com/prometheus/common v0.65.0 // indirect | ||
| github.com/prometheus/common v0.66.1 // indirect | ||
| github.com/prometheus/procfs v0.16.1 // indirect | ||
| github.com/sagikazarmark/locafero v0.7.0 // indirect | ||
| github.com/sagikazarmark/locafero v0.11.0 // indirect | ||
| github.com/sosodev/duration v1.3.1 // indirect | ||
| github.com/sourcegraph/conc v0.3.0 // indirect | ||
| github.com/spf13/afero v1.12.0 // indirect | ||
| github.com/spf13/cast v1.7.1 // indirect | ||
| github.com/spf13/pflag v1.0.7 // indirect | ||
| github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect | ||
| github.com/spf13/afero v1.15.0 // indirect | ||
| github.com/spf13/cast v1.10.0 // indirect | ||
| github.com/spf13/pflag v1.0.10 // indirect | ||
| github.com/stoewer/go-strcase v1.3.0 // indirect | ||
| github.com/stretchr/objx v0.5.2 // indirect | ||
| github.com/subosito/gotenv v1.6.0 // indirect | ||
|
|
@@ -110,16 +117,16 @@ require ( | |
| go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.38.0 // indirect | ||
| go.opentelemetry.io/otel/metric v1.38.0 // indirect | ||
| go.opentelemetry.io/otel/sdk v1.38.0 // indirect | ||
| go.opentelemetry.io/proto/otlp v1.7.1 // indirect | ||
| go.opentelemetry.io/proto/otlp v1.8.0 // indirect | ||
| go.uber.org/multierr v1.11.0 // indirect | ||
| go.uber.org/zap v1.27.0 // indirect | ||
| go.yaml.in/yaml/v2 v2.4.2 // indirect | ||
| go.yaml.in/yaml/v3 v3.0.4 // indirect | ||
| golang.org/x/crypto v0.41.0 // indirect | ||
| golang.org/x/net v0.43.0 // indirect | ||
| golang.org/x/oauth2 v0.30.0 // indirect | ||
| golang.org/x/sync v0.16.0 // indirect | ||
| golang.org/x/sys v0.35.0 // indirect | ||
| golang.org/x/oauth2 v0.31.0 // indirect | ||
| golang.org/x/sync v0.17.0 // indirect | ||
| golang.org/x/sys v0.36.0 // indirect | ||
| golang.org/x/term v0.34.0 // indirect | ||
| golang.org/x/time v0.11.0 // indirect | ||
| gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect | ||
|
|
@@ -129,8 +136,8 @@ require ( | |
| google.golang.org/protobuf v1.36.8 // indirect | ||
| gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect | ||
| gopkg.in/inf.v0 v0.9.1 // indirect | ||
| k8s.io/apiserver v0.33.3 // indirect | ||
| k8s.io/component-base v0.33.3 // indirect | ||
| k8s.io/apiserver v0.34.0 // indirect | ||
| k8s.io/component-base v0.34.0 // indirect | ||
| k8s.io/klog/v2 v2.130.1 // indirect | ||
| k8s.io/utils v0.0.0-20250820121507-0af2bda4dd1d // indirect | ||
| sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 // indirect | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.