-
Notifications
You must be signed in to change notification settings - Fork 680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: ensure that tfjob crd exists. #820
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
|
I signed it! |
CLAs look good, thanks! |
Travis tests have failedHey @Muzry, 3rd Buildgometalinter --config=linter_config.json --vendor ./...
|
Thanks for your contribution! Please fix the linting issues in Travis CI https://travis-ci.org/kubeflow/tf-operator/jobs/424162654#L504:
|
/assign @johnugeorge @gaocegege |
/ok-to-test |
cmd/tf-operator.v2/app/server.go
Outdated
@@ -38,10 +38,12 @@ import ( | |||
controller "github.com/kubeflow/tf-operator/pkg/controller.v2/tensorflow" | |||
"github.com/kubeflow/tf-operator/pkg/util/signals" | |||
"github.com/kubeflow/tf-operator/pkg/version" | |||
crdclient "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please put the dep after https://github.com/kubeflow/tf-operator/pull/820/files#diff-4c0b4e5eb33fd600a68479ae73e49d8aL31
cmd/tf-operator.v2/app/server.go
Outdated
) | ||
|
||
const ( | ||
apiVersion = "v1alpha2" | ||
TFCRD = "tfjobs.kubeflow.org" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we'd better define the field here: https://github.com/kubeflow/tf-operator/blob/master/pkg/apis/tensorflow/v1alpha2/register.go
cmd/tf-operator.v2/app/server.go
Outdated
@@ -159,6 +161,23 @@ func Run(opt *options.ServerOption) error { | |||
} | |||
|
|||
func createClientSets(config *restclientset.Config) (kubeclientset.Interface, kubeclientset.Interface, tfjobclientset.Interface, error) { | |||
|
|||
crdClient,err := crdclient.NewForConfig(config) | |||
crdList, err := crdClient.ApiextensionsV1beta1().CustomResourceDefinitions().List(metav1.ListOptions{}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am wondering why we use list here. Could we follow the implementation as coreos/etcd-operator does https://github.com/coreos/etcd-operator/blob/c8f63d508266990a4d20718d94363c30e75e6282/pkg/util/k8sutil/crd.go#L79 ?
/retest |
Travis tests have failedHey @Muzry, 1st Buildgometalinter --config=linter_config.json --vendor ./...
3rd Buildgometalinter --config=linter_config.json --vendor ./...
|
Travis tests have failedHey @Muzry, 3rd Buildgometalinter --config=linter_config.json --vendor ./...
|
@Muzry Planning to get this in 0.3 release? |
Travis tests have failedHey @Muzry, 2nd Buildgometalinter --config=linter_config.json --vendor ./...
goveralls -service=travis-ci -v -package ./pkg/... -ignore "pkg/client/*/*.go,pkg/client/*/*/*.go,pkg/client/*/*/*/*.go,pkg/client/*/*/*/*/*.go,pkg/client/*/*/*/*/*/*.go,pkg/client/*/*/*/*/*/*/*.go,pkg/util/testutil/*.go,pkg/apis/tensorflow/*/zz_generated.*.go,pkg/apis/tensorflow/*/*_generated.go"
3rd Buildgometalinter --config=linter_config.json --vendor ./...
goveralls -service=travis-ci -v -package ./pkg/... -ignore "pkg/client/*/*.go,pkg/client/*/*/*.go,pkg/client/*/*/*/*.go,pkg/client/*/*/*/*/*.go,pkg/client/*/*/*/*/*/*.go,pkg/client/*/*/*/*/*/*/*.go,pkg/util/testutil/*.go,pkg/apis/tensorflow/*/zz_generated.*.go,pkg/apis/tensorflow/*/*_generated.go"
TravisBuddy Request Identifier: 3bc26510-cc6c-11e8-9706-8d7bf71fb7b5 |
5873dfe
to
8550dc4
Compare
Travis tests have failedHey @Muzry, 2nd Buildgometalinter --config=linter_config.json --vendor ./...
goveralls -service=travis-ci -v -package ./pkg/... -ignore "pkg/client/*/*.go,pkg/client/*/*/*.go,pkg/client/*/*/*/*.go,pkg/client/*/*/*/*/*.go,pkg/client/*/*/*/*/*/*.go,pkg/client/*/*/*/*/*/*/*.go,pkg/util/testutil/*.go,pkg/apis/tensorflow/*/zz_generated.*.go,pkg/apis/tensorflow/*/*_generated.go"
3rd Buildgometalinter --config=linter_config.json --vendor ./...
goveralls -service=travis-ci -v -package ./pkg/... -ignore "pkg/client/*/*.go,pkg/client/*/*/*.go,pkg/client/*/*/*/*.go,pkg/client/*/*/*/*/*.go,pkg/client/*/*/*/*/*/*.go,pkg/client/*/*/*/*/*/*/*.go,pkg/util/testutil/*.go,pkg/apis/tensorflow/*/zz_generated.*.go,pkg/apis/tensorflow/*/*_generated.go"
TravisBuddy Request Identifier: cc297580-cc71-11e8-9706-8d7bf71fb7b5 |
Travis tests have failedHey @Muzry, 2nd Buildgometalinter --config=linter_config.json --vendor ./...
goveralls -service=travis-ci -v -package ./pkg/... -ignore "pkg/client/*/*.go,pkg/client/*/*/*.go,pkg/client/*/*/*/*.go,pkg/client/*/*/*/*/*.go,pkg/client/*/*/*/*/*/*.go,pkg/client/*/*/*/*/*/*/*.go,pkg/util/testutil/*.go,pkg/apis/tensorflow/*/zz_generated.*.go,pkg/apis/tensorflow/*/*_generated.go"
3rd Buildgometalinter --config=linter_config.json --vendor ./...
goveralls -service=travis-ci -v -package ./pkg/... -ignore "pkg/client/*/*.go,pkg/client/*/*/*.go,pkg/client/*/*/*/*.go,pkg/client/*/*/*/*/*.go,pkg/client/*/*/*/*/*/*.go,pkg/client/*/*/*/*/*/*/*.go,pkg/util/testutil/*.go,pkg/apis/tensorflow/*/zz_generated.*.go,pkg/apis/tensorflow/*/*_generated.go"
TravisBuddy Request Identifier: 62a4b6a0-cc72-11e8-9706-8d7bf71fb7b5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally LGTM with some nits
@@ -39,6 +39,7 @@ const ( | |||
Plural = "tfjobs" | |||
// Singular is the singular for TFJob. | |||
Singular = "tfjob" | |||
TFCRD = "tfjobs.kubeflow.org" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the comment for the field.
/cc @johnugeorge |
This comment has been minimized.
This comment has been minimized.
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gaocegege The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
#710
This pr ensure that tfjob crd exists, if not tf-operator will exit.
This change is