Skip to content

Add --enable-list-snapshots command-line option #597

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmd/hostpathplugin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ func main() {
flag.Var(&cfg.AcceptedMutableParameterNames, "accepted-mutable-parameter-names", "Comma separated list of parameter names that can be modified on a persistent volume. This is only used when enable-controller-modify-volume is true. If unset, all parameters are mutable.")
flag.BoolVar(&cfg.DisableControllerExpansion, "disable-controller-expansion", false, "Disables Controller volume expansion capability.")
flag.BoolVar(&cfg.DisableNodeExpansion, "disable-node-expansion", false, "Disables Node volume expansion capability.")
flag.BoolVar(&cfg.EnableListSnapshots, "enable-list-snapshots", true, "Enables ControllerServiceCapability_RPC_LIST_SNAPSHOTS capability. Defaults to true.")
flag.Int64Var(&cfg.MaxVolumeExpansionSizeNode, "max-volume-size-node", 0, "Maximum allowed size of volume when expanded on the node. Defaults to same size as max-volume-size.")

flag.Int64Var(&cfg.AttachLimit, "attach-limit", 0, "Maximum number of attachable volumes on a node. Zero refers to no limit.")
Expand Down
4 changes: 3 additions & 1 deletion pkg/hostpath/controllerserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,6 @@ func (hp *hostPath) getControllerServiceCapabilities() []*csi.ControllerServiceC
csi.ControllerServiceCapability_RPC_GET_VOLUME,
csi.ControllerServiceCapability_RPC_GET_CAPACITY,
csi.ControllerServiceCapability_RPC_CREATE_DELETE_SNAPSHOT,
csi.ControllerServiceCapability_RPC_LIST_SNAPSHOTS,
csi.ControllerServiceCapability_RPC_LIST_VOLUMES,
csi.ControllerServiceCapability_RPC_CLONE_VOLUME,
csi.ControllerServiceCapability_RPC_VOLUME_CONDITION,
Expand All @@ -892,6 +891,9 @@ func (hp *hostPath) getControllerServiceCapabilities() []*csi.ControllerServiceC
if hp.config.EnableControllerModifyVolume {
cl = append(cl, csi.ControllerServiceCapability_RPC_MODIFY_VOLUME)
}
if hp.config.EnableListSnapshots {
cl = append(cl, csi.ControllerServiceCapability_RPC_LIST_SNAPSHOTS)
}
}

var csc []*csi.ControllerServiceCapability
Expand Down
1 change: 1 addition & 0 deletions pkg/hostpath/hostpath.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ type Config struct {
DisableNodeExpansion bool
MaxVolumeExpansionSizeNode int64
CheckVolumeLifecycle bool
EnableListSnapshots bool
}

var (
Expand Down