mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-08 06:15:40 +00:00
bump up kopia to v0.21.1
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
This commit is contained in:
@@ -17,7 +17,6 @@ limitations under the License.
|
||||
package nodeagent
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
@@ -95,7 +94,7 @@ func TestIsRunning(t *testing.T) {
|
||||
fakeKubeClient.Fake.PrependReactor(reactor.verb, reactor.resource, reactor.reactorFunc)
|
||||
}
|
||||
|
||||
err := isRunning(context.TODO(), fakeKubeClient, test.namespace, daemonSet)
|
||||
err := isRunning(t.Context(), fakeKubeClient, test.namespace, daemonSet)
|
||||
if test.expectErr == "" {
|
||||
assert.NoError(t, err)
|
||||
} else {
|
||||
@@ -175,7 +174,7 @@ func TestIsRunningInNode(t *testing.T) {
|
||||
|
||||
fakeClient := fakeClientBuilder.WithRuntimeObjects(test.kubeClientObj...).Build()
|
||||
|
||||
err := IsRunningInNode(context.TODO(), "", test.nodeName, fakeClient)
|
||||
err := IsRunningInNode(t.Context(), "", test.nodeName, fakeClient)
|
||||
if test.expectErr == "" {
|
||||
assert.NoError(t, err)
|
||||
} else {
|
||||
@@ -231,7 +230,7 @@ func TestGetPodSpec(t *testing.T) {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
fakeKubeClient := fake.NewSimpleClientset(test.kubeClientObj...)
|
||||
|
||||
spec, err := GetPodSpec(context.TODO(), fakeKubeClient, test.namespace, kube.NodeOSLinux)
|
||||
spec, err := GetPodSpec(t.Context(), fakeKubeClient, test.namespace, kube.NodeOSLinux)
|
||||
if test.expectErr == "" {
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, *spec, test.expectSpec)
|
||||
@@ -316,7 +315,7 @@ func TestGetConfigs(t *testing.T) {
|
||||
fakeKubeClient.Fake.PrependReactor(reactor.verb, reactor.resource, reactor.reactorFunc)
|
||||
}
|
||||
|
||||
result, err := GetConfigs(context.TODO(), test.namespace, fakeKubeClient, "node-agent-config")
|
||||
result, err := GetConfigs(t.Context(), test.namespace, fakeKubeClient, "node-agent-config")
|
||||
if test.expectErr == "" {
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -452,7 +451,7 @@ func TestGetLabelValue(t *testing.T) {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
fakeKubeClient := fake.NewSimpleClientset(test.kubeClientObj...)
|
||||
|
||||
value, err := GetLabelValue(context.TODO(), fakeKubeClient, test.namespace, "fake-label", kube.NodeOSLinux)
|
||||
value, err := GetLabelValue(t.Context(), fakeKubeClient, test.namespace, "fake-label", kube.NodeOSLinux)
|
||||
if test.expectErr == "" {
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, test.expectedValue, value)
|
||||
@@ -581,7 +580,7 @@ func TestGetAnnotationValue(t *testing.T) {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
fakeKubeClient := fake.NewSimpleClientset(test.kubeClientObj...)
|
||||
|
||||
value, err := GetAnnotationValue(context.TODO(), fakeKubeClient, test.namespace, "fake-annotation", kube.NodeOSLinux)
|
||||
value, err := GetAnnotationValue(t.Context(), fakeKubeClient, test.namespace, "fake-annotation", kube.NodeOSLinux)
|
||||
if test.expectErr == "" {
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, test.expectedValue, value)
|
||||
@@ -691,7 +690,7 @@ func TestGetToleration(t *testing.T) {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
fakeKubeClient := fake.NewSimpleClientset(test.kubeClientObj...)
|
||||
|
||||
value, err := GetToleration(context.TODO(), fakeKubeClient, test.namespace, "fake-toleration", kube.NodeOSLinux)
|
||||
value, err := GetToleration(t.Context(), fakeKubeClient, test.namespace, "fake-toleration", kube.NodeOSLinux)
|
||||
if test.expectErr == "" {
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, test.expectedValue, *value)
|
||||
@@ -851,7 +850,7 @@ func TestGetHostPodPath(t *testing.T) {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
fakeKubeClient := fake.NewSimpleClientset(test.kubeClientObj...)
|
||||
|
||||
path, err := GetHostPodPath(context.TODO(), fakeKubeClient, test.namespace, test.osType)
|
||||
path, err := GetHostPodPath(t.Context(), fakeKubeClient, test.namespace, test.osType)
|
||||
|
||||
if test.expectErr == "" {
|
||||
require.NoError(t, err)
|
||||
|
||||
Reference in New Issue
Block a user