Skip to content

Commit

Permalink
Fix the error of pvc name
Browse files Browse the repository at this point in the history
  • Loading branch information
hwchiu committed Jul 6, 2018
1 parent 70a953f commit 715758f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
2 changes: 1 addition & 1 deletion src/entity/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ func (m Volume) GetCollection() string {

//GenerateMetaName - Generate a metaname for kubernetes PVC object
func (m Volume) GenerateMetaName() string {
return "PVC-" + m.ID.Hex()
return "pvc-" + m.ID.Hex()
}
10 changes: 0 additions & 10 deletions src/server/handler_volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,6 @@ func createVolume(ctx *web.Context) {
})
defer session.Close()

// Check the storageClass is existed
couunt, err := session.Count(entity.StorageCollectionName, bson.M{"name": v.StorageName})
if err != nil {
response.InternalServerError(req.Request, resp.ResponseWriter, err)
return
} else if couunt < 1 {
response.BadRequest(req.Request, resp.ResponseWriter, fmt.Errorf("The reference storage provider %s doesn't exist", v.StorageName))
return
}

// Check whether this name has been used
v.ID = bson.NewObjectId()
v.CreatedAt = timeutils.Now()
Expand Down

0 comments on commit 715758f

Please sign in to comment.