Skip to content

Commit

Permalink
Bump github.com/juju/description/v4 to v4.0.10;
Browse files Browse the repository at this point in the history
  • Loading branch information
ycliuhw committed Jun 2, 2023
1 parent 92373d9 commit 2ccf226
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 13 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ require (
github.com/juju/clock v1.0.3
github.com/juju/cmd/v3 v3.0.4
github.com/juju/collections v1.0.2
github.com/juju/description/v4 v4.0.8
github.com/juju/description/v4 v4.0.10
github.com/juju/errors v1.0.0
github.com/juju/featureflag v1.0.0
github.com/juju/gnuflag v1.0.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -768,8 +768,8 @@ github.com/juju/collections v0.0.0-20220203020748-febd7cad8a7a/go.mod h1:JWeZdyt
github.com/juju/collections v1.0.0/go.mod h1:JWeZdyttIEbkR51z2S13+J+aCuHVe0F6meRy+P0YGDo=
github.com/juju/collections v1.0.2 h1:y9t99Nq/uUZksJgWehiWxIr2vB1UG3hUT7LBNy1xiH8=
github.com/juju/collections v1.0.2/go.mod h1:kYJowQZYtHDvYDfZOvgf3Mt7mjKYwm/k1nqnJoMYOUc=
github.com/juju/description/v4 v4.0.8 h1:aGHXVW68CyWia5q6c83qv5f1UX6s+I+HW0L4UAB0jfo=
github.com/juju/description/v4 v4.0.8/go.mod h1:LRv+oC6zWwK+MpIEC3TCzRXjw5d75WK1HjcvNTWP+e8=
github.com/juju/description/v4 v4.0.10 h1:7OOR9NJu0Q7fN6Yw0r+6cF9u4xTcCR1e695RJVfTuG4=
github.com/juju/description/v4 v4.0.10/go.mod h1:LRv+oC6zWwK+MpIEC3TCzRXjw5d75WK1HjcvNTWP+e8=
github.com/juju/errors v0.0.0-20150916125642-1b5e39b83d18/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q=
github.com/juju/errors v0.0.0-20200330140219-3fe23663418f/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q=
github.com/juju/errors v0.0.0-20210818161939-5560c4c073ff/go.mod h1:i1eL7XREII6aHpQ2gApI/v6FkVUDEBremNkcBCKYAcY=
Expand Down
30 changes: 20 additions & 10 deletions state/migration_export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (
"github.com/juju/juju/core/secrets"
"github.com/juju/juju/core/status"
"github.com/juju/juju/environs"
"github.com/juju/juju/environs/config"
"github.com/juju/juju/feature"
"github.com/juju/juju/state"
"github.com/juju/juju/state/cloudimagemetadata"
Expand Down Expand Up @@ -2667,6 +2668,15 @@ func (s *MigrationExportSuite) TestSecrets(c *gc.C) {
createTime := time.Now().UTC().Round(time.Second)
next := createTime.Add(time.Minute).Round(time.Second).UTC()
expire := createTime.Add(2 * time.Hour).Round(time.Second).UTC()

backendID, err := backendStore.CreateSecretBackend(state.CreateSecretBackendParams{
Name: "myvault",
BackendType: "vault",
TokenRotateInterval: ptr(666 * time.Second),
NextRotateTime: ptr(next),
})
c.Assert(err, jc.ErrorIsNil)

p := state.CreateSecretParams{
Version: 1,
Owner: owner.Tag(),
Expand All @@ -2684,22 +2694,16 @@ func (s *MigrationExportSuite) TestSecrets(c *gc.C) {
md, err := store.CreateSecret(uri, p)
c.Assert(err, jc.ErrorIsNil)

_, err = backendStore.CreateSecretBackend(state.CreateSecretBackendParams{
ID: "backend-id",
Name: "foo",
BackendType: "vault",
})
c.Assert(err, jc.ErrorIsNil)
_, err = store.UpdateSecret(md.URI, state.UpdateSecretParams{
LeaderToken: &fakeToken{},
ValueRef: &secrets.ValueRef{
BackendID: "backend-id",
BackendID: backendID,
RevisionID: "rev-id",
},
})
c.Assert(err, jc.ErrorIsNil)

backendRefCount, err := s.State.ReadBackendRefCount("backend-id")
backendRefCount, err := s.State.ReadBackendRefCount(backendID)
c.Assert(err, jc.ErrorIsNil)
c.Assert(backendRefCount, gc.Equals, 1)

Expand Down Expand Up @@ -2731,10 +2735,16 @@ func (s *MigrationExportSuite) TestSecrets(c *gc.C) {
})
c.Assert(err, jc.ErrorIsNil)

err = s.Model.UpdateModelConfig(map[string]interface{}{config.SecretBackendKey: "myvault"}, nil)
c.Assert(err, jc.ErrorIsNil)
mCfg, err := s.Model.ModelConfig()
c.Assert(err, jc.ErrorIsNil)
c.Assert(mCfg.SecretBackend(), jc.DeepEquals, "myvault")

model, err := s.State.Export(map[string]string{})
c.Assert(err, jc.ErrorIsNil)

c.Assert(model.SecretBackendID(), gc.Equals, "backend-id")
c.Assert(model.SecretBackendID(), gc.Equals, backendID)

allSecrets := model.Secrets()
c.Assert(allSecrets, gc.HasLen, 1)
Expand All @@ -2753,7 +2763,7 @@ func (s *MigrationExportSuite) TestSecrets(c *gc.C) {
c.Assert(revisions[0].Content(), jc.DeepEquals, map[string]string{"foo": "bar"})
c.Assert(revisions[0].ExpireTime(), jc.DeepEquals, ptr(expire))
c.Assert(revisions[1].ValueRef(), gc.NotNil)
c.Assert(revisions[1].ValueRef().BackendID(), jc.DeepEquals, "backend-id")
c.Assert(revisions[1].ValueRef().BackendID(), jc.DeepEquals, backendID)
c.Assert(revisions[1].ValueRef().RevisionID(), jc.DeepEquals, "rev-id")
consumers := secret.Consumers()
c.Assert(consumers, gc.HasLen, 1)
Expand Down

0 comments on commit 2ccf226

Please sign in to comment.