mirror of
https://github.com/TECHNOFAB11/zfs-localpv.git
synced 2025-12-13 23:03:57 +01:00
refact(deps): bump k8s and client-go deps to version v0.20.2 (#294)
Signed-off-by: prateekpandey14 <prateek.pandey@mayadata.io>
This commit is contained in:
parent
533e17a9aa
commit
b1aa6ab51a
2196 changed files with 306727 additions and 251810 deletions
29
vendor/github.com/openebs/lib-csi/pkg/common/helpers/helpers.go
generated
vendored
29
vendor/github.com/openebs/lib-csi/pkg/common/helpers/helpers.go
generated
vendored
|
|
@ -17,7 +17,10 @@ limitations under the License.
|
|||
package helpers
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
// GetCaseInsensitiveMap coercs the map's keys to lower case, which only works
|
||||
|
|
@ -43,3 +46,29 @@ func GetInsensitiveParameter(dict *map[string]string, key string) string {
|
|||
insensitiveDict := GetCaseInsensitiveMap(dict)
|
||||
return insensitiveDict[strings.ToLower(key)]
|
||||
}
|
||||
|
||||
func exists(path string) (os.FileInfo, bool) {
|
||||
info, err := os.Stat(path)
|
||||
if os.IsNotExist(err) {
|
||||
return nil, false
|
||||
}
|
||||
return info, true
|
||||
}
|
||||
|
||||
// FileExists checks if a file exists and is not a directory
|
||||
func FileExists(filepath string) bool {
|
||||
info, present := exists(filepath)
|
||||
return present && info.Mode().IsRegular()
|
||||
}
|
||||
|
||||
// DirExists checks if a directory exists
|
||||
func DirExists(path string) bool {
|
||||
info, present := exists(path)
|
||||
return present && info.IsDir()
|
||||
}
|
||||
|
||||
// IsValidUUID validates whether a string is a valid UUID
|
||||
func IsValidUUID(u string) bool {
|
||||
_, err := uuid.Parse(u)
|
||||
return err == nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue