Repository: kubernetes-sigs/gcp-filestore-csi-driver
Pull request #463 (2023-04-01 07:14:18)

Controller Expand implementation for configurable max shares
<!--  Thanks for sending a pull request!  Here are some tips for you:

1. If this is your first time, please read our contributor guidelines: https://git.k8s.io/community/contributors/guide#your-first-contribution and developer guide https://git.k8s.io/community/contributors/devel/development.md#development-guide
2. Follow the instructions for writing a release note: https://git.k8s.io/community/contributors/guide/release-notes.md
3. If the PR is unfinished, see how to mark it: https://git.k8s.io/community/contributors/guide/pull-requests.md#marking-unfinished-pull-requests
-->

**What type of PR is this?**
> Uncomment only one ` /kind <>` line, hit enter to put that in a new line, and remove leading whitespaces from that line:
>
> /kind api-change
> /kind bug
> /kind cleanup
> /kind design
> /kind documentation
> /kind failing-test
> /kind feature
> /kind flake

**What this PR does / why we need it**:

**Which issue(s) this PR fixes**:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
_If PR is about `failing-tests or flakes`, please post the related issues/tests in a comment and do not use `Fixes`_*
-->
Fixes #

**Special notes for your reviewer**:

**Does this PR introduce a user-facing change?**:
<!--
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->
```release-note
Controller Expand implementation for configurable max shares; Increase poll timeout for multishare ops
```


k8s-ci-robot: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/kubernetes-sigs/gcp-filestore-csi-driver/pull/463#" title="Author self-approved">saikat-royc</a>*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=kubernetes-sigs%2Fgcp-filestore-csi-driver).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[OWNERS](https://github.com/kubernetes-sigs/gcp-filestore-csi-driver/blob/master/OWNERS)~~ [saikat-royc]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->
saikat-royc: /hold WIP
k8s-ci-robot: @saikat-royc: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-gcp-filestore-csi-driver-unit | 46116bc079f7e75e30468f6a48764c40d7653e82 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/sigs.k8s.io_gcp-filestore-csi-driver/463/pull-gcp-filestore-csi-driver-unit/1642063259735429120/) | true | `/test pull-gcp-filestore-csi-driver-unit`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=gcp-filestore-csi-driver&pr=463). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Asaikat-royc). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/gcp-filestore-csi-driver/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @saikat-royc: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-gcp-filestore-csi-driver-unit | 82ecb4f09dcbd361514ce67ee4e674096baf6d82 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/sigs.k8s.io_gcp-filestore-csi-driver/463/pull-gcp-filestore-csi-driver-unit/1642063817057767424/) | true | `/test pull-gcp-filestore-csi-driver-unit`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=gcp-filestore-csi-driver&pr=463). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Asaikat-royc). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/gcp-filestore-csi-driver/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
saikat-royc: /assign @leiyiz 

k8s-ci-robot: @saikat-royc: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-gcp-filestore-csi-driver-unit | 2ce483c660388c870f0927c64813cdd98054048f | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/sigs.k8s.io_gcp-filestore-csi-driver/463/pull-gcp-filestore-csi-driver-unit/1642064401924100096/) | true | `/test pull-gcp-filestore-csi-driver-unit`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=gcp-filestore-csi-driver&pr=463). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Asaikat-royc). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/gcp-filestore-csi-driver/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @saikat-royc: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-gcp-filestore-csi-driver-unit | 2ce483c660388c870f0927c64813cdd98054048f | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/sigs.k8s.io_gcp-filestore-csi-driver/463/pull-gcp-filestore-csi-driver-unit/1642064401924100096/) | true | `/test pull-gcp-filestore-csi-driver-unit`
pull-gcp-filestore-csi-driver-e2e | 2ce483c660388c870f0927c64813cdd98054048f | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/sigs.k8s.io_gcp-filestore-csi-driver/463/pull-gcp-filestore-csi-driver-e2e/1642064401852796928/) | true | `/test pull-gcp-filestore-csi-driver-e2e`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=gcp-filestore-csi-driver&pr=463). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Asaikat-royc). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/gcp-filestore-csi-driver/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
saikat-royc: /hold WIP
k8s-ci-robot: @saikat-royc: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-gcp-filestore-csi-driver-e2e | 2ce483c660388c870f0927c64813cdd98054048f | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/sigs.k8s.io_gcp-filestore-csi-driver/463/pull-gcp-filestore-csi-driver-e2e/1642064401852796928/) | true | `/test pull-gcp-filestore-csi-driver-e2e`
pull-gcp-filestore-csi-driver-unit | 7db03b4bef21d088bfd83b787edc6bb434cd6a63 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/sigs.k8s.io_gcp-filestore-csi-driver/463/pull-gcp-filestore-csi-driver-unit/1643683900771274753/) | true | `/test pull-gcp-filestore-csi-driver-unit`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=gcp-filestore-csi-driver&pr=463). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Asaikat-royc). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/gcp-filestore-csi-driver/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @saikat-royc: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-gcp-filestore-csi-driver-unit | 7db03b4bef21d088bfd83b787edc6bb434cd6a63 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/sigs.k8s.io_gcp-filestore-csi-driver/463/pull-gcp-filestore-csi-driver-unit/1643683900771274753/) | true | `/test pull-gcp-filestore-csi-driver-unit`
pull-gcp-filestore-csi-driver-e2e | 7db03b4bef21d088bfd83b787edc6bb434cd6a63 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/sigs.k8s.io_gcp-filestore-csi-driver/463/pull-gcp-filestore-csi-driver-e2e/1643683900792246272/) | true | `/test pull-gcp-filestore-csi-driver-e2e`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=gcp-filestore-csi-driver&pr=463). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Asaikat-royc). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/gcp-filestore-csi-driver/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @saikat-royc: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-gcp-filestore-csi-driver-e2e | 48861d08733b21bfbd06d169e08d9b75f4f72b19 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/sigs.k8s.io_gcp-filestore-csi-driver/463/pull-gcp-filestore-csi-driver-e2e/1643685802686812160/) | true | `/test pull-gcp-filestore-csi-driver-e2e`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=gcp-filestore-csi-driver&pr=463). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Asaikat-royc). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/gcp-filestore-csi-driver/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
saikat-royc: /hold
k8s-ci-robot: @saikat-royc: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-gcp-filestore-csi-driver-e2e | a18a0f27af16c3d7975d1cb582c53a1f068fff82 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/sigs.k8s.io_gcp-filestore-csi-driver/463/pull-gcp-filestore-csi-driver-e2e/1643695414584545280/) | true | `/test pull-gcp-filestore-csi-driver-e2e`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=gcp-filestore-csi-driver&pr=463). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Asaikat-royc). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/gcp-filestore-csi-driver/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
saikat-royc: /retest
k8s-ci-robot: @saikat-royc: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-gcp-filestore-csi-driver-e2e | a18a0f27af16c3d7975d1cb582c53a1f068fff82 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/sigs.k8s.io_gcp-filestore-csi-driver/463/pull-gcp-filestore-csi-driver-e2e/1643703267332460544/) | true | `/test pull-gcp-filestore-csi-driver-e2e`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=gcp-filestore-csi-driver&pr=463). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Asaikat-royc). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/gcp-filestore-csi-driver/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
saikat-royc: /retest
k8s-ci-robot: @saikat-royc: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-gcp-filestore-csi-driver-e2e | a18a0f27af16c3d7975d1cb582c53a1f068fff82 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/sigs.k8s.io_gcp-filestore-csi-driver/463/pull-gcp-filestore-csi-driver-e2e/1643707099072434176/) | true | `/test pull-gcp-filestore-csi-driver-e2e`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=gcp-filestore-csi-driver&pr=463). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Asaikat-royc). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/gcp-filestore-csi-driver/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @saikat-royc: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-gcp-filestore-csi-driver-e2e | 6819a94b9b1fab79d8e838b300e324b315545f1e | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/sigs.k8s.io_gcp-filestore-csi-driver/463/pull-gcp-filestore-csi-driver-e2e/1643734768350662656/) | true | `/test pull-gcp-filestore-csi-driver-e2e`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=gcp-filestore-csi-driver&pr=463). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Asaikat-royc). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/gcp-filestore-csi-driver/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
leiyiz: `MinShareSizeConfigurableBytes` let me think that the min size is configurable so it's a bit confusing - perhaps `ConfigurablePackMinShareSizeBytes` or something like that is better?
k8s-ci-robot: PR needs rebase.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
</details>
saikat-royc: /retest
k8s-ci-robot: @saikat-royc: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-gcp-filestore-csi-driver-e2e | a672c826dccaaec4f3a8f8c6f91a8103c493fc34 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/sigs.k8s.io_gcp-filestore-csi-driver/463/pull-gcp-filestore-csi-driver-e2e/1644006105333895168/) | true | `/test pull-gcp-filestore-csi-driver-e2e`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=gcp-filestore-csi-driver&pr=463). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Asaikat-royc). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/gcp-filestore-csi-driver/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
saikat-royc: /retest
saikat-royc: > `generateCSICreateVolumeResponse(.. maxShareSizeBytes)` L610

Fixed
k8s-ci-robot: @saikat-royc: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-gcp-filestore-csi-driver-e2e | a672c826dccaaec4f3a8f8c6f91a8103c493fc34 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/sigs.k8s.io_gcp-filestore-csi-driver/463/pull-gcp-filestore-csi-driver-e2e/1644011771729547264/) | true | `/test pull-gcp-filestore-csi-driver-e2e`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=gcp-filestore-csi-driver&pr=463). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Asaikat-royc). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/gcp-filestore-csi-driver/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @saikat-royc: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-gcp-filestore-csi-driver-e2e | a672c826dccaaec4f3a8f8c6f91a8103c493fc34 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/sigs.k8s.io_gcp-filestore-csi-driver/463/pull-gcp-filestore-csi-driver-e2e/1644011771729547264/) | true | `/test pull-gcp-filestore-csi-driver-e2e`
pull-gcp-filestore-csi-driver-verify | bed75cbf85113d20f20f9f59674efab2d8ab4736 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/sigs.k8s.io_gcp-filestore-csi-driver/463/pull-gcp-filestore-csi-driver-verify/1644015314662330368/) | true | `/test pull-gcp-filestore-csi-driver-verify`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=gcp-filestore-csi-driver&pr=463). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Asaikat-royc). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/gcp-filestore-csi-driver/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @saikat-royc: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-gcp-filestore-csi-driver-verify | bed75cbf85113d20f20f9f59674efab2d8ab4736 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/sigs.k8s.io_gcp-filestore-csi-driver/463/pull-gcp-filestore-csi-driver-verify/1644015314662330368/) | true | `/test pull-gcp-filestore-csi-driver-verify`
pull-gcp-filestore-csi-driver-unit | bed75cbf85113d20f20f9f59674efab2d8ab4736 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/sigs.k8s.io_gcp-filestore-csi-driver/463/pull-gcp-filestore-csi-driver-unit/1644015314620387328/) | true | `/test pull-gcp-filestore-csi-driver-unit`
pull-gcp-filestore-csi-driver-e2e | bed75cbf85113d20f20f9f59674efab2d8ab4736 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/sigs.k8s.io_gcp-filestore-csi-driver/463/pull-gcp-filestore-csi-driver-e2e/1644015314528112640/) | true | `/test pull-gcp-filestore-csi-driver-e2e`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=gcp-filestore-csi-driver&pr=463). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Asaikat-royc). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/gcp-filestore-csi-driver/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @saikat-royc: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-gcp-filestore-csi-driver-unit | bed75cbf85113d20f20f9f59674efab2d8ab4736 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/sigs.k8s.io_gcp-filestore-csi-driver/463/pull-gcp-filestore-csi-driver-unit/1644015314620387328/) | true | `/test pull-gcp-filestore-csi-driver-unit`
pull-gcp-filestore-csi-driver-e2e | bed75cbf85113d20f20f9f59674efab2d8ab4736 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/sigs.k8s.io_gcp-filestore-csi-driver/463/pull-gcp-filestore-csi-driver-e2e/1644015314528112640/) | true | `/test pull-gcp-filestore-csi-driver-e2e`
pull-gcp-filestore-csi-driver-verify | 6e01caa72b885eeaf94017a4cc98de660c8eab9c | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/sigs.k8s.io_gcp-filestore-csi-driver/463/pull-gcp-filestore-csi-driver-verify/1644017558665302016/) | true | `/test pull-gcp-filestore-csi-driver-verify`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=gcp-filestore-csi-driver&pr=463). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Asaikat-royc). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/gcp-filestore-csi-driver/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @saikat-royc: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-gcp-filestore-csi-driver-e2e | bed75cbf85113d20f20f9f59674efab2d8ab4736 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/sigs.k8s.io_gcp-filestore-csi-driver/463/pull-gcp-filestore-csi-driver-e2e/1644015314528112640/) | true | `/test pull-gcp-filestore-csi-driver-e2e`
pull-gcp-filestore-csi-driver-verify | 6e01caa72b885eeaf94017a4cc98de660c8eab9c | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/sigs.k8s.io_gcp-filestore-csi-driver/463/pull-gcp-filestore-csi-driver-verify/1644017558665302016/) | true | `/test pull-gcp-filestore-csi-driver-verify`
pull-gcp-filestore-csi-driver-unit | 6e01caa72b885eeaf94017a4cc98de660c8eab9c | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/sigs.k8s.io_gcp-filestore-csi-driver/463/pull-gcp-filestore-csi-driver-unit/1644017558598193152/) | true | `/test pull-gcp-filestore-csi-driver-unit`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=gcp-filestore-csi-driver&pr=463). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Asaikat-royc). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/gcp-filestore-csi-driver/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @saikat-royc: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-gcp-filestore-csi-driver-verify | 6e01caa72b885eeaf94017a4cc98de660c8eab9c | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/sigs.k8s.io_gcp-filestore-csi-driver/463/pull-gcp-filestore-csi-driver-verify/1644017558665302016/) | true | `/test pull-gcp-filestore-csi-driver-verify`
pull-gcp-filestore-csi-driver-unit | 6e01caa72b885eeaf94017a4cc98de660c8eab9c | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/sigs.k8s.io_gcp-filestore-csi-driver/463/pull-gcp-filestore-csi-driver-unit/1644017558598193152/) | true | `/test pull-gcp-filestore-csi-driver-unit`
pull-gcp-filestore-csi-driver-e2e | 6e01caa72b885eeaf94017a4cc98de660c8eab9c | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/sigs.k8s.io_gcp-filestore-csi-driver/463/pull-gcp-filestore-csi-driver-e2e/1644017558476558336/) | true | `/test pull-gcp-filestore-csi-driver-e2e`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=gcp-filestore-csi-driver&pr=463). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Asaikat-royc). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/gcp-filestore-csi-driver/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @saikat-royc: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-gcp-filestore-csi-driver-e2e | 66c8a99cb93eacbba57249e7b94756409ff8538b | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/sigs.k8s.io_gcp-filestore-csi-driver/463/pull-gcp-filestore-csi-driver-e2e/1644019003842105344/) | true | `/test pull-gcp-filestore-csi-driver-e2e`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=gcp-filestore-csi-driver&pr=463). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Asaikat-royc). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/gcp-filestore-csi-driver/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
saikat-royc: > `MinShareSizeConfigurableBytes` let me think that the min size is configurable so it's a bit confusing - perhaps `ConfigurablePackMinShareSizeBytes` or something like that is better?

Ack. Changed the name
saikat-royc: /retest
k8s-ci-robot: @saikat-royc: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-gcp-filestore-csi-driver-e2e | 819a13e7a98d896c3ac4333c6565dacedbc54376 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/sigs.k8s.io_gcp-filestore-csi-driver/463/pull-gcp-filestore-csi-driver-e2e/1644023644784955392/) | true | `/test pull-gcp-filestore-csi-driver-e2e`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=gcp-filestore-csi-driver&pr=463). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Asaikat-royc). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/gcp-filestore-csi-driver/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @saikat-royc: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-gcp-filestore-csi-driver-e2e | 1c8fc8b6756e0d78984a658a38e311b5df4b958e | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/sigs.k8s.io_gcp-filestore-csi-driver/463/pull-gcp-filestore-csi-driver-e2e/1644026557569699840/) | true | `/test pull-gcp-filestore-csi-driver-e2e`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=gcp-filestore-csi-driver&pr=463). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Asaikat-royc). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/gcp-filestore-csi-driver/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
saikat-royc: /retest

k8s-ci-robot: @saikat-royc: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-gcp-filestore-csi-driver-e2e | 1c8fc8b6756e0d78984a658a38e311b5df4b958e | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/sigs.k8s.io_gcp-filestore-csi-driver/463/pull-gcp-filestore-csi-driver-e2e/1644029474766852096/) | true | `/test pull-gcp-filestore-csi-driver-e2e`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=gcp-filestore-csi-driver&pr=463). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Asaikat-royc). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/gcp-filestore-csi-driver/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
saikat-royc: /retest
k8s-ci-robot: @saikat-royc: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-gcp-filestore-csi-driver-e2e | 1c8fc8b6756e0d78984a658a38e311b5df4b958e | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/sigs.k8s.io_gcp-filestore-csi-driver/463/pull-gcp-filestore-csi-driver-e2e/1644036733983002624/) | true | `/test pull-gcp-filestore-csi-driver-e2e`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=gcp-filestore-csi-driver&pr=463). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Asaikat-royc). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/gcp-filestore-csi-driver/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->

Patch:
diff --git a/cmd/main.go b/cmd/main.go
index bb7037d3..37ea549c 100644
--- a/cmd/main.go
+++ b/cmd/main.go
@@ -72,8 +72,12 @@ var (
 	featureMaxSharePerInstance = flag.Bool("feature-max-shares-per-instance", false, "If this feature flag is enabled, allows the user to configure max shares packed per Filestore instance")
 	descOverrideMaxShareCount  = flag.String("desc-override-max-shares-per-instance", "", "If non-empty, the filestore instance description override is used to configure max share count per instance. This flag is ignored if 'feature-max-shares-per-instance' flag is false. Both 'desc-override-max-shares-per-instance' and 'desc-override-min-shares-size-gb' must be provided. 'ecfsDescription' is ignored, if this flag is provided.")
 	descOverrideMinShareSizeGB = flag.String("desc-override-min-shares-size-gb", "", "If non-empty, the filestore instance description override is used to configure min share size. This flag is ignored if 'feature-max-shares-per-instance' flag is false. Both 'desc-override-max-shares-per-instance' and 'desc-override-min-shares-size-gb' must be provided. 'ecfsDescription' is ignored, if this flag is provided.")
-	enableStateful             = flag.Bool("enable-stateful-multishare", false, "")
-	kubeconfig                 = flag.String("kubeconfig", "", "Absolute path to the kubeconfig file. Required only when running out of cluster.")
+
+	// Feature stateful CSI driver specific parameters
+	enableStateful = flag.Bool("enable-stateful-multishare", false, "")
+
+	kubeconfig               = flag.String("kubeconfig", "", "Absolute path to the kubeconfig file. Required only when running out of cluster.")
+	coreInformerResyncPeriod = flag.Duration("core-informer-resync-repriod", 15*time.Minute, "Core informer resync period.")
 
 	// This is set at compile time
 	version = "unknown"
@@ -123,6 +127,22 @@ func main() {
 		klog.Fatalf("Failed to initialize cloud provider: %v", err)
 	}
 
+	var kubeClient *kubernetes.Clientset
+	if *featureMaxSharePerInstance && *runController && *enableMultishare {
+		clusterConfig, err := buildConfig(*kubeconfig)
+		if err != nil {
+			klog.Error(err.Error())
+			os.Exit(1)
+		}
+		klog.Infof("cluster config created")
+
+		kubeClient, err = kubernetes.NewForConfig(clusterConfig)
+		if err != nil {
+			klog.Error(err.Error())
+			os.Exit(1)
+		}
+	}
+
 	featureOptions := &driver.GCFSDriverFeatureOptions{
 		FeatureLockRelease: &driver.FeatureLockRelease{
 			Enabled: *featureLockRelease,
@@ -137,8 +157,11 @@ func main() {
 			Enabled:                          *featureMaxSharePerInstance,
 			DescOverrideMaxSharesPerInstance: *descOverrideMaxShareCount,
 			DescOverrideMinShareSizeGB:       *descOverrideMinShareSizeGB,
+			KubeClient:                       kubeClient,
+			CoreInformerResync:               *coreInformerResyncPeriod,
 		},
 	}
+
 	mounter := mount.New("")
 	config := &driver.GCFSDriverConfig{
 		Name:             driverName,
@@ -165,10 +188,8 @@ func main() {
 	if err != nil {
 		klog.Fatalf("Failed to initialize Cloud Filestore CSI Driver: %v", err)
 	}
-
 	klog.Infof("Running Google Cloud Filestore CSI driver version %v", version)
 	gcfsDriver.Run(*endpoint)
-
 	os.Exit(0)
 }
 
diff --git a/deploy/kubernetes/overlays/multishare/kustomization.yaml b/deploy/kubernetes/overlays/multishare/kustomization.yaml
index 6dee1f2d..9d7fe5f5 100644
--- a/deploy/kubernetes/overlays/multishare/kustomization.yaml
+++ b/deploy/kubernetes/overlays/multishare/kustomization.yaml
@@ -2,6 +2,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
 kind: Kustomization
 resources:
 - ../stable-master
+- pv_rbac.yaml
 - webhook-deployment.yaml
 patchesStrategicMerge:
 - controller_always_pull.yaml
diff --git a/deploy/kubernetes/overlays/multishare/pv_rbac.yaml b/deploy/kubernetes/overlays/multishare/pv_rbac.yaml
new file mode 100644
index 00000000..dcddcc2b
--- /dev/null
+++ b/deploy/kubernetes/overlays/multishare/pv_rbac.yaml
@@ -0,0 +1,26 @@
+
+# Role and binding needed for configurable max shares feature
+kind: ClusterRole
+apiVersion: rbac.authorization.k8s.io/v1
+metadata:
+  name: gcp-filestore-csi-role
+rules:
+  - apiGroups: [""]
+    resources: ["persistentvolumes"]
+    verbs: ["get", "list", "watch"]
+
+---
+
+kind: ClusterRoleBinding
+apiVersion: rbac.authorization.k8s.io/v1
+metadata:
+  name: gcp-filestore-csi-binding
+subjects:
+  - kind: ServiceAccount
+    name: gcp-filestore-csi-controller-sa
+    namespace: gcp-filestore-csi-driver
+roleRef:
+  kind: ClusterRole
+  name: gcp-filestore-csi-role
+  apiGroup: rbac.authorization.k8s.io
+
diff --git a/examples/kubernetes/multishare/ss.yaml b/examples/kubernetes/multishare/ss.yaml
new file mode 100644
index 00000000..4a3231a7
--- /dev/null
+++ b/examples/kubernetes/multishare/ss.yaml
@@ -0,0 +1,33 @@
+apiVersion: apps/v1
+kind: StatefulSet
+metadata:
+  name: web
+spec:
+  serviceName: "nginx"
+  replicas: 80
+  selector:
+    matchLabels:
+      app: nginx
+  template:
+    metadata:
+      labels:
+        app: nginx
+    spec:
+      containers:
+      - name: nginx
+        image: registry.k8s.io/nginx-slim:0.8
+        ports:
+        - containerPort: 80
+          name: web
+        volumeMounts:
+        - name: www
+          mountPath: /usr/share/nginx/html
+  volumeClaimTemplates:
+  - metadata:
+      name: www
+    spec:
+      storageClassName: csi-filestore-multishare
+      accessModes: [ "ReadWriteMany" ]
+      resources:
+        requests:
+          storage: 100Gi
diff --git a/pkg/cloud_provider/file/file.go b/pkg/cloud_provider/file/file.go
index 5aff8e29..e6a9011a 100644
--- a/pkg/cloud_provider/file/file.go
+++ b/pkg/cloud_provider/file/file.go
@@ -815,7 +815,7 @@ func (manager *gcfsServiceManager) StartCreateMultishareInstanceOp(ctx context.C
 	if err != nil {
 		return nil, fmt.Errorf("CreateInstance operation failed: %w", err)
 	}
-	klog.Infof("Started create instance op %s, for instance %q project %q, location %q, tier %q, capacity %v, network %q, ipRange %q, connectMode %q, KmsKeyName %q, labels %v, description %s", op.Name, instance.Name, instance.Project, instance.Location, targetinstance.Tier, targetinstance.CapacityGb, targetinstance.Networks[0].Network, targetinstance.Networks[0].ReservedIpRange, targetinstance.Networks[0].ConnectMode, targetinstance.KmsKeyName, targetinstance.Labels, targetinstance.Description)
+	klog.Infof("Started create instance op %s, for instance %q project %q, location %q, tier %q, capacity %v, network %q, ipRange %q, connectMode %q, KmsKeyName %q, labels %v, description %s, maxShareCount %d", op.Name, instance.Name, instance.Project, instance.Location, targetinstance.Tier, targetinstance.CapacityGb, targetinstance.Networks[0].Network, targetinstance.Networks[0].ReservedIpRange, targetinstance.Networks[0].ConnectMode, targetinstance.KmsKeyName, targetinstance.Labels, targetinstance.Description, targetinstance.MaxShareCount)
 	return op, nil
 }
 
diff --git a/pkg/csi_driver/controller.go b/pkg/csi_driver/controller.go
index 99386ea0..55ba3b97 100644
--- a/pkg/csi_driver/controller.go
+++ b/pkg/csi_driver/controller.go
@@ -132,6 +132,14 @@ func newControllerServer(config *controllerServerConfig) csi.ControllerServer {
 	return cs
 }
 
+func (m *controllerServer) Run(stopCh <-chan struct{}) {
+	if m.config.multiShareController == nil {
+		return
+	}
+
+	m.config.multiShareController.Run(stopCh)
+}
+
 // CreateVolume creates a GCFS instance
 func (s *controllerServer) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error) {
 	if strings.ToLower(req.GetParameters()[paramMultishare]) == "true" {
diff --git a/pkg/csi_driver/gcfs_driver.go b/pkg/csi_driver/gcfs_driver.go
index 1a8415d2..8fdb9e5e 100644
--- a/pkg/csi_driver/gcfs_driver.go
+++ b/pkg/csi_driver/gcfs_driver.go
@@ -19,10 +19,14 @@ package driver
 import (
 	"context"
 	"fmt"
+	"os"
+	"os/signal"
+	"time"
 
 	csi "github.com/container-storage-interface/spec/lib/go/csi"
 	"google.golang.org/grpc/codes"
 	"google.golang.org/grpc/status"
+	"k8s.io/client-go/kubernetes"
 	"k8s.io/klog/v2"
 	mount "k8s.io/mount-utils"
 	cloud "sigs.k8s.io/gcp-filestore-csi-driver/pkg/cloud_provider"
@@ -79,6 +83,8 @@ type FeatureMaxSharesPerInstance struct {
 	Enabled                          bool
 	DescOverrideMaxSharesPerInstance string
 	DescOverrideMinShareSizeGB       string
+	KubeClient                       *kubernetes.Clientset
+	CoreInformerResync               time.Duration
 }
 
 func NewGCFSDriver(config *GCFSDriverConfig) (*GCFSDriver, error) {
@@ -127,7 +133,6 @@ func NewGCFSDriver(config *GCFSDriverConfig) (*GCFSDriver, error) {
 			csi.ControllerServiceCapability_RPC_CREATE_DELETE_SNAPSHOT,
 		}
 		driver.addControllerServiceCapabilities(csc)
-
 		// Configure controller server
 		driver.cs = newControllerServer(&controllerServerConfig{
 			driver:           driver,
@@ -236,6 +241,23 @@ func (driver *GCFSDriver) ValidateControllerServiceRequest(c csi.ControllerServi
 func (driver *GCFSDriver) Run(endpoint string) {
 	klog.Infof("Running driver: %v", driver.config.Name)
 
+	run := func(ctx context.Context) {
+		// run...
+		stopCh := make(chan struct{})
+		go driver.cs.(*controllerServer).Run(stopCh)
+
+		// ...until SIGINT
+		c := make(chan os.Signal, 1)
+		signal.Notify(c, os.Interrupt)
+		<-c
+		close(stopCh)
+	}
+
+	if driver.config.RunController {
+		klog.Infof("runcontroller %v", driver.config.RunController)
+		go run(context.TODO())
+	}
+
 	// Start the nonblocking GRPC.
 	s := NewNonBlockingGRPCServer()
 	s.Start(endpoint, driver.ids, driver.cs, driver.ns)
diff --git a/pkg/csi_driver/multishare_controller.go b/pkg/csi_driver/multishare_controller.go
index 3c4984dd..087c035c 100644
--- a/pkg/csi_driver/multishare_controller.go
+++ b/pkg/csi_driver/multishare_controller.go
@@ -25,8 +25,15 @@ import (
 	"golang.org/x/net/context"
 	"google.golang.org/grpc/codes"
 	"google.golang.org/grpc/status"
+	v1 "k8s.io/api/core/v1"
 	"k8s.io/apimachinery/pkg/api/resource"
+	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+	"k8s.io/apimachinery/pkg/labels"
 	"k8s.io/apimachinery/pkg/util/uuid"
+	"k8s.io/client-go/informers"
+	"k8s.io/client-go/kubernetes"
+	corelisters "k8s.io/client-go/listers/core/v1"
+	"k8s.io/client-go/tools/cache"
 	"k8s.io/klog/v2"
 	cloud "sigs.k8s.io/gcp-filestore-csi-driver/pkg/cloud_provider"
 	"sigs.k8s.io/gcp-filestore-csi-driver/pkg/cloud_provider/file"
@@ -57,9 +64,15 @@ type MultishareController struct {
 	isRegional                 bool
 	clustername                string
 	featureMaxSharePerInstance bool
+
 	// Filestore instance description overrides
 	descOverrideMaxSharesPerInstance string
 	descOverrideMinShareSizeBytes    string
+
+	pvLister       corelisters.PersistentVolumeLister
+	pvListerSynced cache.InformerSynced
+	kubeClient     *kubernetes.Clientset
+	factory        informers.SharedInformerFactory
 }
 
 func NewMultishareController(config *controllerServerConfig) *MultishareController {
@@ -77,10 +90,29 @@ func NewMultishareController(config *controllerServerConfig) *MultishareControll
 		c.featureMaxSharePerInstance = config.features.FeatureMaxSharesPerInstance.Enabled
 		c.descOverrideMaxSharesPerInstance = config.features.FeatureMaxSharesPerInstance.DescOverrideMaxSharesPerInstance
 		c.descOverrideMinShareSizeBytes = config.features.FeatureMaxSharesPerInstance.DescOverrideMinShareSizeGB
+		c.kubeClient = config.features.FeatureMaxSharesPerInstance.KubeClient
+		c.factory = informers.NewSharedInformerFactory(c.kubeClient, config.features.FeatureMaxSharesPerInstance.CoreInformerResync)
+		pvInformer := c.factory.Core().V1().PersistentVolumes()
+		c.pvLister = pvInformer.Lister()
+		c.pvListerSynced = pvInformer.Informer().HasSynced
 	}
+
 	return c
 }
 
+func (m *MultishareController) Run(stopCh <-chan struct{}) {
+	if !m.featureMaxSharePerInstance {
+		return
+	}
+
+	m.factory.Start(stopCh)
+	klog.Info("core Informer factory started")
+	if !cache.WaitForCacheSync(stopCh, m.pvListerSynced) {
+		klog.Errorf("Cannot sync caches")
+	}
+	klog.Infof("Informer cache sycned successfully %v", m.pvListerSynced())
+}
+
 func (m *MultishareController) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error) {
 	klog.Infof("CreateVolume called for multishare with request %+v", req)
 	name := req.GetName()
@@ -106,7 +138,7 @@ func (m *MultishareController) CreateVolume(ctx context.Context, req *csi.Create
 
 	var reqBytes int64
 	if m.featureMaxSharePerInstance {
-		reqBytes, err = getShareRequestCapacity(req.GetCapacityRange(), util.MinShareSizeConfigurableBytes, maxShareSizeSizeBytes)
+		reqBytes, err = getShareRequestCapacity(req.GetCapacityRange(), util.ConfigurablePackMinShareSizeBytes, maxShareSizeSizeBytes)
 	} else {
 		reqBytes, err = getShareRequestCapacity(req.GetCapacityRange(), util.MinShareSizeBytes, util.MaxShareSizeBytes)
 	}
@@ -290,8 +322,16 @@ func (m *MultishareController) ControllerExpandVolume(ctx context.Context, req *
 		return nil, status.Error(codes.InvalidArgument, "ControllerExpandVolume volume ID must be provided")
 	}
 
-	// TODO: This logic will change to derive the max allowable share size from the PV.spec.CSI.volumeAttributes[“max-share-size”]
-	reqBytes, err := getShareRequestCapacity(req.GetCapacityRange(), util.MinShareSizeConfigurableBytes, util.MaxShareSizeBytes)
+	maxShareSizeBytes := util.MaxShareSizeBytes
+	if m.featureMaxSharePerInstance {
+		var err error
+		maxShareSizeBytes, err = m.GetShareMaxSizeFromPV(ctx, volumeId)
+		if err != nil {
+			return nil, status.Error(codes.Internal, err.Error())
+		}
+		klog.Infof("maxShareSizeBytes %d", maxShareSizeBytes)
+	}
+	reqBytes, err := getShareRequestCapacity(req.GetCapacityRange(), util.ConfigurablePackMinShareSizeBytes, maxShareSizeBytes)
 	if err != nil {
 		return nil, status.Error(codes.InvalidArgument, err.Error())
 	}
@@ -482,7 +522,7 @@ func generateNewShare(name string, parent *file.MultishareInstance, req *csi.Cre
 		return nil, status.Error(codes.Internal, "parent mulishare instance is empty")
 	}
 	// The share size request is already validated in CreateVolume call
-	targetSizeBytes, err := getShareRequestCapacity(req.CapacityRange, util.MinShareSizeConfigurableBytes, util.MaxShareSizeBytes)
+	targetSizeBytes, err := getShareRequestCapacity(req.CapacityRange, util.ConfigurablePackMinShareSizeBytes, util.MaxShareSizeBytes)
 	if err != nil {
 		return nil, status.Error(codes.InvalidArgument, err.Error())
 	}
@@ -607,7 +647,7 @@ func getShareRequestCapacity(capRange *csi.CapacityRange, minShareSizeBytes, max
 	return rCap, nil
 }
 
-func (m *MultishareController) generateCSICreateVolumeResponse(instancePrefix string, s *file.Share, maxShareSizeSizeBytes int64) (*csi.CreateVolumeResponse, error) {
+func (m *MultishareController) generateCSICreateVolumeResponse(instancePrefix string, s *file.Share, maxShareSizeBytes int64) (*csi.CreateVolumeResponse, error) {
 	volId, err := generateMultishareVolumeIdFromShare(instancePrefix, s)
 	if err != nil {
 		return nil, status.Errorf(codes.Internal, err.Error())
@@ -626,7 +666,7 @@ func (m *MultishareController) generateCSICreateVolumeResponse(instancePrefix st
 		resp.Volume.VolumeContext[attrSupportLockRelease] = "true"
 	}
 	if m.featureMaxSharePerInstance {
-		resp.Volume.VolumeContext[attrMaxShareSize] = strconv.Itoa(int(maxShareSizeSizeBytes))
+		resp.Volume.VolumeContext[attrMaxShareSize] = strconv.Itoa(int(maxShareSizeBytes))
 	}
 	klog.Infof("CreateVolume resp: %+v", resp)
 	return resp, nil
@@ -723,3 +763,69 @@ func isValidMaxVolSize(val int64) bool {
 	}
 	return false
 }
+
+func (m *MultishareController) GetShareMaxSizeFromPV(ctx context.Context, volHandle string) (int64, error) {
+	// Even if the feature `featureMaxSharePerInstance` is disabled, we still need to handle the case of their being existing PVs which have share capacity range context saved in volumeAttributes
+	var targetPV *v1.PersistentVolume
+	var err error
+	if m.pvListerSynced() {
+		targetPV, err = m.findTargetPVFromInformer(volHandle)
+		if err != nil {
+			klog.Warningf("failed to list PV from informer cache, err %v", err)
+		}
+	} else {
+		klog.Warningf("PV informer cache not intialized, lookup PV list from kube-api server")
+	}
+
+	if targetPV == nil {
+		targetPV, err = m.findTargetPVFromKubeApiServer(ctx, volHandle)
+		if err != nil {
+			return 0, err
+		}
+	}
+
+	if targetPV == nil {
+		return 0, fmt.Errorf("target PV with volume handle %v not found, cannot determine the capacity range for the volume", volHandle)
+	}
+
+	// If volume atttributes does not catpure the max share size, it must be created with the feature disabled.
+	v, ok := targetPV.Spec.CSI.VolumeAttributes[attrMaxShareSize]
+	if !ok {
+		return util.MaxShareSizeBytes, nil
+	}
+	val, err := resource.ParseQuantity(v)
+	if err != nil {
+		return 0, err
+	}
+	return val.Value(), nil
+}
+
+func isTargetPV(pv *v1.PersistentVolume, volHandle string) bool {
+	return pv.Spec.CSI != nil && pv.Spec.CSI.VolumeHandle == volHandle
+}
+
+func (m *MultishareController) findTargetPVFromInformer(volHandle string) (*v1.PersistentVolume, error) {
+	pvList, err := m.pvLister.List(labels.Everything())
+	if err != nil {
+		return nil, err
+	}
+	for _, pv := range pvList {
+		if isTargetPV(pv, volHandle) {
+			return pv, nil
+		}
+	}
+	return nil, nil
+}
+
+func (m *MultishareController) findTargetPVFromKubeApiServer(ctx context.Context, volHandle string) (*v1.PersistentVolume, error) {
+	pvList, err := m.kubeClient.CoreV1().PersistentVolumes().List(ctx, metav1.ListOptions{})
+	if err != nil {
+		return nil, err
+	}
+	for _, pv := range pvList.Items {
+		if isTargetPV(&pv, volHandle) {
+			return &pv, nil
+		}
+	}
+	return nil, nil
+}
diff --git a/pkg/util/multishare_defs.go b/pkg/util/multishare_defs.go
index 9cce7847..7f960fdf 100644
--- a/pkg/util/multishare_defs.go
+++ b/pkg/util/multishare_defs.go
@@ -35,7 +35,7 @@ const (
 	FilestoreResourceCleanupFinalizer = "multishare.filestore.csi.storage.gke.io/resource-cleanup-protection"
 
 	// configurable max shares consts
-	MinShareSizeConfigurableBytes int64 = 10 * Gb
+	ConfigurablePackMinShareSizeBytes int64 = 10 * Gb
 )
 
 type OperationType int
diff --git a/pkg/util/util.go b/pkg/util/util.go
index ae790082..4b5e946b 100644
--- a/pkg/util/util.go
+++ b/pkg/util/util.go
@@ -263,8 +263,10 @@ func ParseShareURI(shareURI string) (string, string, string, string, error) {
 func GetMultishareOpsTimeoutConfig(opType OperationType) (time.Duration, time.Duration, error) {
 	switch opType {
 	case InstanceCreate, ShareDelete:
-		return 1 * time.Hour, 5 * time.Second, nil
-	case InstanceDelete, InstanceUpdate, ShareCreate, ShareUpdate:
+		return 1 * time.Hour, 60 * time.Second, nil
+	case InstanceDelete:
+		return 10 * time.Minute, 60 * time.Second, nil
+	case InstanceUpdate, ShareCreate, ShareUpdate:
 		return 10 * time.Minute, 5 * time.Second, nil
 	default:
 		return 0, 0, fmt.Errorf("unknown op type %v", opType)


Test patch:
diff --git a/pkg/csi_driver/multishare_controller_test.go b/pkg/csi_driver/multishare_controller_test.go
index bf8c58dc..fb779640 100644
--- a/pkg/csi_driver/multishare_controller_test.go
+++ b/pkg/csi_driver/multishare_controller_test.go
@@ -275,8 +275,8 @@ func TestGetShareRequestCapacity(t *testing.T) {
 		},
 		{
 			name:             "empty cap range, test 2",
-			expectedCapacity: util.MinShareSizeConfigurableBytes,
-			minSizeBytes:     util.MinShareSizeConfigurableBytes,
+			expectedCapacity: util.ConfigurablePackMinShareSizeBytes,
+			minSizeBytes:     util.ConfigurablePackMinShareSizeBytes,
 			maxSizeBytes:     util.MaxShareSizeBytes,
 		},
 		{
@@ -294,7 +294,7 @@ func TestGetShareRequestCapacity(t *testing.T) {
 			cap: &csi.CapacityRange{
 				LimitBytes: 9 * util.Gb,
 			},
-			minSizeBytes: util.MinShareSizeConfigurableBytes,
+			minSizeBytes: util.ConfigurablePackMinShareSizeBytes,
 			maxSizeBytes: util.MaxShareSizeBytes,
 		},
 		{
@@ -321,7 +321,7 @@ func TestGetShareRequestCapacity(t *testing.T) {
 			cap: &csi.CapacityRange{
 				RequiredBytes: 9 * util.Gb,
 			},
-			minSizeBytes: util.MinShareSizeConfigurableBytes,
+			minSizeBytes: util.ConfigurablePackMinShareSizeBytes,
 			maxSizeBytes: util.MaxShareSizeBytes,
 		},
 		{
@@ -356,7 +356,7 @@ func TestGetShareRequestCapacity(t *testing.T) {
 				LimitBytes:    9 * util.Gb,
 			},
 			expectErr:    true,
-			minSizeBytes: util.MinShareSizeConfigurableBytes,
+			minSizeBytes: util.ConfigurablePackMinShareSizeBytes,
 			maxSizeBytes: util.MaxShareSizeBytes,
 		},
 		{
@@ -375,7 +375,7 @@ func TestGetShareRequestCapacity(t *testing.T) {
 				RequiredBytes: 100 * util.Gb,
 				LimitBytes:    100 * util.Gb,
 			},
-			minSizeBytes:     util.MinShareSizeConfigurableBytes,
+			minSizeBytes:     util.ConfigurablePackMinShareSizeBytes,
 			maxSizeBytes:     128 * util.Gb,
 			expectedCapacity: 100 * util.Gb,
 		},
@@ -385,7 +385,7 @@ func TestGetShareRequestCapacity(t *testing.T) {
 				RequiredBytes: 100 * util.Gb,
 				LimitBytes:    130 * util.Gb,
 			},
-			minSizeBytes: util.MinShareSizeConfigurableBytes,
+			minSizeBytes: util.ConfigurablePackMinShareSizeBytes,
 			maxSizeBytes: 128 * util.Gb,
 			expectErr:    true,
 		},
@@ -394,7 +394,7 @@ func TestGetShareRequestCapacity(t *testing.T) {
 			cap: &csi.CapacityRange{
 				RequiredBytes: 130 * util.Gb,
 			},
-			minSizeBytes: util.MinShareSizeConfigurableBytes,
+			minSizeBytes: util.ConfigurablePackMinShareSizeBytes,
 			maxSizeBytes: 128 * util.Gb,
 			expectErr:    true,
 		},