Skip to content

Commit

Permalink
Local file-based name resolver with SQLite + Update components-contri…
Browse files Browse the repository at this point in the history
…b to register Blob Storage v2 (dapr#7038)

* Added support for SQLite nameresolver

Signed-off-by: ItalyPaleAle <[email protected]>

* Added temp replacement

Signed-off-by: ItalyPaleAle <[email protected]>

* Use a strongly-typed Instance struct for name resolvers

Signed-off-by: ItalyPaleAle <[email protected]>

* Removed mod replacement

Signed-off-by: ItalyPaleAle <[email protected]>

* Some test fixes

Signed-off-by: ItalyPaleAle <[email protected]>

* Updated pinned contrib

Signed-off-by: ItalyPaleAle <[email protected]>

* Updated pinned components-contrib again

Signed-off-by: ItalyPaleAle <[email protected]>

* Mod tidy

Signed-off-by: ItalyPaleAle <[email protected]>

---------

Signed-off-by: ItalyPaleAle <[email protected]>
  • Loading branch information
ItalyPaleAle authored Nov 6, 2023
1 parent 90835fa commit c2cbcd0
Show file tree
Hide file tree
Showing 15 changed files with 206 additions and 141 deletions.
25 changes: 25 additions & 0 deletions cmd/daprd/components/nameresolution_sqlite.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//go:build allcomponents

/*
Copyright 2023 The Dapr Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package components

import (
"github.com/dapr/components-contrib/nameresolution/sqlite"
nrLoader "github.com/dapr/dapr/pkg/components/nameresolution"
)

func init() {
nrLoader.DefaultRegistry.RegisterComponent(sqlite.NewResolver, "sqlite")
}
16 changes: 13 additions & 3 deletions cmd/daprd/components/state_azure_blobstorage.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//go:build allcomponents || stablecomponents

/*
Copyright 2021 The Dapr Authors
Copyright 2023 The Dapr Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand All @@ -16,10 +16,20 @@ limitations under the License.
package components

import (
"github.com/dapr/components-contrib/state/azure/blobstorage"
v1 "github.com/dapr/components-contrib/state/azure/blobstorage/v1"
v2 "github.com/dapr/components-contrib/state/azure/blobstorage/v2"
"github.com/dapr/dapr/pkg/components"
stateLoader "github.com/dapr/dapr/pkg/components/state"
)

func init() {
stateLoader.DefaultRegistry.RegisterComponent(blobstorage.NewAzureBlobStorageStore, "azure.blobstorage")
stateLoader.DefaultRegistry.RegisterComponentWithVersions("azure.blobstorage", components.Versioning{
Preferred: components.VersionConstructor{
Version: "v2", Constructor: v2.NewAzureBlobStorageStore,
},
Deprecated: []components.VersionConstructor{
{Version: "v1", Constructor: v1.NewAzureBlobStorageStore},
},
Default: "v1",
})
}
43 changes: 22 additions & 21 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/argoproj/argo-rollouts v1.4.1
github.com/cenkalti/backoff/v4 v4.2.1
github.com/cloudevents/sdk-go/v2 v2.14.0
github.com/dapr/components-contrib v1.12.0-rc.4.0.20231009175401-9f2cc5c158bb
github.com/dapr/components-contrib v1.12.1-0.20231106194303-88eb49c838c2
github.com/dapr/kit v0.12.2-0.20231031211530-0e1fd37fc4b3
github.com/evanphx/json-patch/v5 v5.7.0
github.com/go-chi/chi/v5 v5.0.10
Expand All @@ -20,7 +20,7 @@ require (
github.com/google/cel-go v0.13.0
github.com/google/go-cmp v0.5.9
github.com/google/gofuzz v1.2.0
github.com/google/uuid v1.3.1
github.com/google/uuid v1.4.0
github.com/gorilla/mux v1.8.0
github.com/gorilla/websocket v1.5.0
github.com/grafana/k6-operator v0.0.8
Expand All @@ -33,7 +33,7 @@ require (
github.com/jackc/pgx/v5 v5.4.3
github.com/jhump/protoreflect v1.15.2
github.com/kelseyhightower/envconfig v1.4.0
github.com/lestrrat-go/jwx/v2 v2.0.15
github.com/lestrrat-go/jwx/v2 v2.0.16
github.com/microsoft/durabletask-go v0.3.1
github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4
github.com/phayes/freeport v0.0.0-20220201140144-74d24b5ae9f5
Expand All @@ -59,11 +59,11 @@ require (
go.uber.org/ratelimit v0.3.0
golang.org/x/crypto v0.14.0
golang.org/x/exp v0.0.0-20231006140011-7918f672742d
golang.org/x/net v0.16.0
golang.org/x/net v0.17.0
golang.org/x/sync v0.4.0
google.golang.org/genproto/googleapis/api v0.0.0-20230803162519-f966b187b2e5
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d
google.golang.org/grpc v1.57.0
google.golang.org/genproto/googleapis/api v0.0.0-20231012201019-e917dd12ba7a
google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405
google.golang.org/grpc v1.59.0
google.golang.org/protobuf v1.31.0
gopkg.in/yaml.v3 v3.0.1
k8s.io/api v0.26.9
Expand All @@ -76,30 +76,30 @@ require (
k8s.io/metrics v0.26.3
k8s.io/utils v0.0.0-20230726121419-3b25d923346b
sigs.k8s.io/controller-runtime v0.14.6
sigs.k8s.io/yaml v1.3.0
sigs.k8s.io/yaml v1.4.0
)

require (
cloud.google.com/go v0.110.7 // indirect
cloud.google.com/go/compute v1.23.0 // indirect
cloud.google.com/go v0.110.8 // indirect
cloud.google.com/go/compute v1.23.1 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/datastore v1.14.0 // indirect
cloud.google.com/go/iam v1.1.1 // indirect
cloud.google.com/go/datastore v1.15.0 // indirect
cloud.google.com/go/iam v1.1.3 // indirect
cloud.google.com/go/pubsub v1.33.0 // indirect
cloud.google.com/go/secretmanager v1.11.1 // indirect
cloud.google.com/go/secretmanager v1.11.2 // indirect
cloud.google.com/go/storage v1.33.0 // indirect
dubbo.apache.org/dubbo-go/v3 v3.0.3-0.20230118042253-4f159a2b38f3 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/99designs/keyring v1.2.1 // indirect
github.com/AthenZ/athenz v1.10.39 // indirect
github.com/Azure/azure-sdk-for-go v68.0.0+incompatible // indirect
github.com/Azure/azure-sdk-for-go/sdk/ai/azopenai v0.3.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.2 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.1 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.8.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/data/azappconfig v0.6.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/data/azcosmos v0.3.6 // indirect
github.com/Azure/azure-sdk-for-go/sdk/data/aztables v1.0.2 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.4.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/messaging/azeventhubs v1.0.1 // indirect
github.com/Azure/azure-sdk-for-go/sdk/messaging/azservicebus v1.4.1 // indirect
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid/v2 v2.1.1 // indirect
Expand Down Expand Up @@ -292,7 +292,7 @@ require (
github.com/marusama/semaphore/v2 v2.5.0 // indirect
github.com/matoous/go-nanoid/v2 v2.0.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/microsoft/go-mssqldb v1.6.0 // indirect
github.com/miekg/dns v1.1.43 // indirect
Expand Down Expand Up @@ -329,6 +329,7 @@ require (
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/prometheus/procfs v0.11.0 // indirect
github.com/prometheus/statsd_exporter v0.22.7 // indirect
github.com/puzpuzpuz/xsync/v3 v3.0.0 // indirect
github.com/rabbitmq/amqp091-go v1.8.1 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
Expand Down Expand Up @@ -383,7 +384,7 @@ require (
go.uber.org/zap v1.24.0 // indirect
golang.org/x/arch v0.3.0 // indirect
golang.org/x/mod v0.13.0 // indirect
golang.org/x/oauth2 v0.12.0 // indirect
golang.org/x/oauth2 v0.13.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
Expand All @@ -393,7 +394,7 @@ require (
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/api v0.138.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto v0.0.0-20230821184602-ccc8af3d0e93 // indirect
google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b // indirect
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
gopkg.in/couchbase/gocb.v1 v1.6.7 // indirect
gopkg.in/couchbase/gocbcore.v7 v7.1.18 // indirect
Expand All @@ -413,11 +414,11 @@ require (
lukechampine.com/uint128 v1.3.0 // indirect
modernc.org/cc/v3 v3.41.0 // indirect
modernc.org/ccgo/v3 v3.16.15 // indirect
modernc.org/libc v1.24.1 // indirect
modernc.org/libc v1.29.0 // indirect
modernc.org/mathutil v1.6.0 // indirect
modernc.org/memory v1.7.2 // indirect
modernc.org/opt v0.1.3 // indirect
modernc.org/sqlite v1.26.0 // indirect
modernc.org/sqlite v1.27.0 // indirect
modernc.org/strutil v1.2.0 // indirect
modernc.org/token v1.1.0 // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
Expand Down
Loading

0 comments on commit c2cbcd0

Please sign in to comment.