openwhisk-cli
openwhisk-cli copied to clipboard
CLI always resets actions to default kind
If you don't specify the --kind on every command, then the CLI will reset back to the default:
$ wsk action list
actions
/19FT_dev/ping private swift:3
$ wsk action update ping ping.swift --kind swift:3.1.1
ok: updated action ping
$ wsk action list
actions
/19FT_dev/ping private swift:3.1.1
$ wsk action update ping ping.swift
ok: updated action ping
$ wsk action list
actions
/19FT_dev/ping private swift:3
I expect that once I've set a kind, then that action will always stay on that kind.
@csantanapr, I think the above is because swift:3 is the default still.
this is bad, on wsk update if the action already exist it should not change the kind by sending kind:default
It would also be nice not to have to fetch the action to update it. The way the request schema is today the kind and code are part of the request. We could use a sentinel type for kind in this case, or do client side merge, or get rid of default although that doesn’t fix the problem.
Should the whisk API offer http HEAD that will allow a quick check to see if resource exist?
:+1: on moving the responsibility for merging to the API rather than the client. Does this also affect annotations and parameters?
There's probably not a clean solution as we're using the same HTTP verb to handle two operations.
What about a "merge" query parameter (that defaults to false for backwards compatibility) that if the action exists will merge, rather than replace, the action definition? This is similar in semantics to the UPSERT SQL command in Postgres.