Merge pull request #1960 from calvin0327/move-cluster-annotations
rename cache resource annotation
This commit is contained in:
commit
a4576872ca
|
@ -4,7 +4,6 @@ const (
|
|||
// TaintClusterUnscheduler will be added when cluster becomes unschedulable
|
||||
// and removed when cluster becomes scheduable.
|
||||
TaintClusterUnscheduler = "cluster.karmada.io/unschedulable"
|
||||
|
||||
// TaintClusterNotReady will be added when cluster is not ready
|
||||
// and removed when cluster becomes ready.
|
||||
TaintClusterNotReady = "cluster.karmada.io/not-ready"
|
||||
|
@ -12,4 +11,8 @@ const (
|
|||
// (corresponding to ClusterConditionReady status ConditionUnknown)
|
||||
// and removed when cluster becomes reachable (ClusterConditionReady status ConditionTrue).
|
||||
TaintClusterUnreachable = "cluster.karmada.io/unreachable"
|
||||
|
||||
// CacheSourceAnnotationKey is the annotation that added to a resource to
|
||||
// represent which cluster it cached from.
|
||||
CacheSourceAnnotationKey = "resource.karmada.io/cached-from-cluster"
|
||||
)
|
|
@ -140,8 +140,8 @@ func addAnnotationWithClusterName(resourceObjects []runtime.Object, clusterName
|
|||
if annotations == nil {
|
||||
annotations = make(map[string]string)
|
||||
}
|
||||
// TODO: move this annotation key `cluster.karmada.io/name` to the Cluster API.
|
||||
annotations["cluster.karmada.io/name"] = clusterName
|
||||
|
||||
annotations[clusterv1alpha1.CacheSourceAnnotationKey] = clusterName
|
||||
|
||||
resource.SetAnnotations(annotations)
|
||||
resources = append(resources, resource)
|
||||
|
|
|
@ -175,7 +175,8 @@ func (os *OpenSearch) upsert(obj interface{}) {
|
|||
if annotations == nil {
|
||||
annotations = make(map[string]string)
|
||||
}
|
||||
annotations["cluster.karmada.io/name"] = os.cluster
|
||||
|
||||
annotations[clusterv1alpha1.CacheSourceAnnotationKey] = os.cluster
|
||||
us.SetAnnotations(annotations)
|
||||
|
||||
doc := map[string]interface{}{
|
||||
|
|
Loading…
Reference in New Issue