Skip to content

Commit

Permalink
lifecycle management of a trainingJob
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengqi519 committed Mar 6, 2018
1 parent 2a6aa52 commit 189e26f
Show file tree
Hide file tree
Showing 2 changed files with 429 additions and 6 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 189e26f

Please sign in to comment.