mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-10-01 04:05:38 +00:00
Change the CreateFileToPod function's OS parameter as the E2E pass-in value.
Fix GetResourceWithLabel's bug: labels were not applied. Add workOS for deployment and pod creationg. Add OS label for select node. Enlarge the context timeout to 10 minutes. 5 min is not enough for Windows. Enlarge the Kibishii test context to 15 minutes for Windows. Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
This commit is contained in:
@@ -227,9 +227,10 @@ func TestGetResourceMatchedAction(t *testing.T) {
|
||||
},
|
||||
}
|
||||
testCases := []struct {
|
||||
name string
|
||||
volume *structuredVolume
|
||||
expectedAction *Action
|
||||
name string
|
||||
volume *structuredVolume
|
||||
expectedAction *Action
|
||||
resourcePolicies *ResourcePolicies
|
||||
}{
|
||||
{
|
||||
name: "match policy",
|
||||
@@ -299,12 +300,36 @@ func TestGetResourceMatchedAction(t *testing.T) {
|
||||
},
|
||||
expectedAction: nil,
|
||||
},
|
||||
{
|
||||
name: "nil condition always match the action",
|
||||
volume: &structuredVolume{
|
||||
capacity: *resource.NewQuantity(5<<30, resource.BinarySI),
|
||||
storageClass: "some-class",
|
||||
pvcLabels: map[string]string{
|
||||
"environment": "staging",
|
||||
},
|
||||
},
|
||||
resourcePolicies: &ResourcePolicies{
|
||||
Version: "v1",
|
||||
VolumePolicies: []VolumePolicy{
|
||||
{
|
||||
Action: Action{Type: "skip"},
|
||||
Conditions: map[string]any{},
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedAction: &Action{Type: "skip"},
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
policies := &Policies{}
|
||||
err := policies.BuildPolicy(resPolicies)
|
||||
currentResourcePolicy := resPolicies
|
||||
if tc.resourcePolicies != nil {
|
||||
currentResourcePolicy = tc.resourcePolicies
|
||||
}
|
||||
err := policies.BuildPolicy(currentResourcePolicy)
|
||||
if err != nil {
|
||||
t.Errorf("Failed to build policy with error %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user