Skip to content

Commit

Permalink
feat: propagate the err message from getNetDelegate
Browse files Browse the repository at this point in the history
propagate the err message from getNetDelegate, and log the error in the error message,
we don't want to lose the err here
  • Loading branch information
xujihui1985 committed Dec 21, 2023
1 parent acfbd42 commit 0b1b1c6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/k8sclient/k8sclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (
nettypes "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1"
netclient "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/client/clientset/versioned/typed/k8s.cni.cncf.io/v1"
netutils "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/utils"

"gopkg.in/k8snetworkplumbingwg/multus-cni.v4/pkg/kubeletclient"
"gopkg.in/k8snetworkplumbingwg/multus-cni.v4/pkg/logging"
"gopkg.in/k8snetworkplumbingwg/multus-cni.v4/pkg/types"
Expand Down Expand Up @@ -541,7 +542,7 @@ func GetDefaultNetworks(pod *v1.Pod, conf *types.NetConf, kubeClient *ClientInfo
delegate, resourceMap, err := getNetDelegate(kubeClient, pod, conf.ClusterNetwork, conf.ConfDir, conf.MultusNamespace, resourceMap)

if err != nil {
return resourceMap, logging.Errorf("GetDefaultNetworks: failed to get clusterNetwork %s in namespace %s", conf.ClusterNetwork, conf.MultusNamespace)
return resourceMap, logging.Errorf("GetDefaultNetworks: failed to get clusterNetwork %s in namespace %s: %v", conf.ClusterNetwork, conf.MultusNamespace, err)
}
delegate.MasterPlugin = true
delegates = append(delegates, delegate)
Expand Down

0 comments on commit 0b1b1c6

Please sign in to comment.