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

Refactor nas plugin and support accesspoint #914

Merged
merged 9 commits into from
Mar 11, 2024

Conversation

tydra-wang
Copy link
Contributor

@tydra-wang tydra-wang commented Nov 22, 2023

What type of PR is this?

/kind feature
/kind cleanup

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?


Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. labels Nov 22, 2023
@k8s-ci-robot
Copy link
Contributor

@tydra-wang: The label(s) kind/refactor cannot be applied, because the repository doesn't have them.

In response to this:

What type of PR is this?

/kind feature
/kind refactor

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?


Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Nov 22, 2023
@tydra-wang tydra-wang changed the title refactor nas controllerserver and utilize latest NAS CreateDir API WIP: refactor nas controllerserver and utilize latest NAS CreateDir API Nov 22, 2023
@huww98
Copy link
Contributor

huww98 commented Nov 23, 2023

Maybe you can use #873 to implement v2 Auth

@huww98
Copy link
Contributor

huww98 commented Nov 23, 2023

Please see #874 for upgrade deps.

@tydra-wang tydra-wang force-pushed the refactor-nas branch 6 times, most recently from 61fb40d to 95651d3 Compare November 24, 2023 07:38
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 2, 2023
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 4, 2023
@tydra-wang tydra-wang force-pushed the refactor-nas branch 2 times, most recently from c753c10 to 861d7e0 Compare December 7, 2023 03:58
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 12, 2023
@tydra-wang tydra-wang force-pushed the refactor-nas branch 2 times, most recently from c6fa76c to ffd654b Compare February 29, 2024 06:24
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 29, 2024
@tydra-wang tydra-wang changed the title WIP: refactor nas controllerserver and utilize latest NAS CreateDir API WIP: refactor nas plugin and support accesspoint Feb 29, 2024
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 5, 2024
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 6, 2024
pkg/nas/accesspoint_controller.go Show resolved Hide resolved
pkg/nas/cloud/nas_client_v2.go Show resolved Hide resolved
pkg/nas/filesystem_controller.go Outdated Show resolved Hide resolved
pkg/nas/internal/config.go Show resolved Hide resolved
@huww98
Copy link
Contributor

huww98 commented Mar 8, 2024

Please rebase and get rid of the commit Revert "remove staging nas sdk", maybe combine it with remove staging nas sdk

feat(nas): NodePublish creates subpath if not exists

nas: refactor subpath controllerserver

nas: split filesystem controllerserver implements

nas: split sharepath controllerserver implements

refactor(nas): controller server

chore: add staging and vendor

refactor(nas): controller server

fix(nas): init loop image file when NodePublishVolume

upgrade client-go dependencies

nas: patch deletion finalizer using ssa

chore(nas): improve logs

fix rebase

fix(nas): set global query RegionId in v2 sdk client

fix(nas): nas-vpc endpoint not set for some regions

cleanup: fix deprecated function

cleanup: rename pkg/nas/internal to pkg/nas/cloud

refactor(nas): controller init

refactor(nas): driver init

refactor(nas): driver configs

feat(nas): support mount accesspoint

cleanup: constants

fix(nas): use node name as node id

feat(nas): support accesspoint provision
@tydra-wang tydra-wang marked this pull request as ready for review March 11, 2024 09:21
}

var invalidParameters []string
parseParameter := func(key string, target any) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

elegant 👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to just switch on key. So that we can report errors on unknown keys. And we can get a compilation error when unknown value type is encountered (maybe due to future SDK update).

@mowangdk
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 11, 2024
@tydra-wang tydra-wang changed the title WIP: refactor nas plugin and support accesspoint Refactor nas plugin and support accesspoint Mar 11, 2024
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 11, 2024
@mowangdk
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mowangdk, tydra-wang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 11, 2024
@k8s-ci-robot k8s-ci-robot merged commit 94b0e8a into kubernetes-sigs:master Mar 11, 2024
6 checks passed
parseParameter("accesspointPermission", &req.Permission)
parseParameter("accesspointPosixUserId", &req.PosixUserId)
parseParameter("accesspointPosixGroupId", &req.PosixGroupId)
parseParameter("accesspointPosixSecondaryGroupIds", &req.PosixSecondaryGroupIds)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, what is the expected format of this parameter? This looks strange, I would expect the type to be []int32, but it is *string.

if err == nil {
return false
}
sdkErr, ok := err.(*tea.SDKError)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prefer errors.As()

}

// get csi-plugin configmap
cm, err := kubeClient.CoreV1().ConfigMaps(configMapNamespace).Get(context.Background(), configMapName, metav1.GetOptions{})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can just read /etc/csi-plugin/config on node

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants