Skip to content

Commit

Permalink
Remove name from DeleteSercretStructure
Browse files Browse the repository at this point in the history
  • Loading branch information
anvial committed Apr 3, 2024
1 parent 78f7a60 commit 2bcabd3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions internal/juju/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ type UpdateSecretInput struct {
type DeleteSecretInput struct {
SecretId string
ModelName string
Name string
}

func newSecretsClient(sc SharedClient) *secretsClient {
Expand Down Expand Up @@ -191,7 +190,7 @@ func (c *secretsClient) DeleteSecret(input *DeleteSecretInput) error {
return err
}
// TODO: think about removing concrete revision.
err = secretAPIClient.RemoveSecret(secretURI, input.Name, nil)
err = secretAPIClient.RemoveSecret(secretURI, "", nil)
if !errors.Is(err, jujuerrors.NotFound) {
return typedError(err)
}
Expand Down
4 changes: 1 addition & 3 deletions internal/juju/secrets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,19 +224,17 @@ func (s *SecretSuite) TestDeleteSecret() {
ctlr := s.setupMocks(s.T())
defer ctlr.Finish()

secretName := "test-secret"
secretId := "secret:9m4e2mr0ui3e8a215n4g"

secretURI, err := coresecrets.ParseURI(secretId)
s.Require().NoError(err)

s.mockSecretClient.EXPECT().RemoveSecret(secretURI, secretName, nil).Return(nil).AnyTimes()
s.mockSecretClient.EXPECT().RemoveSecret(secretURI, "", nil).Return(nil).AnyTimes()

client := s.getSecretsClient()
err = client.DeleteSecret(&DeleteSecretInput{
SecretId: secretId,
ModelName: s.testModelName,
Name: secretName,
})
s.Assert().NoError(err)
}
Expand Down

0 comments on commit 2bcabd3

Please sign in to comment.