Fix: fix problem of loading pods of cronjob (#5007)

Signed-off-by: HanMengnan <1448189829@qq.com>

Signed-off-by: HanMengnan <1448189829@qq.com>
This commit is contained in:
Siege Lion
2022-11-07 11:06:14 +08:00
committed by GitHub
parent 7e012f5ca0
commit 0e849d142c
2 changed files with 14 additions and 1 deletions

View File

@@ -213,7 +213,7 @@ func init() {
listOptions: cronJobLabelListOption,
},
}),
GroupResourceType: GroupResourceType{Group: "batch/v1", Kind: "CronJob"},
GroupResourceType: GroupResourceType{Group: "batch", Kind: "CronJob"},
},
)
}

View File

@@ -1460,6 +1460,19 @@ var _ = Describe("unit-test to e2e test", func() {
Expect(len(tn)).Should(BeEquivalentTo(2))
Expect(len(tn[0].LeafNodes)).Should(BeEquivalentTo(1))
Expect(len(tn[1].LeafNodes)).Should(BeEquivalentTo(1))
tn, err = iterateListSubResources(ctx, "", k8sClient, types.ResourceTreeNode{
Cluster: "",
Namespace: "test-namespace",
Name: "cronjob1",
APIVersion: "batch/v1",
Kind: "CronJob",
}, 1, func(node types.ResourceTreeNode) bool {
return true
})
Expect(err).Should(BeNil())
Expect(len(tn)).Should(BeEquivalentTo(1))
Expect(len(tn[0].LeafNodes)).Should(BeEquivalentTo(0))
})
It("test provider handler func", func() {