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

Error raised when trying to update a minimal service #1537

Closed
WTFKr0 opened this issue Dec 28, 2017 · 0 comments
Closed

Error raised when trying to update a minimal service #1537

WTFKr0 opened this issue Dec 28, 2017 · 0 comments
Labels
Milestone

Comments

@WTFKr0
Copy link
Contributor

WTFKr0 commented Dec 28, 2017

Description

When we create a service with minimal option by portainer api, we can't edit it by interface.
We got a js error :

Cannot read property 'Mode' of undefined

Steps to reproduce

  • Create minimal service by api (name + image) :
curl -s -X POST <portainer_api>/endpoints/<endpoint_id>/docker/services/create' -H 'Accept: application/json' -H 'Authorization: Bearer <token>' -d '{"Name":"my_service","TaskTemplate":{"ContainerSpec":{"Image":"nginx:alpine"}}}'
  • Try editing it by interface :
    Scale the service from portainer interface from 1 to 2

More info

For info the json of the service

{
    "CreatedAt": "2017-12-28T08:07:59.017847182Z",
    "Endpoint": {
        "Spec": {}
    },
    "ID": "930xg1kpzyy7utnczje8qvjyg",
    "Spec": {
        "Labels": {},
        "Mode": {
            "Replicated": {
                "Replicas": 1
            }
        },
        "Name": "my_service",
        "TaskTemplate": {
            "ContainerSpec": {
                "Image": "nginx:alpine"
            },
            "ForceUpdate": 0,
            "Runtime": "container"
        }
    },
    "UpdatedAt": "2017-12-28T08:07:59.017847182Z",
    "Version": {
        "Index": 10227
    }
}

What happen

Seems that the service object in updateService funtion is undefined

@deviantony deviantony changed the title bug(service) - Error editing a minimal service Error raised when trying to edit a minimal service Jan 5, 2018
@deviantony deviantony changed the title Error raised when trying to edit a minimal service Error raised when trying to update a minimal service Jan 5, 2018
@deviantony deviantony added this to the 1.15.x milestone Jan 5, 2018
@deviantony deviantony modified the milestones: 1.15.x, 1.16.0 Jan 21, 2018
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

2 participants