Skip to content

Commit

Permalink
add Create(), Delete() in TfJobClient interface, rename tpr_util.go t…
Browse files Browse the repository at this point in the history
…o tf_job_client.go (#152)

Add routines to make the go client more complete.

Rename a poorly named file.
  • Loading branch information
moon03432 authored and jlewi committed Nov 16, 2017
1 parent 397ef28 commit db5c875
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 8 additions & 0 deletions pkg/util/k8sutil/fake/fake.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ func (c *TfJobClientFake) Get(ns string, name string) (*spec.TfJob, error) {
return &spec.TfJob{}, nil
}

func (c *TfJobClientFake) Create(ns string, j *spec.TfJob) (*spec.TfJob, error) {
return &spec.TfJob{}, nil
}

func (c *TfJobClientFake) Delete(ns string, name string) error {
return nil
}

func (c *TfJobClientFake) List(ns string) (*spec.TfJobList, error) {
return &spec.TfJobList{}, nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

package k8sutil

// TODO(jlewi): We should rename this file to reflect the fact that we are using CRDs and not TPRs.

import (
"encoding/json"
"fmt"
Expand All @@ -34,6 +32,12 @@ type TfJobClient interface {
// Get returns a TfJob
Get(ns string, name string) (*spec.TfJob, error)

// Create a TfJob
Create(ns string, j *spec.TfJob) (*spec.TfJob, error)

// Delete a TfJob
Delete(ns string, name string) error

// List returns a list of TfJobs
List(ns string) (*spec.TfJobList, error)

Expand Down

0 comments on commit db5c875

Please sign in to comment.