-
Notifications
You must be signed in to change notification settings - Fork 11
Add GRPC Support to Mount and UnMount s3fs and rclone both #154
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
Open
ashimagarg27
wants to merge
61
commits into
main
Choose a base branch
from
grpc-01
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
61 commits
Select commit
Hold shift + click to select a range
373a098
update go.mod
ashimagarg27 ee7638b
cos apis
ashimagarg27 217aa92
cos apis
ashimagarg27 8b356b0
unmounting...
ashimagarg27 332a995
comments uts
ashimagarg27 26af783
cos apis
ashimagarg27 fdaed43
cos apis
ashimagarg27 88f3d1d
Merge branch 'main' into grpc-01
ashimagarg27 89c4f44
fix travis
ashimagarg27 1ff180f
cos apis
ashimagarg27 6edc289
cos apis
ashimagarg27 eef5704
cos apis
ashimagarg27 c4fd5d0
cos apis
ashimagarg27 aea5145
cos apis
ashimagarg27 97b8625
cos apis
ashimagarg27 e71c592
rebase branch and resolve conflicts
ashimagarg27 2bf8745
cos apis
ashimagarg27 0fe4a38
cos apis
ashimagarg27 58213fa
cos apis
ashimagarg27 5660a2d
cos apis
ashimagarg27 a5fee80
comment uts
ashimagarg27 263daa0
comment unused code
ashimagarg27 6680d77
rebase branch and resolve conflicts
ashimagarg27 78d1194
comment unused code
ashimagarg27 210dce2
fix backoff
ashimagarg27 41d7150
fix backoff
ashimagarg27 3397d3f
cos apis
ashimagarg27 23c5c6c
fix unmounting...
ashimagarg27 1c02d4b
fix travis
ashimagarg27 2b6c3d7
fix travis
ashimagarg27 179dd83
Merge branch 'main' into grpc-01
ashimagarg27 5a870d2
Grpc 02 (#161)
ashimagarg27 5f9fb24
fix rclone config path
ashimagarg27 f6137ce
resolve merge conflicts and rebase branch
ashimagarg27 0457fc5
update go.mod and go version
ashimagarg27 229e54b
map http codes to grpc
ashimagarg27 3e62a3b
Merge pull request #174 from IBM/add-latency
Bhagyashreek8 fb886bb
remove password file after unmounting
ashimagarg27 e5260ce
remove password file after unmounting
ashimagarg27 c6e7f7d
remove password file after unmounting
ashimagarg27 b560fbc
remove password file after unmounting
ashimagarg27 aee92e7
remove password file after unmounting
ashimagarg27 1c5a135
remove password file after unmounting
ashimagarg27 e1a19a0
remove password file after unmounting
ashimagarg27 e319f21
Merge pull request #175 from IBM/cleanup
ashimagarg27 62f3c8d
resolve merge conflicts and rebase branch
ashimagarg27 f900a56
update go.mod
ashimagarg27 5bc1c12
add isGRPCServerAvailable check
ashimagarg27 25482f7
fix travis
ashimagarg27 ccad2be
Merge branch 'main' into grpc-01
ashimagarg27 2f509da
Fix for mount getting stuck forever (#177)
mssachan 9942cd6
cos apis
ashimagarg27 121051f
Merge branch 'main' into grpc-01
ashimagarg27 e6182ec
remove unnecessary leading newline to fix linter
Bhagyashreek8 72a1fd9
Update COS CSI config path & socket path (#183)
mssachan fc07742
resolve merge conflicts and rebase branch
ashimagarg27 2f09b33
run livenessProbe container as non-root user (#185)
Bhagyashreek8 912ad73
resolve merge conflicts and rebase branch
ashimagarg27 44d094d
Merge branch 'main' into grpc-01
ashimagarg27 fe68470
address review comments
ashimagarg27 15428ab
address review comments
ashimagarg27 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/******************************************************************************* | ||
* IBM Confidential | ||
* OCO Source Materials | ||
* IBM Cloud Kubernetes Service, 5737-D43 | ||
* (C) Copyright IBM Corp. 2023 All Rights Reserved. | ||
* The source code for this program is not published or otherwise divested of | ||
* its trade secrets, irrespective of what has been deposited with | ||
* the U.S. Copyright Office. | ||
******************************************************************************/ | ||
|
||
package driver | ||
|
||
//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate | ||
|
||
import ( | ||
"os" | ||
"strconv" | ||
|
||
"go.uber.org/zap" | ||
) | ||
|
||
const ( | ||
filePermission = 0660 | ||
) | ||
|
||
//counterfeiter:generate . socketPermission | ||
|
||
// socketPermission represents file system operations | ||
type socketPermission interface { | ||
Chown(name string, uid, gid int) error | ||
Chmod(name string, mode os.FileMode) error | ||
} | ||
|
||
// realSocketPermission implements socketPermission | ||
type opsSocketPermission struct{} | ||
|
||
func (f *opsSocketPermission) Chown(name string, uid, gid int) error { | ||
return os.Chown(name, uid, gid) | ||
} | ||
|
||
func (f *opsSocketPermission) Chmod(name string, mode os.FileMode) error { | ||
return os.Chmod(name, mode) | ||
} | ||
|
||
// setupSidecar updates owner/group and permission of the file given(addr) | ||
func setupSidecar(addr string, ops socketPermission, logger *zap.Logger) error { | ||
groupSt := os.Getenv("SIDECAR_GROUP_ID") | ||
|
||
logger.Info("Setting owner and permissions of csi socket file. SIDECAR_GROUP_ID env must match the 'livenessprobe' sidecar container groupID for csi socket connection.") | ||
|
||
// If env is not set, set default to 0 | ||
if groupSt == "" { | ||
logger.Warn("Unable to fetch SIDECAR_GROUP_ID environment variable. Sidecar container(s) might fail...") | ||
groupSt = "0" | ||
} | ||
|
||
group, err := strconv.Atoi(groupSt) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
// Change group of csi socket to non-root user for enabling the csi sidecar | ||
if err := ops.Chown(addr, -1, group); err != nil { | ||
return err | ||
} | ||
|
||
// Modify permissions of csi socket | ||
// Only the users and the group owners will have read/write access to csi socket | ||
if err := ops.Chmod(addr, filePermission); err != nil { | ||
return err | ||
} | ||
|
||
logger.Info("Successfully set owner and permissions of csi socket file.") | ||
|
||
return nil | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.