Skip to content

Commit

Permalink
Fix: log output of getObjectXAttrHandler
Browse files Browse the repository at this point in the history
Signed-off-by: Mervin <[email protected]>
  • Loading branch information
mervinkid committed Mar 9, 2020
1 parent 69d2f5a commit a78ce3a
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 5 deletions.
1 change: 1 addition & 0 deletions docker/conf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ http {
upstream objectnodes {
server 192.168.0.41:80;
server 192.168.0.42:80;
server 192.168.0.43:80;
}

server {
Expand Down
6 changes: 6 additions & 0 deletions docker/conf/objectnode.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,11 @@
"enableHTTPS": "false",
"domains": [
"object.chubao.io"
],
"signatureIgnoredActions": [
"oss:action:GetObjectXAttr",
"oss:action:PutObjectXAttr",
"oss:action:DeleteObjectXAttr",
"oss:action:ListObjectXAttrs"
]
}
17 changes: 16 additions & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ services:
- datanode4
- objectnode1
- objectnode2
- objectnode3
- nginx
networks:
extnetwork:
Expand Down Expand Up @@ -279,6 +280,20 @@ services:
extnetwork:
ipv4_address: 192.168.0.42

objectnode3:
image: chubaofs/cfs-base:1.0
ports:
- "80"
volumes:
- ./bin:/cfs/bin
- ./conf/objectnode.json:/cfs/conf/objectnode.json
- ./script/start_objectnode.sh:/cfs/script/start.sh
command: /bin/sh /cfs/script/start.sh
restart: on-failure
privileged: true
networks:
extnetwork:
ipv4_address: 192.168.0.43

client:
image: chubaofs/cfs-base:1.0
Expand Down Expand Up @@ -347,7 +362,7 @@ services:
privileged: true
networks:
extnetwork:
ipv4_address: 192.168.0.100
ipv4_address: 192.168.0.300

build:
image: chubaofs/cfs-base:1.0
Expand Down
4 changes: 2 additions & 2 deletions objectnode/api_handler_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -920,11 +920,11 @@ func (o *ObjectNode) putObjectXAttrHandler(w http.ResponseWriter, r *http.Reques
}

// Get object extend attribute (xattr)
func (o *ObjectNode) getObjectXAttr(w http.ResponseWriter, r *http.Request) {
func (o *ObjectNode) getObjectXAttrHandler(w http.ResponseWriter, r *http.Request) {
var err error
var param *RequestParam
if param, err = o.parseRequestParam(r); err != nil {
log.LogWarnf("deleteObjectXAttrHandler: parse request param fail: requestID(%v) err(%v)", GetRequestID(r), err)
log.LogWarnf("getObjectXAttr: parse request param fail: requestID(%v) err(%v)", GetRequestID(r), err)
_ = InvalidArgument.ServeResponse(w, r)
return
}
Expand Down
2 changes: 1 addition & 1 deletion objectnode/policy_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const (
AbortMultipartUploadAction Action = OSSActionPrefix + "AbortMultipartUpload"
GetBucketLocationAction Action = OSSActionPrefix + "GetBucketLocation"
GetObjectXAttrAction Action = OSSActionPrefix + "GetObjectXAttr"
PutObjectXAttrAction Action = OSSActionPrefix + "PutObjectAttr"
PutObjectXAttrAction Action = OSSActionPrefix + "PutObjectXAttr"
ListObjectXAttrsAction Action = OSSActionPrefix + "ListObjectXAttrs"
DeleteObjectXAttrAction Action = OSSActionPrefix + "DeleteObjectXAttr"
GetObjectTaggingAction Action = OSSActionPrefix + "GetObjectTagging"
Expand Down
2 changes: 1 addition & 1 deletion objectnode/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (o *ObjectNode) registerApiRouters(router *mux.Router) {
Methods(http.MethodGet).
Path("/{object:.+}").
Queries("xattr", "", "key", "{key:.+}").
HandlerFunc(o.getObjectXAttr)
HandlerFunc(o.getObjectXAttrHandler)

// List object XAttrs
r.NewRoute().Name(ListObjectXAttrsAction.UniqueRouteName()).
Expand Down

0 comments on commit a78ce3a

Please sign in to comment.