generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 960
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Refactor Fluid CSI Plugin Signed-off-by: TrafalgarZZZ <[email protected]> * Go fmt Signed-off-by: TrafalgarZZZ <[email protected]> * Option to enable fuse mount point recovery Signed-off-by: TrafalgarZZZ <[email protected]> * Refactor Fluid CSI Plugin - Move package 'mountinfo' to utils - Move package 'fuse' to plugin - Add registry functions Signed-off-by: TrafalgarZZZ <[email protected]> * Minor fix for fuse recover period Signed-off-by: TrafalgarZZZ <[email protected]> * Remove duplicate license Signed-off-by: TrafalgarZZZ <[email protected]> * Declare registraion funcs to enable/disable feature gates Signed-off-by: TrafalgarZZZ <[email protected]> * Add tests Signed-off-by: TrafalgarZZZ <[email protected]> * Add tests Signed-off-by: TrafalgarZZZ <[email protected]> * Fix copyright Signed-off-by: TrafalgarZZZ <[email protected]>
- Loading branch information
1 parent
02a5698
commit 935578a
Showing
14 changed files
with
407 additions
and
115 deletions.
There are no files selected for viewing
This file contains 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 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,23 @@ | ||
/* | ||
Copyright 2022 The Fluid Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package config | ||
|
||
type Config struct { | ||
NodeId string | ||
Endpoint string | ||
RecoverFusePeriod int | ||
} |
This file contains 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 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 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 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,38 @@ | ||
/* | ||
Copyright 2022 The Fluid Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package plugins | ||
|
||
import ( | ||
"github.com/fluid-cloudnative/fluid/pkg/csi/config" | ||
"sigs.k8s.io/controller-runtime/pkg/manager" | ||
) | ||
|
||
// Register initializes the csi driver and registers it to the controller manager. | ||
func Register(mgr manager.Manager, cfg config.Config) error { | ||
csiDriver := NewDriver(cfg.NodeId, cfg.Endpoint, mgr.GetClient()) | ||
|
||
if err := mgr.Add(csiDriver); err != nil { | ||
return err | ||
} | ||
|
||
return nil | ||
} | ||
|
||
// Enabled checks if the csi driver should be enabled. | ||
func Enabled(cfg config.Config) bool { | ||
return true | ||
} |
Oops, something went wrong.