From 745082013a278640bc9c65ef218d7f86b9306dcb Mon Sep 17 00:00:00 2001 From: "liu.shiyu" Date: Wed, 6 Nov 2024 18:28:50 +0800 Subject: [PATCH] Add exception details to the toComposeNetwork log. Signed-off-by: liu.shiyu --- pkg/compose/generate.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/compose/generate.go b/pkg/compose/generate.go index 5f2d5436a5a..1d8fc9ba1e9 100644 --- a/pkg/compose/generate.go +++ b/pkg/compose/generate.go @@ -31,6 +31,8 @@ import ( "github.com/docker/docker/api/types/network" "golang.org/x/exp/maps" + + logrus "github.com/sirupsen/logrus" ) func (s *composeService) Generate(ctx context.Context, options api.GenerateOptions) (*types.Project, error) { @@ -222,6 +224,7 @@ func (s *composeService) toComposeNetwork(networks map[string]*network.EndpointS for name, net := range networks { inspect, err := s.apiClient().NetworkInspect(context.Background(), name, network.InspectOptions{}) if err != nil { + logrus.Warnf("Failed to inspect network %s: %v", name, err) networkConfigs[name] = types.NetworkConfig{} } else { networkConfigs[name] = types.NetworkConfig{