Skip to content

Commit

Permalink
Add exception details to the toComposeNetwork log.
Browse files Browse the repository at this point in the history
Signed-off-by: liu.shiyu <[email protected]>
  • Loading branch information
shencangsheng committed Nov 6, 2024
1 parent eececb9 commit 7450820
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/compose/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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{
Expand Down

0 comments on commit 7450820

Please sign in to comment.