Skip to content

Commit b80d3bf

Browse files
authored
Revert "feat(pqlmanifest): implement S3 polling support for PQL manifest (#2726)"
This reverts commit b5cfa92.
1 parent b5cfa92 commit b80d3bf

File tree

20 files changed

+219
-1032
lines changed

20 files changed

+219
-1032
lines changed

router-tests/operations/pql_manifest_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func TestPQLManifest(t *testing.T) {
8787
require.Equal(t, expectedEmployeesBody, res.Body)
8888

8989
// Verify startup log
90-
logEntries := xEnv.Observer().FilterMessageSnippet("Loaded PQL manifest").All()
90+
logEntries := xEnv.Observer().FilterMessageSnippet("Loaded initial PQL manifest").All()
9191
require.Len(t, logEntries, 1)
9292
})
9393
})

router/core/init_config_poller.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"errors"
55
"fmt"
66

7+
"github.com/wundergraph/cosmo/router/pkg/config"
78
"github.com/wundergraph/cosmo/router/pkg/controlplane/configpoller"
89
"github.com/wundergraph/cosmo/router/pkg/execution_config"
910
"github.com/wundergraph/cosmo/router/pkg/routerconfig"
@@ -12,9 +13,9 @@ import (
1213
"go.uber.org/zap"
1314
)
1415

15-
func getConfigClient(r *Router, registry *ProviderRegistry, providerID string, isFallbackClient bool) (client *routerconfig.Client, err error) {
16+
func getConfigClient(r *Router, cdnProviders map[string]config.CDNStorageProvider, s3Providers map[string]config.S3StorageProvider, providerID string, isFallbackClient bool) (client *routerconfig.Client, err error) {
1617
// CDN Providers
17-
if provider, ok := registry.CDN(providerID); ok {
18+
if provider, ok := cdnProviders[providerID]; ok {
1819
if r.graphApiToken == "" {
1920
return nil, errors.New(
2021
"graph token is required to fetch execution config from CDN. " +
@@ -49,7 +50,7 @@ func getConfigClient(r *Router, registry *ProviderRegistry, providerID string, i
4950
}
5051

5152
// S3 Providers
52-
if provider, ok := registry.S3(providerID); ok {
53+
if provider, ok := s3Providers[providerID]; ok {
5354
clientOptions := &configs3Provider.ClientOptions{
5455
AccessKeyID: provider.AccessKey,
5556
SecretAccessKey: provider.SecretKey,
@@ -120,12 +121,12 @@ func getConfigClient(r *Router, registry *ProviderRegistry, providerID string, i
120121
}
121122

122123
// InitializeConfigPoller creates a poller to fetch execution config. It is only initialized when a config poller is configured and the router is not started with a static config
123-
func InitializeConfigPoller(r *Router, registry *ProviderRegistry) (*configpoller.ConfigPoller, error) {
124+
func InitializeConfigPoller(r *Router, cdnProviders map[string]config.CDNStorageProvider, s3Providers map[string]config.S3StorageProvider) (*configpoller.ConfigPoller, error) {
124125
if r.staticExecutionConfig != nil || r.routerConfigPollerConfig == nil || r.configPoller != nil {
125126
return nil, nil
126127
}
127128

128-
primaryClient, err := getConfigClient(r, registry, r.routerConfigPollerConfig.Storage.ProviderID, false)
129+
primaryClient, err := getConfigClient(r, cdnProviders, s3Providers, r.routerConfigPollerConfig.Storage.ProviderID, false)
129130
if err != nil {
130131
return nil, err
131132
}
@@ -140,7 +141,7 @@ func InitializeConfigPoller(r *Router, registry *ProviderRegistry) (*configpolle
140141
return nil, errors.New("cannot use the same storage as both primary and fallback provider for execution config")
141142
}
142143

143-
fallbackClient, err = getConfigClient(r, registry, r.routerConfigPollerConfig.FallbackStorage.ProviderID, true)
144+
fallbackClient, err = getConfigClient(r, cdnProviders, s3Providers, r.routerConfigPollerConfig.FallbackStorage.ProviderID, true)
144145
if err != nil {
145146
return nil, err
146147
}

router/core/provider_registry.go

Lines changed: 0 additions & 86 deletions
This file was deleted.

router/core/provider_registry_test.go

Lines changed: 0 additions & 107 deletions
This file was deleted.

0 commit comments

Comments
 (0)