From 2ed155d5e47e20d119334663a735515bd4df3391 Mon Sep 17 00:00:00 2001 From: jay vyas Date: Tue, 29 Jan 2019 07:55:48 -0800 Subject: [PATCH] Add breadcrumb logs to demonstrate when minikube's CSI provisioner is actively making volumes Since minikube is the canonical kubernetes deployment for learning and playing with things, this trivial PR makes it easy to see the storage provisioner in action, the current logging shows very little easier to differentiate how volumes are spun up. --- pkg/storage/storage_provisioner.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/storage/storage_provisioner.go b/pkg/storage/storage_provisioner.go index 3b86b4737e..79021812a9 100644 --- a/pkg/storage/storage_provisioner.go +++ b/pkg/storage/storage_provisioner.go @@ -55,6 +55,8 @@ var _ controller.Provisioner = &hostPathProvisioner{} // Provision creates a storage asset and returns a PV object representing it. func (p *hostPathProvisioner) Provision(options controller.VolumeOptions) (*v1.PersistentVolume, error) { + glog.Infof("Provisioning volume %v", options) + path := path.Join(p.pvDir, options.PVName) if err := os.MkdirAll(path, 0777); err != nil { @@ -93,6 +95,7 @@ func (p *hostPathProvisioner) Provision(options controller.VolumeOptions) (*v1.P // Delete removes the storage asset that was created by Provision represented // by the given PV. func (p *hostPathProvisioner) Delete(volume *v1.PersistentVolume) error { + glog.Infof("Deleting volume %v", volume) ann, ok := volume.Annotations["hostPathProvisionerIdentity"] if !ok { return errors.New("identity annotation not found on PV") @@ -111,6 +114,8 @@ func (p *hostPathProvisioner) Delete(volume *v1.PersistentVolume) error { // Start storage provisioner server func StartStorageProvisioner() error { + glog.Infof("Initializing the Minikube CSI storage provisioner...") + config, err := restclient.InClusterConfig() if err != nil { return err @@ -135,7 +140,7 @@ func StartStorageProvisioner() error { // PVs pc := controller.NewProvisionController(clientset, provisionerName, hostPathProvisioner, serverVersion.GitVersion) - glog.Info("Starting storage provisioner server") + glog.Info("...Done initializing succesfully, now starting storage the CSI provisioner service !") pc.Run(wait.NeverStop) return nil }