Fix function delete with uid (#142)

If no uid is provided, all versions of function files and function metadata will be deleted.  If a uid is provided, only that specific version is deleted, and the "latest" version of the function moves back to the previous one.

Fixes #152
This commit is contained in:
yang qf
2017-03-12 13:04:56 -07:00
committed by Soam Vasani
parent 365eabb027
commit a6869ab746
3 changed files with 76 additions and 2 deletions
+1 -1
View File
@@ -139,7 +139,7 @@ func (rs *ResourceStore) delete(typename, rkey string) error {
// getAll finds all entries under key. If none or found or key
// doesn't exist, returns an empty slice.
func (rs *ResourceStore) getAll(key string) ([]string, error) {
resp, err := rs.KeysAPI.Get(context.Background(), key, &client.GetOptions{Recursive: true})
resp, err := rs.KeysAPI.Get(context.Background(), key, &client.GetOptions{Recursive: true, Sort: true})
if err != nil {
if client.IsKeyNotFound(err) {
return []string{}, nil