Skip to content

chore: remove the pod group#9

Merged
volcano-sh-bot merged 1 commit intovolcano-sh:mainfrom
Vacant2333:remove-pod-group
Jan 14, 2025
Merged

chore: remove the pod group#9
volcano-sh-bot merged 1 commit intovolcano-sh:mainfrom
Vacant2333:remove-pod-group

Conversation

@Vacant2333
Copy link
Copy Markdown
Contributor

for now, we didnt need the pod group, we can use resourcebinding to managet hte tasks, and implement the worklaod interface, we can supports more resource like deployment

Signed-off-by: Vacant2333 <vacant2333@gmail.com>

// This map contains the workload that we can handle now, the controllers will create PodGroup for them.
var workloadGVKMap = map[schema.GroupVersionKind]struct{}{
var workloadGVKMap = map[schema.GroupVersionKind]NewWorkloadFunc{
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need expose a method to let other workloads register themselves?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can register each workload ourselves to the workloadGVKMap, how do u think?

return nil, err
}

resource, err := dc.dynamicClient.Resource(mapping.Resource).Namespace(ref.Namespace).Get(context.Background(), ref.Name, metav1.GetOptions{})
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way that we can get resource directly and avoid API request, seems it's heavy.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't find a better way because we had to get the corresponding resources from rb, but in dispatcher we weren't sure which resources to handle

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK.

@Monokaix
Copy link
Copy Markdown
Member

Monokaix commented Dec 28, 2024

It's better to add ut, can submit a seperate pr.


// Check if its workload, skip suspend if not.
isWorkload, err := utils.IsWorkload(rb.Spec.Resource)
isWorkload, _, err := workload.TryGetNewWorkloadFunc(rb.Spec.Resource)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we depend on this condition to check whether rb reference to a workload? In Karmada, based on rb.spec.Replicas>0 to determine whether it is a workload, but now this judgment is based on whether the workload has been registered, if there is no registration of workload judgment result is wrong.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the workload means the workloads we support, like volcano job, when we support the other workload like deployment, then we can handle it, else we should't suspend it

@Vacant2333
Copy link
Copy Markdown
Contributor Author

It's better to add ut, can submit a seperate pr.

ok, i will submit a ut pr for it after this pr

@Monokaix
Copy link
Copy Markdown
Member

/lgtm

Copy link
Copy Markdown
Member

@william-wang william-wang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@volcano-sh-bot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: william-wang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@volcano-sh-bot volcano-sh-bot merged commit 9411dbf into volcano-sh:main Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants