Skip to content

Conversation

LY-today
Copy link
Contributor

@LY-today LY-today commented Jun 16, 2025

Signed-off-by: LY-today <[email protected]>
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: LY-today
Once this PR has been reviewed and has the lgtm label, please assign 196ikuchil for approval. For more information see the Code Review Process.

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

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

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. labels Jun 16, 2025
@k8s-ci-robot k8s-ci-robot requested a review from 196Ikuchil June 16, 2025 02:15
@k8s-ci-robot
Copy link
Contributor

Hi @LY-today. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 16, 2025
Signed-off-by: LY-today <[email protected]>
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 16, 2025
@LY-today
Copy link
Contributor Author

#421

Copy link
Member

@sanposhiho sanposhiho left a comment

Choose a reason for hiding this comment

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

/ok-to-test
/cc @saza-ku @ordovicia @utam0k

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Jun 16, 2025
@k8s-ci-robot k8s-ci-robot requested a review from utam0k June 16, 2025 19:48
@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 16, 2025
@k8s-ci-robot
Copy link
Contributor

@sanposhiho: GitHub didn't allow me to request PR reviews from the following users: saza-ku, ordovicia.

Note that only kubernetes-sigs members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/ok-to-test
/cc @saza-ku @ordovicia @utam0k

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@sanposhiho sanposhiho mentioned this pull request Jun 16, 2025
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 17, 2025
Copy link
Contributor

@saza-ku saza-ku left a comment

Choose a reason for hiding this comment

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

Could you add test cases of importing/syncing pods with account services?

@@ -42,6 +42,7 @@ type ResourcesForSnap struct {

// ResourcesForLoad indicates all resources and scheduler configuration to be loaded.
type ResourcesForLoad struct {
Sas []v1.ServiceAccountApplyConfiguration `json:"sas"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Now SnapshotService is only used by SnapshotHandler and it only handles resources of the fake cluster. So we don't need to change SnapshotService.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do I need to delete this line?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There will be an exception after deletion

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@saza-ku Any suggestions?

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean we don't need the entire fix in SnapshotService, not only the line.

Copy link
Contributor

Choose a reason for hiding this comment

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

instead of the DefaultGVRs of simulator/oneshotimporter/importer.go

No, I mean we need to fix both oneshotimporter and syncer. And this has been achived by 8bab17c. So that's okay!

And I mistakenly believed that SnapshotService didn't need to handle ServiceAccount. But if you export resources that is imported by real clusters, it can contain ServiceAccount that is other than default. Sorry for my misunderstanding.

Copy link
Contributor

@saza-ku saza-ku Jun 23, 2025

Choose a reason for hiding this comment

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

But we need additional fix. It needs to Snap ServiceAccount not only Load.

Copy link
Contributor Author

@LY-today LY-today Jun 23, 2025

Choose a reason for hiding this comment

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

@saza-ku How can I fix it? Currently, all the changes in this PR can run normally on my local machine and meet my needs. Other fixes may require your guidance.

Copy link
Contributor

Choose a reason for hiding this comment

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

Almost the same as Load. You would add Sas to ResourcesForSnap, and implement listSas.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Almost the same as Load. You would add Sas to ResourcesForSnap, and implement listSas.

done

@LY-today
Copy link
Contributor Author

LY-today commented Jun 20, 2025

Could you add test cases of importing/syncing pods with account services?

It seems that the existing single test of simulator/snapshot cannot run smoothly? It seems that there is a go.mod dependency conflict?

image

@saza-ku
Copy link
Contributor

saza-ku commented Jun 20, 2025

Does this error occur when you run make test? I did it on my machine, but it didn't repro.

@LY-today
Copy link
Contributor Author

Does this error occur when you run make test? I did it on my machine, but it didn't repro.

What is your go version?

@LY-today
Copy link
Contributor Author

LY-today commented Jun 23, 2025

Does this error occur when you run make test? I did it on my machine, but it didn't repro.

What is your go version?

@saza-ku
It is a problem with my local go.mod, which can be ignored. The test case can be run successfully.

Signed-off-by: LY-today <[email protected]>
@k8s-ci-robot
Copy link
Contributor

@LY-today: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kube-scheduler-simulator-backend-lint bfe50d9 link true /test pull-kube-scheduler-simulator-backend-lint

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@LY-today
Copy link
Contributor Author

@saza-ku ci reports this error, how can I adjust it?
snapshot/snapshot.go:105:1: calculated cyclomatic complexity for function get is 11, max is 10 (cyclop)

@saza-ku
Copy link
Contributor

saza-ku commented Jun 23, 2025

cyclop calculates complexity in this way: https://github.com/bkielbasa/cyclop/blob/master/pkg/analyzer/analyzer.go
You need to somehow decrease it.

@ZheJun-Jiang
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants