-
Notifications
You must be signed in to change notification settings - Fork 82
Conversation
|
Can one of the admins verify this patch? |
|
This patch is dependent on pr: #1357 This pr can be merged only after merging the original PR |
| } | ||
|
|
||
| // GlusterBlock implements block Provider interface. It represents a gluster-block | ||
| type GlusterBlock struct { |
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.
can we have a different name for loop back provider
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.
Done
| mounts map[string]string | ||
| } | ||
|
|
||
| func newGlusterBlock() (blockprovider.Provider, error) { |
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.
same here
| } | ||
|
|
||
| blockFileName := hostDir + "/" + name | ||
| cmd := exec.Command("truncate", fmt.Sprintf("-s %d", size), blockFileName) //nolint: gosec |
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.
check if we need to add some % (or a fixed value) to this size, so we give space for mkfs.xfs ?
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.
Ahh right ok
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.
Use utils.ExecuteCommandRun for including stderr info in error (pkg/utils)
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.
this is pending
|
|
||
| // BlockVolume implements blockprovider.BlockVolume interface. | ||
| // It holds information about a gluster-block volume | ||
| type BlockVolume struct { |
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.
i think we don't need all fields in this struct
| } | ||
|
|
||
| // HostAddresses returns host addresses of a gluster block vol | ||
| func (gv *BlockVolume) HostAddresses() []string { return gv.hosts } |
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.
this functions are also not needed
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.
Then it would complain that the interface methods are not implemented? How else to do this?
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.
then IMO this will create an issue if we add different input structures for different provisioners, isn't 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.
Yes, So we should have kept the structures different for each provider? The structure is union of all the fields of each provider. And the caller ends up calling these functions anyways as the req structure of block vol has these fields. How to go about this?
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.
I think we need to refactor the code to achieve this.
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.
Required for this patch?
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 can skip this cleanup, please create an issue to do the cleanup. so that we won't miss 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.
@Madhu-1 we can take this task to define a better interface for BlockVolume to support all block providers in some other patch, for now this should be good to go.
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.
@Madhu-1 sure I'll do that
| } | ||
| defer clusterLocks.UnLock(context.Background()) | ||
|
|
||
| volInfo, err := volume.GetVolume(hostVolume) |
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.
#1357 (comment) fixing this helps to reduce duplicate code here.
53dcdcd to
bd94f7a
Compare
|
Fixes #1476 |
aravindavk
left a comment
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. one minor comment.
| return nil, fmt.Errorf("failed to truncate block file %s: %+v", blockFileName, err) | ||
| } | ||
|
|
||
| cmd = exec.Command("mkfs.xfs", "-f", blockFileName) //nolint: gosec |
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.
Use utils.ExecuteCommandRun for including stderr info in error
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.
same here
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.
Done
| } | ||
|
|
||
| blockFileName := hostDir + "/" + name | ||
| cmd := exec.Command("truncate", fmt.Sprintf("-s %d", size), blockFileName) //nolint: gosec |
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.
Use utils.ExecuteCommandRun for including stderr info in error (pkg/utils)
bd94f7a to
41e2011
Compare
|
|
||
| log "github.com/sirupsen/logrus" | ||
| config "github.com/spf13/viper" | ||
| "k8s.io/kubernetes/pkg/util/mount" |
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.
@poornimag do we have Gopkg.toml changes for this one?
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.
if you are updating the dependencies using dep ensure, Please make sure version of dep to be v0.5.0
|
add to whitelist |
|
@poornimag CI failure |
plugins/blockvolume/blockprovider/gluster-loopback/glusterloopback.go
Outdated
Show resolved
Hide resolved
314d966 to
bed1c19
Compare
Signed-off-by: Poornima G <pgurusid@redhat.com>
Signed-off-by: Poornima G <pgurusid@redhat.com>
bed1c19 to
d3131b0
Compare
|
retest this please |
Madhu-1
left a comment
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
Signed-off-by: Poornima G pgurusid@redhat.com