Comments (5)
great analysis, do you have any idea to fix this?
from karmada.
great analysis, do you have any idea to fix this?
When performing a clean up of marks on rb/crb, we can compare the value of the label policyv1alpha1.ClusterPropagationPolicyPermanentIDLabel
on the cb/crb with the policyId value of the deleted CPP/PP. If they are not the same, it indicates that the rb/crb has already claimed to a new CPP/PP, and there is no need to clean up the label/annotation.
just like:
func (d *ResourceDetector) HandleClusterPropagationPolicyDeletion(policyID string) error {
var errs []error
labelSet := labels.Set{
policyv1alpha1.ClusterPropagationPolicyPermanentIDLabel: policyID,
}
cleanupMarksFun := func(obj metav1.Object) bool {
if obj.GetLabels()[policyv1alpha1.ClusterPropagationPolicyPermanentIDLabel] != policyId {
return false
}
util.RemoveLabels(obj, clusterPropagationPolicyMarkedLabels...)
util.RemoveAnnotations(obj, clusterPropagationPolicyMarkedAnnotations...)
return true
}
... ...
}
func (d *ResourceDetector) CleanupResourceBindingMarks(rb *workv1alpha2.ResourceBinding, cleanupFunc func(obj metav1.Object) bool) error {
return retry.RetryOnConflict(retry.DefaultRetry, func() (err error) {
if !cleanupFunc(rb) {
klog.Infof("xxxx no need to clean up xxx")
return nil
}
updateErr := d.Client.Update(context.TODO(), rb)
if updateErr == nil {
return nil
}
updated := &workv1alpha2.ResourceBinding{}
if err = d.Client.Get(context.TODO(), client.ObjectKey{Namespace: rb.GetNamespace(), Name: rb.GetName()}, updated); err == nil {
rb = updated.DeepCopy()
} else {
klog.Errorf("Failed to get updated resource binding %s/%s: %v", rb.GetNamespace(), rb.GetName(), err)
}
return updateErr
})
}
from karmada.
it's a good answer.
from karmada.
In favor of #5319
/assign
from karmada.
I'm sorry, I made the wrong assign.
/assign @zhzhuang-zju
/unassign
from karmada.
Related Issues (20)
- Routing proxy
- DependentObjectReference needs the api group
- Improve test coverage in pkg/utils/fixedpool
- Support multiple label selection ability in karmadactl init HOT 1
- Helm installation of scheduler-estimator fails with cert error HOT 6
- [flaky test] remedy testing test with nil decision matches remedy [It] Create an immediately type remedy, then remove it HOT 1
- Append operator for annotation overrider
- Aggregate apiserver cannot patch pod when using "matchAllClusters"
- Support json or yaml plaintext field overriding HOT 1
- Test Coverage of files in pkg/controllers/status/
- Issue with Missing `karmada-cert` Secret When Enabling Addons Using `karmadactl` HOT 2
- Add go fmt to make verify Target to Ensure Code Formatting before commiting and pushing changes HOT 3
- propagation bug when resource create before lazy policy HOT 3
- 通过helm部署,apiserver如何使用nodeport方式暴露出来 HOT 2
- SpreadConstraint supports more complex election strategies. HOT 1
- [Umbrella] standardize the naming of karmada secrets across different installation methods HOT 3
- kubectl karmada init --karmada-apiserver-replicas 3 --etcd-replicas 3 --karmada-apiserver-advertise-address='xxx.xxx.xxx.x' HOT 3
- failover feature-gate Cannot be closed correctly HOT 5
- Request to be a Member of Karmada community
- [Summer OSPP 2024] Karmada supports smooth rollback of a single cluster
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from karmada.