Skip to content

Commit

Permalink
Merge pull request #634 from qizheng09/lifecycle_managerment
Browse files Browse the repository at this point in the history
lifecycle management of a trainingJob
  • Loading branch information
qizheng09 authored Mar 15, 2018
2 parents edcbf54 + c383a32 commit fdd97ba
Show file tree
Hide file tree
Showing 2 changed files with 429 additions and 14 deletions.
18 changes: 18 additions & 0 deletions go/updater/labels.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package updater

import (
"fmt"
"strings"
)

// Labels represents labels of k8s resources
type Labels map[string]string

// LabelsParser parse labels to selector
func (l Labels) LabelsParser() (string, error) {
pieces := make([]string, 0, len(l))
for k, v := range l {
pieces = append(pieces, fmt.Sprintf("%v=%v", k, v))
}
return strings.Join(pieces, ","), nil
}
Loading

0 comments on commit fdd97ba

Please sign in to comment.