Skip to content

package bind should support updating a binding #466

@alexkli

Description

@alexkli

Problem

Currently, wsk package bind can only create bindings, but not update them. Because it always sets overwrite=false.

Proposal

Would be nice to have either

  • new update command such as wsk package bind-update
  • always have wsk package bind set ovewrite=true

Motivation

Updating a package binding in one go is a useful feature to do e.g. "stack flips" with openwhisk, switching to a new code version deployed in a different package.

Details

I haven't found another way to update a package with wsk. Updating the binding works with the openwhisk HTTP API when setting overwrite=true:

https://openwhisk-service.com/api/v1/namespaces/<ns>/packages/<pkg>?overwrite=true

Example curl to update that <package> binds to <target-package:

curl -H "Authorization: Basic <auth>" -H "Content-Type: application/json" \
    -d '{"binding":{"namespace":"<target-namespace>","name":"<target-package>"}}' \
    https://<apihost>/api/v1/namespaces/<namespace>/packages/<package>?overwrite=true

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions