mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-06 13:26:26 +00:00
Add maintenance job and data mover pod's labels and annotations setting.
Add wait in file_system_test's async test cases. Add related documents. Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
This commit is contained in:
@@ -83,6 +83,8 @@ type DataUploadReconciler struct {
|
||||
metrics *metrics.ServerMetrics
|
||||
cancelledDataUpload map[string]time.Time
|
||||
dataMovePriorityClass string
|
||||
podLabels map[string]string
|
||||
podAnnotations map[string]string
|
||||
}
|
||||
|
||||
func NewDataUploadReconciler(
|
||||
@@ -101,6 +103,8 @@ func NewDataUploadReconciler(
|
||||
log logrus.FieldLogger,
|
||||
metrics *metrics.ServerMetrics,
|
||||
dataMovePriorityClass string,
|
||||
podLabels map[string]string,
|
||||
podAnnotations map[string]string,
|
||||
) *DataUploadReconciler {
|
||||
return &DataUploadReconciler{
|
||||
client: client,
|
||||
@@ -126,6 +130,8 @@ func NewDataUploadReconciler(
|
||||
metrics: metrics,
|
||||
cancelledDataUpload: make(map[string]time.Time),
|
||||
dataMovePriorityClass: dataMovePriorityClass,
|
||||
podLabels: podLabels,
|
||||
podAnnotations: podAnnotations,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -936,25 +942,37 @@ func (r *DataUploadReconciler) setupExposeParam(du *velerov2alpha1api.DataUpload
|
||||
}
|
||||
|
||||
hostingPodLabels := map[string]string{velerov1api.DataUploadLabel: du.Name}
|
||||
for _, k := range util.ThirdPartyLabels {
|
||||
if v, err := nodeagent.GetLabelValue(context.Background(), r.kubeClient, du.Namespace, k, nodeOS); err != nil {
|
||||
if err != nodeagent.ErrNodeAgentLabelNotFound {
|
||||
log.WithError(err).Warnf("Failed to check node-agent label, skip adding host pod label %s", k)
|
||||
}
|
||||
} else {
|
||||
if len(r.podLabels) > 0 {
|
||||
for k, v := range r.podLabels {
|
||||
hostingPodLabels[k] = v
|
||||
}
|
||||
} else {
|
||||
for _, k := range util.ThirdPartyLabels {
|
||||
if v, err := nodeagent.GetLabelValue(context.Background(), r.kubeClient, du.Namespace, k, nodeOS); err != nil {
|
||||
if err != nodeagent.ErrNodeAgentLabelNotFound {
|
||||
log.WithError(err).Warnf("Failed to check node-agent label, skip adding host pod label %s", k)
|
||||
}
|
||||
} else {
|
||||
hostingPodLabels[k] = v
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
hostingPodAnnotation := map[string]string{}
|
||||
for _, k := range util.ThirdPartyAnnotations {
|
||||
if v, err := nodeagent.GetAnnotationValue(context.Background(), r.kubeClient, du.Namespace, k, nodeOS); err != nil {
|
||||
if err != nodeagent.ErrNodeAgentAnnotationNotFound {
|
||||
log.WithError(err).Warnf("Failed to check node-agent annotation, skip adding host pod annotation %s", k)
|
||||
}
|
||||
} else {
|
||||
if len(r.podAnnotations) > 0 {
|
||||
for k, v := range r.podAnnotations {
|
||||
hostingPodAnnotation[k] = v
|
||||
}
|
||||
} else {
|
||||
for _, k := range util.ThirdPartyAnnotations {
|
||||
if v, err := nodeagent.GetAnnotationValue(context.Background(), r.kubeClient, du.Namespace, k, nodeOS); err != nil {
|
||||
if err != nodeagent.ErrNodeAgentAnnotationNotFound {
|
||||
log.WithError(err).Warnf("Failed to check node-agent annotation, skip adding host pod annotation %s", k)
|
||||
}
|
||||
} else {
|
||||
hostingPodAnnotation[k] = v
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
hostingPodTolerations := []corev1api.Toleration{}
|
||||
|
||||
Reference in New Issue
Block a user