Skip to content
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

Check error on mockserver start and remove unused clientset arg #662

Merged
merged 3 commits into from
Aug 16, 2021
Merged
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ See the [storage capacity section](#capacity-support) below for details.
External-provisioner interacts with Kubernetes by watching PVCs and
PVs and implementing the [external provisioner
protocol](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/storage/container-storage-interface.md#provisioning-and-deleting).
The [design document](./docs/design.md) explains this in more detail.
The [design document](./doc/design.md) explains this in more detail.

### Topology support
When `Topology` feature is enabled and the driver specifies `VOLUME_ACCESSIBILITY_CONSTRAINTS` in its plugin capabilities, external-provisioner prepares `CreateVolumeRequest.AccessibilityRequirements` while calling `Controller.CreateVolume`. The driver has to consider these topology constraints while creating the volume. Below table shows how these `AccessibilityRequirements` are prepared:
Expand Down Expand Up @@ -276,7 +276,7 @@ with some minor change:
variables to make the DaemonSet that contains the external-provisioner
the owner of CSIStorageCapacity objects for the node.

Deployments of external-provisioner outside of the Kubernetes cluster
Deployments of external-provisioner outside the Kubernetes cluster
are also possible, albeit only without an owner for the objects.
`NAMESPACE` still needs to be set to some existing namespace also
in this case.
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/clone_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
)

//
// This package introduce a way to handle finalizers, related to in-progress PVC cloning. This is a two step approach:
// This package introduces a way to handle finalizers, related to in-progress PVC cloning. This is a two-step approach:
//
// 1) PVC referenced as a data source is now updated with a finalizer `provisioner.storage.kubernetes.io/cloning-protection` during a ProvisionExt method call.
// The detection of cloning in-progress is based on the assumption that a PVC with `spec.DataSource` pointing on a another PVC will go into `Pending` state.
Expand Down
9 changes: 1 addition & 8 deletions pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,6 @@ const (
pvcNamespaceKey = "csi.storage.k8s.io/pvc/namespace"
pvNameKey = "csi.storage.k8s.io/pv/name"

// Defines parameters for ExponentialBackoff used for executing
// CSI CreateVolume API call, it gives approx 4 minutes for the CSI
// driver to complete a volume creation.
backoffDuration = time.Second * 5
backoffFactor = 1.2
backoffSteps = 10

snapshotKind = "VolumeSnapshot"
snapshotAPIGroup = snapapi.GroupName // "snapshot.storage.k8s.io"
pvcKind = "PersistentVolumeClaim" // Native types don't require an API group
Expand Down Expand Up @@ -267,7 +260,7 @@ var _ controller.Qualifier = &csiProvisioner{}

var (
// Each provisioner have a identify string to distinguish with others. This
// identify string will be added in PV annoations under this key.
// identify string will be added in PV annotations under this key.
provisionerIDKey = "storage.kubernetes.io/csiProvisionerIdentity"
)

Expand Down
6 changes: 4 additions & 2 deletions pkg/controller/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,10 @@ func createMockServer(t *testing.T, tmpdir string) (*gomock.Controller,
Identity: identityServer,
Controller: controllerServer,
})
drv.StartOnAddress("unix", filepath.Join(tmpdir, "csi.sock"))

err := drv.StartOnAddress("unix", filepath.Join(tmpdir, "csi.sock"))
if err != nil {
return nil, nil, nil, nil, csiConnection{}, err
}
// Create a client connection to it
addr := drv.Address()
csiConn, err := New(addr)
Expand Down
3 changes: 1 addition & 2 deletions pkg/controller/topology.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func GenerateAccessibilityRequirements(
}

// Aggregate existing topologies in nodes across the entire cluster.
requisiteTerms, err = aggregateTopologies(kubeClient, driverName, selectedCSINode, csiNodeLister, nodeLister)
requisiteTerms, err = aggregateTopologies(driverName, selectedCSINode, csiNodeLister, nodeLister)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -286,7 +286,6 @@ func getSelectedCSINode(
// aggregateTopologies returns all the supported topology values in the cluster that
// match the driver's topology keys.
func aggregateTopologies(
kubeClient kubernetes.Interface,
driverName string,
selectedCSINode *storagev1.CSINode,
csiNodeLister storagelistersv1.CSINodeLister,
Expand Down