Skip to content

Commit

Permalink
IBM provider: remove deprecated code for fetching secret by name (ext…
Browse files Browse the repository at this point in the history
…ernal-secrets#3078)

* remove deprecated code for fetching secret by name

Signed-off-by: shanti.gundumalla@ibm.com <shanti.gundumalla@ibm.com>

* update the documentation

Signed-off-by: shanti.gundumalla@ibm.com <shanti.gundumalla@ibm.com>

* fix linting

Signed-off-by: shanti.gundumalla@ibm.com <shanti.gundumalla@ibm.com>

---------

Signed-off-by: shanti.gundumalla@ibm.com <shanti.gundumalla@ibm.com>
Co-authored-by: shanti.gundumalla@ibm.com <shanti.gundumalla@ibm.com>
  • Loading branch information
Shanti-G and ShantiGundumalla authored Jan 26, 2024
1 parent 01f6be8 commit 5f8d240
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 415 deletions.
6 changes: 0 additions & 6 deletions docs/provider/ibm-secrets-manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,6 @@ Alternatively, the secret name along with its secret group name can be specified
{% include 'ibm-external-secret-by-name.yaml' %}
```

Please note that the below mechanism to get the secret by name is deprecated and not supported.

```yaml
{% include 'ibm-external-secret-by-name-deprecated.yaml' %}
```

### Getting the Kubernetes secret
The operator will fetch the IBM Secret Manager secret and inject it as a `Kind=Secret`
```
Expand Down
22 changes: 0 additions & 22 deletions docs/snippets/ibm-external-secret-by-name-deprecated.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ require (
github.com/goccy/go-json v0.10.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
Expand Down
72 changes: 0 additions & 72 deletions pkg/provider/ibm/cache.go

This file was deleted.

92 changes: 0 additions & 92 deletions pkg/provider/ibm/cache_test.go

This file was deleted.

16 changes: 0 additions & 16 deletions pkg/provider/ibm/fake/fake.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,13 @@ import (

type IBMMockClient struct {
getSecretWithContext func(ctx context.Context, getSecretOptions *sm.GetSecretOptions) (result sm.SecretIntf, response *core.DetailedResponse, err error)
listSecretsWithContext func(ctx context.Context, listSecretsOptions *sm.ListSecretsOptions) (result *sm.SecretMetadataPaginatedCollection, response *core.DetailedResponse, err error)
getSecretByNameTypeWithContext func(ctx context.Context, getSecretByNameTypeOptions *sm.GetSecretByNameTypeOptions) (result sm.SecretIntf, response *core.DetailedResponse, err error)
}

type IBMMockClientParams struct {
GetSecretOptions *sm.GetSecretOptions
GetSecretOutput sm.SecretIntf
GetSecretErr error
ListSecretsOptions *sm.ListSecretsOptions
ListSecretsOutput *sm.SecretMetadataPaginatedCollection
ListSecretsErr error
GetSecretByNameOptions *sm.GetSecretByNameTypeOptions
GetSecretByNameOutput sm.SecretIntf
GetSecretByNameErr error
Expand All @@ -45,10 +41,6 @@ func (mc *IBMMockClient) GetSecretWithContext(ctx context.Context, getSecretOpti
return mc.getSecretWithContext(ctx, getSecretOptions)
}

func (mc *IBMMockClient) ListSecretsWithContext(ctx context.Context, listSecretsOptions *sm.ListSecretsOptions) (result *sm.SecretMetadataPaginatedCollection, response *core.DetailedResponse, err error) {
return mc.listSecretsWithContext(ctx, listSecretsOptions)
}

func (mc *IBMMockClient) GetSecretByNameTypeWithContext(ctx context.Context, getSecretByNameTypeOptions *sm.GetSecretByNameTypeOptions) (result sm.SecretIntf, response *core.DetailedResponse, err error) {
return mc.getSecretByNameTypeWithContext(ctx, getSecretByNameTypeOptions)
}
Expand All @@ -63,14 +55,6 @@ func (mc *IBMMockClient) WithValue(params IBMMockClientParams) {
}
return params.GetSecretOutput, nil, params.GetSecretErr
}
mc.listSecretsWithContext = func(ctx context.Context, paramReq *sm.ListSecretsOptions) (result *sm.SecretMetadataPaginatedCollection, response *core.DetailedResponse, err error) {
// type secretmanagerpb.AccessSecretVersionRequest contains unexported fields
// use cmpopts.IgnoreUnexported to ignore all the unexported fields in the cmp.
if !cmp.Equal(paramReq, params.ListSecretsOptions, cmpopts.IgnoreUnexported(sm.SecretMetadataPaginatedCollection{})) {
return nil, nil, fmt.Errorf("unexpected test argument for ListSecrets: %s, %s", *paramReq.Search, *params.ListSecretsOptions.Search)
}
return params.ListSecretsOutput, nil, params.ListSecretsErr
}
mc.getSecretByNameTypeWithContext = func(ctx context.Context, paramReq *sm.GetSecretByNameTypeOptions) (sm.SecretIntf, *core.DetailedResponse, error) {
// type secretmanagerpb.AccessSecretVersionRequest contains unexported fields
// use cmpopts.IgnoreUnexported to ignore all the unexported fields in the cmp.
Expand Down
82 changes: 0 additions & 82 deletions pkg/provider/ibm/helper.go

This file was deleted.

Loading

0 comments on commit 5f8d240

Please sign in to comment.