Send Kubernetes labels to the backend
@@ -22,6 +22,7 @@ import (
"math"
"path"
"strconv"
+ "strings"
redskyv1beta1 "github.com/redskyops/redskyops-controller/api/v1beta1"
"github.com/redskyops/redskyops-controller/internal/experiment"
@@ -46,6 +47,11 @@ func FromCluster(in *redskyv1beta1.Experiment) (redskyapi.ExperimentName, *redsk
out.ExperimentMeta.SelfURL = in.Annotations[redskyv1beta1.AnnotationExperimentURL]
out.ExperimentMeta.NextTrialURL = in.Annotations[redskyv1beta1.AnnotationNextTrialURL]
+ out.Labels = make(map[string]string, len(in.ObjectMeta.Labels))
+ for k, v := range in.ObjectMeta.Labels {
+ out.Labels[strings.TrimPrefix(k, "redskyops.dev/")] = v
+ }
+
out.Optimization = nil
for _, o := range in.Spec.Optimization {
out.Optimization = append(out.Optimization, redskyapi.Optimization{
