Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions internal/controller/nodeagent.go
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,10 @@ func (r *DataProtectionApplicationReconciler) customizeNodeAgentDaemonset(ds *ap
nodeAgentContainer.Args = append(nodeAgentContainer.Args, fmt.Sprintf("--log-format=%s", dpa.Spec.LogFormat))
}

if dpa.Spec.Configuration.Velero.LogLevel != "" {
nodeAgentContainer.Args = append(nodeAgentContainer.Args, fmt.Sprintf("--log-level=%s", dpa.Spec.Configuration.Velero.LogLevel))
}
Comment on lines +697 to +699
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR description references getInheritedPodInfo in pkg/exposer/image.go, but there is no pkg/exposer package (and no getInheritedPodInfo symbol) in this repository. Please update the PR description to point at the correct code path in this repo that consumes the node-agent --log-level arg, or clarify that it’s referring to an external component/repo.

Copilot uses AI. Check for mistakes.

// Apply unsupported server args from the specified ConfigMap.
// This will completely override any previously set args for the node-agent server.
// If the ConfigMap exists and is not empty, its key-value pairs will be used as the new CLI arguments.
Expand Down
24 changes: 24 additions & 0 deletions internal/controller/nodeagent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ type TestBuiltNodeAgentDaemonSetOptions struct {
dataMoverPrepareTimeout *string
resourceTimeout *string
logFormat *string
logLevel *string
toleration []corev1.Toleration
nodeSelector map[string]string
disableFsBackup *bool
Expand Down Expand Up @@ -568,6 +569,10 @@ func createTestBuiltNodeAgentDaemonSet(options TestBuiltNodeAgentDaemonSetOption
testBuiltNodeAgentDaemonSet.Spec.Template.Spec.Containers[0].Args = append(testBuiltNodeAgentDaemonSet.Spec.Template.Spec.Containers[0].Args, fmt.Sprintf("--log-format=%s", *options.logFormat))
}

if options.logLevel != nil {
testBuiltNodeAgentDaemonSet.Spec.Template.Spec.Containers[0].Args = append(testBuiltNodeAgentDaemonSet.Spec.Template.Spec.Containers[0].Args, fmt.Sprintf("--log-level=%s", *options.logLevel))
}

return testBuiltNodeAgentDaemonSet
}

Expand Down Expand Up @@ -783,6 +788,25 @@ func TestDPAReconciler_buildNodeAgentDaemonset(t *testing.T) {
logFormat: ptr.To("text"),
}),
},
{
name: "valid DPA CR with LogLevel set to debug, NodeAgent DaemonSet is built with LogLevel set to debug",
dpa: createTestDpaWith(
nil,
oadpv1alpha1.DataProtectionApplicationSpec{
Configuration: &oadpv1alpha1.ApplicationConfig{
Velero: &oadpv1alpha1.VeleroConfig{
LogLevel: "debug",
},
NodeAgent: &oadpv1alpha1.NodeAgentConfig{},
},
},
),
clientObjects: []client.Object{testGenericInfrastructure},
nodeAgentDaemonSet: testNodeAgentDaemonSet.DeepCopy(),
wantNodeAgentDaemonSet: createTestBuiltNodeAgentDaemonSet(TestBuiltNodeAgentDaemonSetOptions{
logLevel: ptr.To("debug"),
}),
},
{
name: "valid DPA CR with DataMoverPrepareTimeout and ResourceTimeout, NodeAgent DaemonSet is built with DataMoverPrepareTimeout and ResourceTimeout",
dpa: createTestDpaWith(
Expand Down
Loading