Skip to content

Commit

Permalink
fix token marshalling error
Browse files Browse the repository at this point in the history
  • Loading branch information
bnsblue committed Mar 5, 2020
1 parent 2214fb0 commit b948051
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func (r *RedisResourceManager) AllocateResource(ctx context.Context, namespace p
return pluginCore.AllocationUndefined, err
}
// Check to see if the allocation token is already in the set
found, err := r.client.SIsMember(string(namespace), allocationToken)
found, err := r.client.SIsMember(string(namespace), string(allocationToken))
if err != nil {
logger.Errorf(ctx, "Error getting size of Redis set %v", err)
return pluginCore.AllocationUndefined, err
Expand Down Expand Up @@ -259,7 +259,7 @@ func (r *RedisResourceManager) AllocateResource(ctx context.Context, namespace p
return pluginCore.AllocationStatusExhausted, nil
}

countAdded, err := r.client.SAdd(string(namespace), allocationToken)
countAdded, err := r.client.SAdd(string(namespace), string(allocationToken))
if err != nil {
logger.Errorf(ctx, "Error adding token [%s:%s] %v", namespace, allocationToken, err)
return pluginCore.AllocationUndefined, err
Expand All @@ -272,7 +272,7 @@ func (r *RedisResourceManager) AllocateResource(ctx context.Context, namespace p
}

func (r *RedisResourceManager) ReleaseResource(ctx context.Context, namespace pluginCore.ResourceNamespace, allocationToken Token) error {
countRemoved, err := r.client.SRem(string(namespace), allocationToken)
countRemoved, err := r.client.SRem(string(namespace), string(allocationToken))
if err != nil {
logger.Errorf(ctx, "Error removing token [%v:%s] %v", namespace, allocationToken, err)
return err
Expand Down

0 comments on commit b948051

Please sign in to comment.