Skip to content
This repository has been archived by the owner on Jul 5, 2021. It is now read-only.

Commit

Permalink
ss: use secretstore namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
iamcaleberic committed Oct 30, 2020
1 parent 0e8ead8 commit a0b958b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
3 changes: 1 addition & 2 deletions controllers/store/secretstore_controller.go
Expand Up @@ -84,11 +84,10 @@ func (r *SecretStoreReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error)

secretRef := config.Auth["secretRef"].(map[string]interface{})
secretRefName := secretRef["name"].(string)
secretRefNamespace := secretRef["namespace"].(string)

// Fetch credential Secret
credentialsSecret := &corev1.Secret{}
err = r.Get(ctx, types.NamespacedName{Name: secretRefName, Namespace: secretRefNamespace}, credentialsSecret)
err = r.Get(ctx, types.NamespacedName{Name: secretRefName, Namespace: secretStore.Namespace}, credentialsSecret)
if err != nil {
// Error reading the object - requeue the request.
log.Error(err, "Failed to get credentials Secret")
Expand Down
9 changes: 3 additions & 6 deletions controllers/store/secretstore_controller_test.go
Expand Up @@ -37,8 +37,7 @@ var _ = Describe("SecretstoreController", func() {
"type": "dummy",
"auth": {
"secretRef": {
"name": "credential-secret-store",
"namespace": "default"
"name": "credential-secret-store"
}
},
"parameters": {
Expand Down Expand Up @@ -162,8 +161,7 @@ var _ = Describe("SecretstoreController", func() {
"type": "dummy",
"auth": {
"secretRef": {
"name": "credential-secret-non-existent",
"namespace": "default"
"name": "credential-secret-non-existent"
}
},
"parameters": {
Expand Down Expand Up @@ -216,8 +214,7 @@ var _ = Describe("SecretstoreController", func() {
"type": "dummy",
"auth": {
"secretRef": {
"name": "credential-secret-store",
"namespace": "default"
"name": "credential-secret-store"
}
},
"parameters": {}
Expand Down

0 comments on commit a0b958b

Please sign in to comment.