diff --git a/go.mod b/go.mod index f47228e6ab..b67f8bf825 100644 --- a/go.mod +++ b/go.mod @@ -11,6 +11,7 @@ require ( github.com/Azure/go-autorest/autorest v0.11.29 github.com/Azure/go-autorest/autorest/mocks v0.4.2 github.com/container-storage-interface/spec v1.9.0 + github.com/fsnotify/fsnotify v1.8.0 github.com/golang/protobuf v1.5.4 github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1 github.com/kubernetes-csi/csi-lib-utils v0.17.0 @@ -80,7 +81,6 @@ require ( github.com/distribution/reference v0.5.0 // indirect github.com/emicklei/go-restful/v3 v3.12.1 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/fxamacker/cbor/v2 v2.7.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect diff --git a/pkg/azureutils/azure_disk_utils.go b/pkg/azureutils/azure_disk_utils.go index 9043cf156b..c77426466f 100644 --- a/pkg/azureutils/azure_disk_utils.go +++ b/pkg/azureutils/azure_disk_utils.go @@ -248,6 +248,7 @@ func GetCloudProviderFromClient(ctx context.Context, kubeClient clientset.Interf if len(config.AADClientCertPath) > 0 { // Watch the certificate for changes; if the certificate changes, the pod will be restarted err = filewatcher.WatchFileForChanges(config.AADClientCertPath) + klog.Warningf("Failed to watch certificate file for changes: %v", err) } if err = az.InitializeCloudFromConfig(ctx, config, fromSecret, false); err != nil { klog.Warningf("InitializeCloudFromConfig failed with error: %v", err) diff --git a/pkg/filewatcher/filewatcher.go b/pkg/filewatcher/filewatcher.go index 9c4e8d1445..9638d5278a 100644 --- a/pkg/filewatcher/filewatcher.go +++ b/pkg/filewatcher/filewatcher.go @@ -1,3 +1,19 @@ +/* +Copyright 2024 The Kubernetes 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 filewatcher import (