Skip to content

Improve documentation of use of resourceVersion for update preconditions #2115

Closed
@erictune

Description

POST /api/v1beta1/replicationControllers
        {
          "kind": "ReplicationController",
          "apiVersion": "v1beta1",
          "id": "a",
          "desiredState": {
            "replicas": 2,
            "replicaSelector": {"name": "a"},
            "podTemplate": {
              "desiredState": {
                 "manifest": {
                   "version": "v1beta1",
                   "id": "a",
                   "containers": [{
                     "name": "foo",
                     "image": "bar/foo",
                   }]
                 }
               },
               "labels": {"name": "a"}
              }},
          "labels": {"name": "a"}
        }

That works (200)

Then, PUT the exact same body to the created URL, and get a 409 Conflict.

PUT /api/v1beta1/replicationControllers/a
        {
          "kind": "ReplicationController",
          "apiVersion": "v1beta1",
          "id": "a",
          "desiredState": {
            "replicas": 2,
            "replicaSelector": {"name": "a"},
            "podTemplate": {
              "desiredState": {
                 "manifest": {
                   "version": "v1beta1",
                   "id": "a",
                   "containers": [{
                     "name": "foo",
                     "image": "bar/foo",
                   }]
                 }
               },
               "labels": {"name": "a"}
              }},
          "labels": {"name": "a"}
        }

Shouldn't you be able to update the same object with the same body as you created it with?

Maybe the problem is that there are some server-added fields that I should GET before PUTting back, but then why does this return 409 while you get a 422 for doing the same thing with /services?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/apiIndicates an issue on api area.kind/documentationCategorizes issue or PR as related to documentation.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions