From 9796da389d7ade6af35cce20be04fa282beb3695 Mon Sep 17 00:00:00 2001 From: Lyndon-Li Date: Fri, 30 Jan 2026 16:15:41 +0800 Subject: [PATCH] ignore cache volume config when backup repo config is not provided Signed-off-by: Lyndon-Li --- pkg/cmd/cli/nodeagent/server.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pkg/cmd/cli/nodeagent/server.go b/pkg/cmd/cli/nodeagent/server.go index 285c5271d..74e003572 100644 --- a/pkg/cmd/cli/nodeagent/server.go +++ b/pkg/cmd/cli/nodeagent/server.go @@ -340,20 +340,16 @@ func (s *nodeAgentServer) run() { } } + var cachePVCConfig *velerotypes.CachePVC if s.dataPathConfigs != nil && s.dataPathConfigs.CachePVCConfig != nil { if err := s.validateCachePVCConfig(*s.dataPathConfigs.CachePVCConfig); err != nil { s.logger.WithError(err).Warnf("Ignore cache config %v", s.dataPathConfigs.CachePVCConfig) } else { + cachePVCConfig = s.dataPathConfigs.CachePVCConfig s.logger.Infof("Using cache volume configs %v", s.dataPathConfigs.CachePVCConfig) } } - var cachePVCConfig *velerotypes.CachePVC - if s.dataPathConfigs != nil && s.dataPathConfigs.CachePVCConfig != nil { - cachePVCConfig = s.dataPathConfigs.CachePVCConfig - s.logger.Infof("Using customized cachePVC config %v", cachePVCConfig) - } - var podLabels map[string]string if s.dataPathConfigs != nil && len(s.dataPathConfigs.PodLabels) > 0 { podLabels = s.dataPathConfigs.PodLabels @@ -368,6 +364,8 @@ func (s *nodeAgentServer) run() { if s.backupRepoConfigs != nil { s.logger.Infof("Using backup repo config %v", s.backupRepoConfigs) + } else if cachePVCConfig != nil { + s.logger.Info("Backup repo config is not provided, using default values for cache volume configs") } pvbReconciler := controller.NewPodVolumeBackupReconciler(