"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "pkg/volume/azure_file/azure_file.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_file.go  (kubernetes-1.18.14):azure_file.go  (kubernetes-1.18.15)
skipping to change at line 58 skipping to change at line 58
type azureFilePlugin struct { type azureFilePlugin struct {
host volume.VolumeHost host volume.VolumeHost
} }
var _ volume.VolumePlugin = &azureFilePlugin{} var _ volume.VolumePlugin = &azureFilePlugin{}
var _ volume.PersistentVolumePlugin = &azureFilePlugin{} var _ volume.PersistentVolumePlugin = &azureFilePlugin{}
var _ volume.ExpandableVolumePlugin = &azureFilePlugin{} var _ volume.ExpandableVolumePlugin = &azureFilePlugin{}
const ( const (
azureFilePluginName = "kubernetes.io/azure-file" azureFilePluginName = "kubernetes.io/azure-file"
defaultSecretNamespace = "default"
) )
func getPath(uid types.UID, volName string, host volume.VolumeHost) string { func getPath(uid types.UID, volName string, host volume.VolumeHost) string {
return host.GetPodVolumeDir(uid, utilstrings.EscapeQualifiedName(azureFil ePluginName), volName) return host.GetPodVolumeDir(uid, utilstrings.EscapeQualifiedName(azureFil ePluginName), volName)
} }
func (plugin *azureFilePlugin) Init(host volume.VolumeHost) error { func (plugin *azureFilePlugin) Init(host volume.VolumeHost) error {
plugin.host = host plugin.host = host
return nil return nil
} }
skipping to change at line 118 skipping to change at line 119
func (plugin *azureFilePlugin) NewMounter(spec *volume.Spec, pod *v1.Pod, _ volu me.VolumeOptions) (volume.Mounter, error) { func (plugin *azureFilePlugin) NewMounter(spec *volume.Spec, pod *v1.Pod, _ volu me.VolumeOptions) (volume.Mounter, error) {
return plugin.newMounterInternal(spec, pod, &azureSvc{}, plugin.host.GetM ounter(plugin.GetPluginName())) return plugin.newMounterInternal(spec, pod, &azureSvc{}, plugin.host.GetM ounter(plugin.GetPluginName()))
} }
func (plugin *azureFilePlugin) newMounterInternal(spec *volume.Spec, pod *v1.Pod , util azureUtil, mounter mount.Interface) (volume.Mounter, error) { func (plugin *azureFilePlugin) newMounterInternal(spec *volume.Spec, pod *v1.Pod , util azureUtil, mounter mount.Interface) (volume.Mounter, error) {
share, readOnly, err := getVolumeSource(spec) share, readOnly, err := getVolumeSource(spec)
if err != nil { if err != nil {
return nil, err return nil, err
} }
secretName, secretNamespace, err := getSecretNameAndNamespace(spec, pod.N amespace) secretName, secretNamespace, err := getSecretNameAndNamespace(spec, defau ltSecretNamespace)
if err != nil { if err != nil {
// Log-and-continue instead of returning an error for now // Log-and-continue instead of returning an error for now
// due to unspecified backwards compatibility concerns (a subject to revise) // due to unspecified backwards compatibility concerns (a subject to revise)
klog.Errorf("get secret name and namespace from pod(%s) return wi th error: %v", pod.Name, err) klog.Errorf("get secret name and namespace from pod(%s) return wi th error: %v", pod.Name, err)
} }
return &azureFileMounter{ return &azureFileMounter{
azureFile: &azureFile{ azureFile: &azureFile{
volName: spec.Name(), volName: spec.Name(),
mounter: mounter, mounter: mounter,
pod: pod, pod: pod,
skipping to change at line 173 skipping to change at line 174
if spec.PersistentVolume == nil || spec.PersistentVolume.Spec.AzureFile = = nil { if spec.PersistentVolume == nil || spec.PersistentVolume.Spec.AzureFile = = nil {
return oldSize, fmt.Errorf("invalid PV spec") return oldSize, fmt.Errorf("invalid PV spec")
} }
shareName := spec.PersistentVolume.Spec.AzureFile.ShareName shareName := spec.PersistentVolume.Spec.AzureFile.ShareName
azure, err := getAzureCloudProvider(plugin.host.GetCloudProvider()) azure, err := getAzureCloudProvider(plugin.host.GetCloudProvider())
if err != nil { if err != nil {
return oldSize, err return oldSize, err
} }
secretName, secretNamespace, err := getSecretNameAndNamespace(spec, spec. PersistentVolume.Spec.ClaimRef.Namespace) secretName, secretNamespace, err := getSecretNameAndNamespace(spec, defau ltSecretNamespace)
if err != nil { if err != nil {
return oldSize, err return oldSize, err
} }
accountName, accountKey, err := (&azureSvc{}).GetAzureCredentials(plugin. host, secretNamespace, secretName) accountName, accountKey, err := (&azureSvc{}).GetAzureCredentials(plugin. host, secretNamespace, secretName)
if err != nil { if err != nil {
return oldSize, err return oldSize, err
} }
if err := azure.ResizeFileShare(accountName, accountKey, shareName, int(v olumehelpers.RoundUpToGiB(newSize))); err != nil { if err := azure.ResizeFileShare(accountName, accountKey, shareName, int(v olumehelpers.RoundUpToGiB(newSize))); err != nil {
 End of changes. 3 change blocks. 
3 lines changed or deleted 4 lines changed or added

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