Skip to content

Conversation

@mauriciopoppe
Copy link
Member

@mauriciopoppe mauriciopoppe commented May 28, 2021

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 cleanup
/kind feature

What this PR does / why we need it:

Adds all the changes as per #133

Which issue(s) this PR fixes:

Fixes #133

Special notes for your reviewer:

This is on top of the disk API and the volume API PRs, we should merge those first.

Does this PR introduce a user-facing change?:

Added the v1beta2 Filesystem API, see #133 for the list of changes and the proto in client/api/filesystem/v1beta2

/cc @jingxu97 @ddebroy

@k8s-ci-robot k8s-ci-robot requested review from ddebroy and jingxu97 May 28, 2021 02:56
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/feature Categorizes issue or PR as related to a new feature. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 28, 2021
@mauriciopoppe mauriciopoppe force-pushed the fs-api-changes branch 4 times, most recently from 691a7d3 to 1a07b2e Compare June 2, 2021 21:34
@mauriciopoppe
Copy link
Member Author

These are the results of the FS integration tests with 1a07b2e:

=== RUN   TestFilesystemAPIGroup
=== RUN   TestFilesystemAPIGroup/v1beta2FilesystemTests
=== RUN   TestFilesystemAPIGroup/v1beta2FilesystemTests/PathExists_positive
=== RUN   TestFilesystemAPIGroup/v1beta2FilesystemTests/IsMount
=== RUN   TestFilesystemAPIGroup/v1beta1FilesystemTests
=== RUN   TestFilesystemAPIGroup/v1beta1FilesystemTests/PathExists_positive
=== RUN   TestFilesystemAPIGroup/v1beta1FilesystemTests/IsMount
=== RUN   TestFilesystemAPIGroup/v1alpha1FilesystemTests
=== RUN   TestFilesystemAPIGroup/v1alpha1FilesystemTests/PathExists_positive
=== RUN   TestFilesystemAPIGroup/v1alpha1FilesystemTests/IsMount
--- PASS: TestFilesystemAPIGroup (0.54s)
    --- PASS: TestFilesystemAPIGroup/v1beta2FilesystemTests (0.26s)
        --- PASS: TestFilesystemAPIGroup/v1beta2FilesystemTests/PathExists_positive (0.16s)
        --- PASS: TestFilesystemAPIGroup/v1beta2FilesystemTests/IsMount (0.09s)
    --- PASS: TestFilesystemAPIGroup/v1beta1FilesystemTests (0.16s)
        --- PASS: TestFilesystemAPIGroup/v1beta1FilesystemTests/PathExists_positive (0.06s)
        --- PASS: TestFilesystemAPIGroup/v1beta1FilesystemTests/IsMount (0.10s)
    --- PASS: TestFilesystemAPIGroup/v1alpha1FilesystemTests (0.12s)
        --- PASS: TestFilesystemAPIGroup/v1alpha1FilesystemTests/PathExists_positive (0.11s)
        --- PASS: TestFilesystemAPIGroup/v1alpha1FilesystemTests/IsMount (0.02s)
PASS
ok      github.com/kubernetes-csi/csi-proxy/integrationtests    1.023s

Copy link
Contributor

@ddebroy ddebroy left a comment

Choose a reason for hiding this comment

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

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ddebroy, mauriciopoppe

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 Jun 3, 2021
@ddebroy
Copy link
Contributor

ddebroy commented Jun 3, 2021

@jingxu97 can you provide the LGTM? Looks great to me! Please squash before the merge.

// LinkPath creates a local directory symbolic link between a source path
// and target path in the host's filesystem
rpc LinkPath(LinkPathRequest) returns (LinkPathResponse) {}
// CreateSymlink creates a local directory symbolic link from a target path
Copy link
Contributor

Choose a reason for hiding this comment

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

creates a symbolic link, target_path pointing to source_path in the host filesystem.
Also I am thinking to name target_path to link_path to avoid confusion. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

@mauriciopoppe mauriciopoppe Jun 4, 2021

Choose a reason for hiding this comment

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

I think that target_path and source_path are ok, from the documentation it's pretty clear that target_path is pointing to source_path, I interpret the arrow like this (from target path to source path) because that's what ls says:

/tmp❯ touch source_path

/tmp❯ ln -s source_path target_path

/tmp❯ ls -la source_path target_path
-rw-r--r--  1 mauriciopoppe  wheel   0 Jun  4 12:41 source_path
lrwxr-xr-x  1 mauriciopoppe  wheel  11 Jun  4 12:41 target_path -> source_path

Copy link
Contributor

Choose a reason for hiding this comment

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

ok, then update comment a little bit with

create a symbolic link called target_path that points to source_path in the host filesystem (target_path is the name of the symbolic link created, source_path is the existing path).

Copy link
Member Author

Choose a reason for hiding this comment

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

done

IsMountPoint: false,
Error: err.Error(),
}, err
klog.Errorf("Failed to forward to IsSymlink: %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

"failed to forward ...

Copy link
Member Author

Choose a reason for hiding this comment

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

What's the feedback here?

Copy link
Contributor

Choose a reason for hiding this comment

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

oh, just small case in failed

Copy link
Member Author

Choose a reason for hiding this comment

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

I think I set it as uppercase in many places, typically when we add logs statements they start with an uppercase letter right?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the current format is lowercase. but definitely it is not consistent.
if there are two many of them, we can use different PR for it.

// - it is a soft link and
// - the target path of the link exists.
func (APIImplementor) IsMountPoint(tgt string) (bool, error) {
func (filesystemAPI) IsSymlink(tgt string) (bool, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

need more comments on what is returned

if tgt path does not exist, it return error
if tgt path exists, but the source path tgt points to does not exist, it return false without error

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

Choose a reason for hiding this comment

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

sorry, maybe add similar comments into API definition too?

@jingxu97
Copy link
Contributor

jingxu97 commented Jun 4, 2021

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 4, 2021
@k8s-ci-robot k8s-ci-robot merged commit 6d16ceb into kubernetes-csi:master Jun 4, 2021
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/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. 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. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

Updates in the Filesystem v1beta2 API

4 participants