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

Storage capacity #248

Merged
merged 4 commits into from
Feb 24, 2021
Merged

Commits on Feb 23, 2021

  1. refactor: remove global variables, avoid copying, add locking

    The code used to share state via global variables (bad practice!)
    without proper locking (even worse). The different servers were
    implemented as individual structs, which meant that parameters had to
    be duplicated.
    
    A simpler approach is to have one struct with clearly defined
    read-only and read/write members, with coarse locking at the outer
    gRPC layer.
    pohly committed Feb 23, 2021
    Configuration menu
    Copy the full SHA
    e15a550 View commit details
    Browse the repository at this point in the history
  2. support for capacity tracking + distributed provisioning

    This fakes capacity by pretending to have linear storage for different
    kinds and subtracting the size of existing volumes from that.
    
    A test deployment with some example storage classes, an example app
    with a generic ephemeral inline volume, and storage capacity tracking
    enabled is provided for use on a Kubernetes cluster where these alpha
    features are enabled.
    
    When that feature is not enabled in the cluster, also the driver
    deployment is done without storage capacity enabled. This then serves
    as a test that distributed provisioning works.
    
    prow.sh can be used to test this new deployment, for example with:
    
    CSI_PROW_SANITY_POD=csi-hostpath-socat-0 \
      CSI_PROW_SANITY_CONTAINER=socat \
      CSI_PROW_DEPLOYMENT=kubernetes-distributed \
      CSI_PROW_KUBERNETES_VERSION=1.19.0 \
      ./.prow.sh
    pohly committed Feb 23, 2021
    Configuration menu
    Copy the full SHA
    9f929d0 View commit details
    Browse the repository at this point in the history
  3. clean up error handling

    Wrapping errors with an "Internal" status error was at best
    useless (it does not tell the caller anything and the default
    "Unknown" error has the same effect) and at worst hid the actual
    status (when wrapping createVolume). Therefore most of those wrappers
    get removed.
    
    The handling of "not found" also was inconsistent. Some places checked
    the map directly, others made assumptions about the error returned by
    the helper functions. Now the helper functions themselves generate a
    gRPC status error which can be returned directly.
    pohly committed Feb 23, 2021
    Configuration menu
    Copy the full SHA
    95a8291 View commit details
    Browse the repository at this point in the history
  4. capacity: reject storage kind if capacity tracking is disabled

    The parameter becomes invalid when the driver is not configured
    to have different storage kinds.
    pohly committed Feb 23, 2021
    Configuration menu
    Copy the full SHA
    65e48f2 View commit details
    Browse the repository at this point in the history