mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-05 13:05:17 +00:00
Use controller-runtime client to get restic secrets (#3320)
* Use kubebuilder client for fetching restic secrets Instead of using a SecretInformer for fetching secrets for restic, use the cached client provided by the controller-runtime manager. In order to use this client, the scheme for Secrets must be added to the scheme used by the manager so this is added when creating the manager in both the velero and restic servers. This change also refactors some of the tests to add a shared utility for creating a fake controller-runtime client which is now used among all tests which use that client. This has been added to ensure that all tests use the same client with the same scheme. Signed-off-by: Bridget McErlean <bmcerlean@vmware.com> * Add builder for SecretKeySelector Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2017, 2019 the Velero contributors.
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -251,9 +251,9 @@ func TestGCControllerProcessQueueItem(t *testing.T) {
|
||||
|
||||
var fakeClient kbclient.Client
|
||||
if test.backupLocation != nil {
|
||||
fakeClient = newFakeClient(t, test.backupLocation)
|
||||
fakeClient = velerotest.NewFakeControllerRuntimeClient(t, test.backupLocation)
|
||||
} else {
|
||||
fakeClient = newFakeClient(t)
|
||||
fakeClient = velerotest.NewFakeControllerRuntimeClient(t)
|
||||
}
|
||||
|
||||
controller := NewGCController(
|
||||
|
||||
Reference in New Issue
Block a user