Skip to content

Commit

Permalink
Fix current-querynode-label backward compatity
Browse files Browse the repository at this point in the history
Signed-off-by: haorenfsa <[email protected]>
  • Loading branch information
haorenfsa committed Jul 26, 2024
1 parent 05736a5 commit 015c96c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apis/milvus.io/v1beta1/label_annotations.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ const (
// so instead we use milvus.io/service="true" to select the service pods
PodServiceLabelAddedAnnotation = MilvusIO + "pod-service-label-added"
// ServiceLabel is the label to indicate whether the pod is a service pod
ServiceLabel = MilvusIO + "service"
ServiceLabel = MilvusIO + "service"
OldAnnotationCurrentQueryNodeGroupID = MilvusIO + "current-querynode-group-id"
)

// +kubebuilder:object:generate=false
Expand Down
5 changes: 5 additions & 0 deletions apis/milvus.io/v1beta1/milvus_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,11 @@ func (r *Milvus) DefaultMeta() {
if r.IsFirstTimeStarting() {
r.Annotations[PodServiceLabelAddedAnnotation] = TrueStr
}
// backward compatibility
if r.Annotations[OldAnnotationCurrentQueryNodeGroupID] != "" {
Labels().SetCurrentGroupIDStr(r, QueryNodeName, r.Annotations[OldAnnotationCurrentQueryNodeGroupID])
r.Annotations[OldAnnotationCurrentQueryNodeGroupID] = ""
}
}

func (r *Milvus) DefaultMode() {
Expand Down

0 comments on commit 015c96c

Please sign in to comment.