Skip to content
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

Failed to update TFJob status in version v1 #1003

Closed
ScorpioCPH opened this issue May 22, 2019 · 6 comments
Closed

Failed to update TFJob status in version v1 #1003

ScorpioCPH opened this issue May 22, 2019 · 6 comments
Assignees
Labels

Comments

@ScorpioCPH
Copy link
Member

I'm trying v0.5.1, after all pods & services created, there is an error msg: error syncing tfjob: the server could not find the requested resource (put tfjobs.kubeflow.org tfjob-smoke-v1-1)

And this is coming from here:

// updateTFJobStatus updates the status of the given TFJob.
func (tc *TFController) updateTFJobStatus(tfjob *tfv1.TFJob) error {
    _, err := tc.tfJobClientSet.KubeflowV1().TFJobs(tfjob.Namespace).UpdateStatus(tfjob)
    return err
}

My CRD looks like this:

apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: tfjobs.kubeflow.org
spec:
  group: kubeflow.org
  scope: Namespaced
  versions:
  - name: v1
    served: true
    storage: true
  names:
    kind: TFJob
    singular: tfjob
    plural: tfjobs
  validation:
    openAPIV3Schema:
      properties:
        spec:
          properties:
            tfReplicaSpecs:
              properties:
                # The validation works when the configuration contains
                # `Worker`, `PS` or `Chief`. Otherwise it will not be validated.
                Worker:
                  properties:
                    replicas:
                      type: integer
                      minimum: 1
                PS:
                  properties:
                    replicas:
                      type: integer
                      minimum: 1
                Chief:
                  properties:
                    replicas:
                      type: integer
                      minimum: 1
                      maximum: 1
@issue-label-bot
Copy link

Issue-Label Bot is automatically applying the label kind/bug to this issue, with a confidence of 0.85. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@ScorpioCPH
Copy link
Member Author

/assign @richardsliu

@gaocegege
Copy link
Member

I can reproduce it. We define status as status subresource in client but we do not define it in CRD yaml.

@gaocegege
Copy link
Member

Fixed it with

apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: tfjobs.kubeflow.org
spec:
  group: kubeflow.org
  scope: Namespaced
  versions:
  - name: v1
    served: true
    storage: true
  names:
    kind: TFJob
    singular: tfjob
    plural: tfjobs
+ subresources:
+   status: {}
  validation:
    openAPIV3Schema:
      properties:
        spec:
          properties:
            tfReplicaSpecs:
              properties:
                # The validation works when the configuration contains
                # `Worker`, `PS` or `Chief`. Otherwise it will not be validated.
                Worker:
                  properties:
                    replicas:
                      type: integer
                      minimum: 1
                PS:
                  properties:
                    replicas:
                      type: integer
                      minimum: 1
                Chief:
                  properties:
                    replicas:
                      type: integer
                      minimum: 1
                      maximum: 1

@gaocegege
Copy link
Member

/close

@k8s-ci-robot
Copy link

@gaocegege: Closing this issue.

In response to this:

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants