Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the user's custom localization overwrite by the framework-generated localization #668

Open
zhenkuang opened this issue Apr 14, 2023 · 4 comments
Labels
kind/feature New feature or request

Comments

@zhenkuang
Copy link
Contributor

zhenkuang commented Apr 14, 2023

What would you like to be added:

We hope that the priority of user-customized localization is higher than the priority of the framework-generated localization.

Why is this needed:

The default priority of localization in the framework is 1000. If the priority of a custom localization is also 1000, the priority of localization will be determined by the create time of the localization. But the framework's Localization will be rebuilt, which will result in the user's custom localization being overwritten.

sort.SliceStable(locs, func(i, j int) bool {
if locs[i].Spec.Priority == locs[j].Spec.Priority {
return locs[i].CreationTimestamp.Second() < locs[j].CreationTimestamp.Second()
}
return locs[i].Spec.Priority < locs[j].Spec.Priority
})

@zhenkuang zhenkuang added the kind/feature New feature or request label Apr 14, 2023
@dixudx
Copy link
Member

dixudx commented Apr 17, 2023

We hope that the priority of user-customized localization is higher than the priority of the framework-generated localization.

The default priority of localization in the framework is 1000. If the priority of a custom localization is also 1000

The framework will help generate a system-defined Localization that purely override replicas based on the FeedInventory. We set the highest priority for this object to make sure we will get this desired replicas in the final. And these system-defined Localization objects will only be created when the scheduling strategy is set to Dividing.

For other fields except replicas, of course you CAN set your Localization objects with highest priority 1000. That won't make any conflicts or changes unless you want to make changes on replicas as well. If so, there will be a risk that will lead to chaos. But if you do want to change the replicas, you can create such a Localization object with highest priority 1000 after a while.

@zhenkuang
Copy link
Contributor Author

We hope that the priority of user-customized localization is higher than the priority of the framework-generated localization.

The default priority of localization in the framework is 1000. If the priority of a custom localization is also 1000

The framework will help generate a system-defined Localization that purely override replicas based on the FeedInventory. We set the highest priority for this object to make sure we will get this desired replicas in the final. And these system-defined Localization objects will only be created when the scheduling strategy is set to Dividing.

For other fields except replicas, of course you CAN set your Localization objects with highest priority 1000. That won't make any conflicts or changes unless you want to make changes on replicas as well. If so, there will be a risk that will lead to chaos. But if you do want to change the replicas, you can create such a Localization object with highest priority 1000 after a while.

But I think that the Localization created by the user does not affect the operation of the entire framework. Can we consider providing a feature gate to support this setting?

@dixudx
Copy link
Member

dixudx commented Apr 21, 2023

But I think that the Localization created by the user does not affect the operation of the entire framework.

Please submit a PR on this. Let's see how it will work.

@zhenkuang
Copy link
Contributor Author

But I think that the Localization created by the user does not affect the operation of the entire framework.

Please submit a PR on this. Let's see how it will work.

ok, I will submit a version rencently

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants