-
Notifications
You must be signed in to change notification settings - Fork 37
Conversation
handlers/secrets.go
Outdated
} | ||
} | ||
|
||
return nil, fmt.Errorf("not found secret with name: %s", name), http.StatusNotFound | ||
return nil, http.StatusNotFound, fmt.Errorf("not found secret with name: %s", name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unable to find secret with name: %s
handlers/secrets.go
Outdated
@@ -51,7 +51,8 @@ func MakeSecretsHandler(c client.SecretAPIClient) http.HandlerFunc { | |||
responseStatus, responseBody, responseErr = createNewSecret(c, body) | |||
break | |||
case http.MethodPut: | |||
responseStatus, responseBody, responseErr = updateSecret(c, body) | |||
responseStatus = http.StatusMethodNotAllowed | |||
responseErr = fmt.Errorf("docker swarm secrets are immutable") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
faas-swarm is unable to update secrets, delete and re-create or use a new name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please could you add a unit test for this scenario if we don't have one yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already had unit test for this scenario, I have updated it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I'm requesting a couple of changes. Please ping me when done or if you have Qs.
This commit updates secrets handler for PUT method. It returns 405 "Method Not Allowed" for PUT method becuase secrets in docker swarm are immutable. Fixes: openfaas#65 Signed-off-by: Vivek Singh <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This commit updates secrets handler for PUT method. It returns 405
"Method Not Allowed" for PUT method becuase secrets in docker swarm are
immutable.
Fixes: #65
Signed-off-by: Vivek Singh [email protected]
Description
Motivation and Context
#65
How Has This Been Tested?
I have tested this on Docker For Mac with Docker Swarm. For testing use
viveksyngh/faas-swarm:latest-dev
docker image.Types of changes
Checklist:
git commit -s