"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "pkg/volume/azure_file/azure_util.go" between
kubernetes-1.18.14.tar.gz and kubernetes-1.18.15.tar.gz

About: Kubernetes is a platform for automating deployment, scaling, and operations of application containers across clusters of hosts (written in "Go"). 1.18.x series.

azure_util.go  (kubernetes-1.18.14):azure_util.go  (kubernetes-1.18.15)
skipping to change at line 37 skipping to change at line 37
"k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/volume" "k8s.io/kubernetes/pkg/volume"
) )
const ( const (
fileMode = "file_mode" fileMode = "file_mode"
dirMode = "dir_mode" dirMode = "dir_mode"
gid = "gid" gid = "gid"
vers = "vers" vers = "vers"
actimeo = "actimeo"
mfsymlinks = "mfsymlinks"
defaultFileMode = "0777" defaultFileMode = "0777"
defaultDirMode = "0777" defaultDirMode = "0777"
defaultVers = "3.0" defaultVers = "3.0"
defaultActimeo = "30"
) )
// Abstract interface to azure file operations. // Abstract interface to azure file operations.
type azureUtil interface { type azureUtil interface {
GetAzureCredentials(host volume.VolumeHost, nameSpace, secretName string) (string, string, error) GetAzureCredentials(host volume.VolumeHost, nameSpace, secretName string) (string, string, error)
SetAzureCredentials(host volume.VolumeHost, nameSpace, accountName, accou ntKey string) (string, error) SetAzureCredentials(host volume.VolumeHost, nameSpace, accountName, accou ntKey string) (string, error)
} }
type azureSvc struct{} type azureSvc struct{}
skipping to change at line 109 skipping to change at line 112
} }
return secretName, err return secretName, err
} }
// check whether mountOptions contain file_mode, dir_mode, vers, gid, if not, ap pend default mode // check whether mountOptions contain file_mode, dir_mode, vers, gid, if not, ap pend default mode
func appendDefaultMountOptions(mountOptions []string, fsGroup *int64) []string { func appendDefaultMountOptions(mountOptions []string, fsGroup *int64) []string {
fileModeFlag := false fileModeFlag := false
dirModeFlag := false dirModeFlag := false
versFlag := false versFlag := false
gidFlag := false gidFlag := false
actimeoFlag := false
mfsymlinksFlag := false
for _, mountOption := range mountOptions { for _, mountOption := range mountOptions {
if strings.HasPrefix(mountOption, fileMode) { if strings.HasPrefix(mountOption, fileMode) {
fileModeFlag = true fileModeFlag = true
} }
if strings.HasPrefix(mountOption, dirMode) { if strings.HasPrefix(mountOption, dirMode) {
dirModeFlag = true dirModeFlag = true
} }
if strings.HasPrefix(mountOption, vers) { if strings.HasPrefix(mountOption, vers) {
versFlag = true versFlag = true
} }
if strings.HasPrefix(mountOption, gid) { if strings.HasPrefix(mountOption, gid) {
gidFlag = true gidFlag = true
} }
if strings.HasPrefix(mountOption, actimeo) {
actimeoFlag = true
}
if strings.HasPrefix(mountOption, mfsymlinks) {
mfsymlinksFlag = true
}
} }
allMountOptions := mountOptions allMountOptions := mountOptions
if !fileModeFlag { if !fileModeFlag {
allMountOptions = append(allMountOptions, fmt.Sprintf("%s=%s", fi leMode, defaultFileMode)) allMountOptions = append(allMountOptions, fmt.Sprintf("%s=%s", fi leMode, defaultFileMode))
} }
if !dirModeFlag { if !dirModeFlag {
allMountOptions = append(allMountOptions, fmt.Sprintf("%s=%s", di rMode, defaultDirMode)) allMountOptions = append(allMountOptions, fmt.Sprintf("%s=%s", di rMode, defaultDirMode))
} }
if !versFlag { if !versFlag {
allMountOptions = append(allMountOptions, fmt.Sprintf("%s=%s", ve rs, defaultVers)) allMountOptions = append(allMountOptions, fmt.Sprintf("%s=%s", ve rs, defaultVers))
} }
if !gidFlag && fsGroup != nil { if !gidFlag && fsGroup != nil {
allMountOptions = append(allMountOptions, fmt.Sprintf("%s=%d", gi d, *fsGroup)) allMountOptions = append(allMountOptions, fmt.Sprintf("%s=%d", gi d, *fsGroup))
} }
if !actimeoFlag {
allMountOptions = append(allMountOptions, fmt.Sprintf("%s=%s", ac
timeo, defaultActimeo))
}
if !mfsymlinksFlag {
allMountOptions = append(allMountOptions, mfsymlinks)
}
return allMountOptions return allMountOptions
} }
 End of changes. 5 change blocks. 
0 lines changed or deleted 20 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)