Skip to content

Commit

Permalink
updated linter_config.json
Browse files Browse the repository at this point in the history
  • Loading branch information
kayush2O6 committed Mar 21, 2018
1 parent 015e90b commit a40dd6a
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 14 deletions.
5 changes: 4 additions & 1 deletion linter_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
"comment or be unexported",
"comment on exported",
"pkg/apis/tensorflow/v1alpha1/zz_generated.deepcopy.go",
"pkg/apis/tensorflow/v1alpha1/zz_generated.defaults.go"
"pkg/apis/tensorflow/v1alpha1/zz_generated.defaults.go",
"pkg/apis/tensorflow/v1alpha1/defaults.go",
"pkg/apis/tensorflow/v1alpha1/defaults_test.go",
"pkg/apis/tensorflow/validation/validation_test.go"
],
"Deadline": "300s",
"Skip": ["pkg/client"]
Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/tensorflow/v1alpha1/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ func addDefaultingFuncs(scheme *runtime.Scheme) error {
return RegisterDefaults(scheme)
}

// SetDefaultsTFJob initializes any uninitialized values to default values
func SetDefaultsTFJob(obj *TFJob) {
// SetDefaults_TFJob initializes any uninitialized values to default values
func SetDefaults_TFJob(obj *TFJob) {
c := &obj.Spec

if c.TFImage == "" {
Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/tensorflow/v1alpha1/defaults_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"k8s.io/api/core/v1"
)

func TestSetDefaultsTFJob(t *testing.T) {
func TestSetDefaults_TFJob(t *testing.T) {
type testCase struct {
in *TFJob
expected *TFJob
Expand Down Expand Up @@ -110,7 +110,7 @@ func TestSetDefaultsTFJob(t *testing.T) {
}

for _, c := range testCases {
SetDefaultsTFJob(c.in)
SetDefaults_TFJob(c.in)
if !reflect.DeepEqual(c.in, c.expected) {
t.Errorf("Want\n%v; Got\n %v", util.Pformat(c.expected), util.Pformat(c.in))
}
Expand Down
16 changes: 8 additions & 8 deletions pkg/apis/tensorflow/v1alpha1/zz_generated.defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,20 @@ import (
// Public to allow building arbitrary schemes.
// All generated defaulters are covering - they call all nested defaulters.
func RegisterDefaults(scheme *runtime.Scheme) error {
scheme.AddTypeDefaultingFunc(&TFJob{}, func(obj interface{}) { SetObjectDefaultsTFJob(obj.(*TFJob)) })
scheme.AddTypeDefaultingFunc(&TFJobList{}, func(obj interface{}) { SetObjectDefaultsTFJobList(obj.(*TFJobList)) })
scheme.AddTypeDefaultingFunc(&TFJob{}, func(obj interface{}) { SetObjectDefaults_TFJob(obj.(*TFJob)) })
scheme.AddTypeDefaultingFunc(&TFJobList{}, func(obj interface{}) { SetObjectDefaults_TFJobList(obj.(*TFJobList)) })
return nil
}

// SetObjectDefaultsTFJob creates SetDefaultsTFJob object for a given TFJob
func SetObjectDefaultsTFJob(in *TFJob) {
SetDefaultsTFJob(in)
// SetObjectDefaults_TFJob creates SetDefaultsTFJob object for a given TFJob
func SetObjectDefaults_TFJob(in *TFJob) {
SetDefaults_TFJob(in)
}

// SetObjectDefaultsTFJobList creates SetDefaultsTFJob object for each TFJob from given list of TFJobs
func SetObjectDefaultsTFJobList(in *TFJobList) {
// SetObjectDefaults_TFJobList creates SetDefaultsTFJob object for each TFJob from given list of TFJobs
func SetObjectDefaults_TFJobList(in *TFJobList) {
for i := range in.Items {
a := &in.Items[i]
SetObjectDefaultsTFJob(a)
SetObjectDefaults_TFJob(a)
}
}
2 changes: 1 addition & 1 deletion pkg/apis/tensorflow/validation/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func TestValidate(t *testing.T) {
job := &tfv1.TFJob{
Spec: *c.in,
}
tfv1.SetObjectDefaultsTFJob(job)
tfv1.SetObjectDefaults_TFJob(job)
if err := ValidateTFJobSpec(&job.Spec); (err != nil) != c.expectingError {
t.Errorf("unexpected validation result: %v", err)
}
Expand Down

0 comments on commit a40dd6a

Please sign in to comment.