Skip to content
This repository has been archived by the owner on Mar 2, 2022. It is now read-only.

Commit

Permalink
Use error wrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Beck committed Oct 23, 2020
1 parent 73193b6 commit a47e127
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kubernetes/pod_exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func PodExec(pod BackupPod, log logr.Logger) (*ExecData, error) {
config, _ := getClientConfig()
k8sclient, err := kubernetes.NewForConfig(config)
if err != nil {
return nil, fmt.Errorf("can't create k8s for exec: %v", err)
return nil, fmt.Errorf("can't create k8s for exec: %w", err)
}

req := k8sclient.CoreV1().RESTClient().Post().
Expand All @@ -38,7 +38,7 @@ func PodExec(pod BackupPod, log logr.Logger) (*ExecData, error) {
SubResource("exec")
scheme := runtime.NewScheme()
if err := apiv1.AddToScheme(scheme); err != nil {
return nil, fmt.Errorf("can't add runtime scheme: %v", err)
return nil, fmt.Errorf("can't add runtime scheme: %w", err)
}

command := qsplit.ToStrings([]byte(pod.Command))
Expand Down

0 comments on commit a47e127

Please # to comment.