Skip to content

Commit

Permalink
Merge pull request #16 from qizheng09/migrate_lifecycle_management
Browse files Browse the repository at this point in the history
migrate lifecycle management of a trainingJob
  • Loading branch information
typhoonzero committed Mar 20, 2018
2 parents 760373e + fe7e119 commit 7b540c1
Show file tree
Hide file tree
Showing 2 changed files with 497 additions and 0 deletions.
18 changes: 18 additions & 0 deletions pkg/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 7b540c1

Please sign in to comment.