Change the CreateFileToPod function's OS parameter as the E2E pass-in value.
Run the E2E test on kind / build (push) Failing after 9s
Run the E2E test on kind / setup-test-matrix (push) Successful in 2s
Run the E2E test on kind / run-e2e-test (push) Has been skipped

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:
Xun Jiang
2025-08-21 09:34:06 +08:00
parent 5d9ea761d4
commit 2178d36d14
22 changed files with 530 additions and 129 deletions
@@ -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)
}