func annotationsFor(ei *mesos.ExecutorInfo) (annotations map[string]string, err error) { annotations = map[string]string{} if ei == nil { return } var buf bytes.Buffer if err = executorinfo.EncodeResources(&buf, ei.GetResources()); err != nil { return } annotations[meta.ExecutorIdKey] = ei.GetExecutorId().GetValue() annotations[meta.ExecutorResourcesKey] = buf.String() return }