Skip to content

Commit

Permalink
Apparently we need to use /v2 for 2.0.0+ modules
Browse files Browse the repository at this point in the history
  • Loading branch information
sethvargo committed Apr 8, 2024
1 parent 22a0cfe commit 1e23983
Show file tree
Hide file tree
Showing 21 changed files with 42 additions and 32 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ stored in [Cloud Storage][cloud-storage]. An interoperable layer also exists wit
- Install from source (requires a working Go installation):

```sh
go install github.com/GoogleCloudPlatform/berglas@latest
go install github.com/GoogleCloudPlatform/berglas/v2@latest
```

1. Export your project ID as an environment variable. The rest of this setup
Expand Down Expand Up @@ -353,7 +353,7 @@ Berglas is also a Go library that can be imported in Go projects:
```go
import (
_ "github.com/GoogleCloudPlatform/berglas/pkg/auto"
_ "github.com/GoogleCloudPlatform/berglas/v2/pkg/auto"
)
```
Expand All @@ -372,7 +372,7 @@ import (
"log"
"os"
"github.com/GoogleCloudPlatform/berglas/pkg/berglas"
"github.com/GoogleCloudPlatform/berglas/v2/pkg/berglas"
)
func main() {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/GoogleCloudPlatform/berglas
module github.com/GoogleCloudPlatform/berglas/v2

go 1.21.4

Expand Down
11 changes: 11 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
Expand Down Expand Up @@ -54,6 +55,10 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw=
github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk=
github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o=
github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
Expand All @@ -65,6 +70,7 @@ github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56
github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
Expand All @@ -80,13 +86,17 @@ github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpE
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc=
go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo=
go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4=
go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM=
go.opentelemetry.io/otel/sdk v1.19.0 h1:6USY6zH+L8uMH8L3t1enZPR3WFEmSTADlqldyHtJi3o=
go.opentelemetry.io/otel/sdk v1.19.0/go.mod h1:NedEbbS4w3C6zElbLdPJKOpJQOrGUJ+GfzpjUvI0v1A=
go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc=
go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
Expand Down Expand Up @@ -187,6 +197,7 @@ google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import (
"syscall"
"text/tabwriter"

"github.com/GoogleCloudPlatform/berglas/internal/version"
"github.com/GoogleCloudPlatform/berglas/pkg/berglas"
"github.com/GoogleCloudPlatform/berglas/pkg/berglas/logging"
"github.com/GoogleCloudPlatform/berglas/v2/internal/version"
"github.com/GoogleCloudPlatform/berglas/v2/pkg/berglas"
"github.com/GoogleCloudPlatform/berglas/v2/pkg/berglas/logging"
"github.com/spf13/cobra"
)

Expand Down
15 changes: 7 additions & 8 deletions pkg/auto/auto.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@

// Package auto automatically parses berglas references when imported.
//
// import (
// _ "github.com/GoogleCloudPlatform/berglas/pkg/auto"
// )
// import (
// _ "github.com/GoogleCloudPlatform/berglas/v2/pkg/auto"
// )
//
// Set environment variables on your deployment using the berglas:// prefix in
// the format:
//
// berglas://<bucket>/<secret>?<params>
// berglas://<bucket>/<secret>?<params>
//
// - "bucket" is the name of the Google Cloud Storage bucket where secrets
// are stored
Expand All @@ -30,15 +30,14 @@
//
// Examples:
//
// berglas://my-bucket/my-secret
// berglas://my-bucket/path/to/secret?destination=tempfile
// berglas://my-bucket/path/to/secret?destination=/var/foo/bar
// berglas://my-bucket/my-secret
// berglas://my-bucket/path/to/secret?destination=tempfile
// berglas://my-bucket/path/to/secret?destination=/var/foo/bar
//
// On init, the package queries the list of configured environment variables
// against the metadata service. If environment variables match, their values
// are automatically replaced with the secret value.
//
//
// By default, any errors result in a panic. If you want the function to
// continue executing even if resolution or communication fails, set the
// environment variable `BERGLAS_CONTINUE_ON_ERROR` to `true` or do not use the
Expand Down
4 changes: 2 additions & 2 deletions pkg/auto/importer.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
"strings"
"syscall"

"github.com/GoogleCloudPlatform/berglas/pkg/berglas"
"github.com/GoogleCloudPlatform/berglas/pkg/berglas/logging"
"github.com/GoogleCloudPlatform/berglas/v2/pkg/berglas"
"github.com/GoogleCloudPlatform/berglas/v2/pkg/berglas/logging"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion pkg/berglas/access.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"fmt"

secretspb "cloud.google.com/go/secretmanager/apiv1/secretmanagerpb"
"github.com/GoogleCloudPlatform/berglas/pkg/berglas/logging"
"github.com/GoogleCloudPlatform/berglas/v2/pkg/berglas/logging"
grpccodes "google.golang.org/grpc/codes"
grpcstatus "google.golang.org/grpc/status"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/berglas/berglas.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
kms "cloud.google.com/go/kms/apiv1"
secretmanager "cloud.google.com/go/secretmanager/apiv1"
"cloud.google.com/go/storage"
"github.com/GoogleCloudPlatform/berglas/internal/version"
"github.com/GoogleCloudPlatform/berglas/v2/internal/version"
"google.golang.org/api/option"
storagev1 "google.golang.org/api/storage/v1"
"google.golang.org/protobuf/types/known/timestamppb"
Expand Down
2 changes: 1 addition & 1 deletion pkg/berglas/berglas_doc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"log"
"os"

"github.com/GoogleCloudPlatform/berglas/pkg/berglas"
"github.com/GoogleCloudPlatform/berglas/v2/pkg/berglas"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion pkg/berglas/berglas_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"testing"
"time"

"github.com/GoogleCloudPlatform/berglas/pkg/berglas/logging"
"github.com/GoogleCloudPlatform/berglas/v2/pkg/berglas/logging"
)

func TestKMSKeyTrimVersion(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/berglas/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

"cloud.google.com/go/kms/apiv1/kmspb"
"cloud.google.com/go/storage"
"github.com/GoogleCloudPlatform/berglas/pkg/berglas/logging"
"github.com/GoogleCloudPlatform/berglas/v2/pkg/berglas/logging"
"google.golang.org/api/googleapi"
grpccodes "google.golang.org/grpc/codes"
grpcstatus "google.golang.org/grpc/status"
Expand Down
2 changes: 1 addition & 1 deletion pkg/berglas/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"sort"

secretspb "cloud.google.com/go/secretmanager/apiv1/secretmanagerpb"
"github.com/GoogleCloudPlatform/berglas/pkg/berglas/logging"
"github.com/GoogleCloudPlatform/berglas/v2/pkg/berglas/logging"
grpccodes "google.golang.org/grpc/codes"
grpcstatus "google.golang.org/grpc/status"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/berglas/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

secretspb "cloud.google.com/go/secretmanager/apiv1/secretmanagerpb"
"cloud.google.com/go/storage"
"github.com/GoogleCloudPlatform/berglas/pkg/berglas/logging"
"github.com/GoogleCloudPlatform/berglas/v2/pkg/berglas/logging"
"golang.org/x/sync/semaphore"
"google.golang.org/api/iterator"
grpccodes "google.golang.org/grpc/codes"
Expand Down
2 changes: 1 addition & 1 deletion pkg/berglas/grant.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

"cloud.google.com/go/iam"
"cloud.google.com/go/storage"
"github.com/GoogleCloudPlatform/berglas/pkg/berglas/logging"
"github.com/GoogleCloudPlatform/berglas/v2/pkg/berglas/logging"
grpccodes "google.golang.org/grpc/codes"
grpcstatus "google.golang.org/grpc/status"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/berglas/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

secretspb "cloud.google.com/go/secretmanager/apiv1/secretmanagerpb"
"cloud.google.com/go/storage"
"github.com/GoogleCloudPlatform/berglas/pkg/berglas/logging"
"github.com/GoogleCloudPlatform/berglas/v2/pkg/berglas/logging"
"google.golang.org/api/iterator"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/berglas/read.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"cloud.google.com/go/kms/apiv1/kmspb"
secretspb "cloud.google.com/go/secretmanager/apiv1/secretmanagerpb"
"cloud.google.com/go/storage"
"github.com/GoogleCloudPlatform/berglas/pkg/berglas/logging"
"github.com/GoogleCloudPlatform/berglas/v2/pkg/berglas/logging"
grpccodes "google.golang.org/grpc/codes"
grpcstatus "google.golang.org/grpc/status"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/berglas/replace.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"os"

"github.com/GoogleCloudPlatform/berglas/pkg/berglas/logging"
"github.com/GoogleCloudPlatform/berglas/v2/pkg/berglas/logging"
)

// Replace parses a berglas reference and replaces it. See Client.Replace for
Expand Down
2 changes: 1 addition & 1 deletion pkg/berglas/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"os"
"runtime"

"github.com/GoogleCloudPlatform/berglas/pkg/berglas/logging"
"github.com/GoogleCloudPlatform/berglas/v2/pkg/berglas/logging"
)

// chmodSupported indicates whether the OS supports chmod
Expand Down
2 changes: 1 addition & 1 deletion pkg/berglas/revoke.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

"cloud.google.com/go/iam"
"cloud.google.com/go/storage"
"github.com/GoogleCloudPlatform/berglas/pkg/berglas/logging"
"github.com/GoogleCloudPlatform/berglas/v2/pkg/berglas/logging"
grpccodes "google.golang.org/grpc/codes"
grpcstatus "google.golang.org/grpc/status"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/berglas/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"cloud.google.com/go/iam"
secretspb "cloud.google.com/go/secretmanager/apiv1/secretmanagerpb"
"cloud.google.com/go/storage"
"github.com/GoogleCloudPlatform/berglas/pkg/berglas/logging"
"github.com/GoogleCloudPlatform/berglas/v2/pkg/berglas/logging"
grpccodes "google.golang.org/grpc/codes"
grpcstatus "google.golang.org/grpc/status"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/berglas/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

"cloud.google.com/go/kms/apiv1/kmspb"
"cloud.google.com/go/storage"
"github.com/GoogleCloudPlatform/berglas/pkg/berglas/logging"
"github.com/GoogleCloudPlatform/berglas/v2/pkg/berglas/logging"
"google.golang.org/api/googleapi"
)

Expand Down

0 comments on commit 1e23983

Please sign in to comment.