func GetAgentNetworkMode(ctx context.Context) (string, error) {
	cacheNetworkModeKey := cache.BuildAgentKey("networkMode")
	if cacheNetworkMode, found := cache.Cache.Get(cacheNetworkModeKey); found {
		return cacheNetworkMode.(string), nil
	}

	log.Debugf("GetAgentNetworkMode trying Docker")
	networkMode, err := docker.GetAgentContainerNetworkMode(ctx)
	cache.Cache.Set(cacheNetworkModeKey, networkMode, cache.NoExpiration)
	if err != nil {
		return networkMode, fmt.Errorf("could not detect agent network mode: %v", err)
	}
	log.Debugf("GetAgentNetworkMode: using network mode from Docker: %s", networkMode)
	return networkMode, nil
}
// GetAgentNetworkMode retrieves from Docker the network mode of the Agent container
GetAgentNetworkMode retrieves from Docker the network mode of the Agent container
// GetAgentNetworkMode retrieves from Docker the network mode of the Agent container
func GetAgentNetworkMode(ctx context.Context) (string, error) {
	cacheNetworkModeKey := cache.BuildAgentKey("networkMode")
	if cacheNetworkMode, found := cache.Cache.Get(cacheNetworkModeKey); found {
		return cacheNetworkMode.(string), nil
	}
	log.Debugf("GetAgentNetworkMode trying Docker")
	networkMode, err := docker.GetAgentContainerNetworkMode(ctx)
	cache.Cache.Set(cacheNetworkModeKey, networkMode, cache.NoExpiration)
	if err != nil {
		return networkMode, fmt.Errorf("could not detect agent network mode: %v", err)
	}
	log.Debugf("GetAgentNetworkMode: using network mode from Docker: %s", networkMode)
	return networkMode, nil
}
func GetAgentNetworkMode ( ctx context . Context ) ( string , error ) { cacheNetworkModeKey := cache . BuildAgentKey ( " " ) if cacheNetworkMode , found := cache . Cache . Get ( cacheNetworkModeKey ) ; found { return cacheNetworkMode . ( string ) , nil } log . Debugf ( " " ) networkMode , err := docker . GetAgentContainerNetworkMode ( ctx ) cache . Cache . Set ( cacheNetworkModeKey , networkMode , cache . NoExpiration ) if err != nil { return networkMode , fmt . Errorf ( " " , err ) } log . Debugf ( " " , networkMode ) return networkMode , nil }
GetAgentNetworkMode retrieves from Docker the network mode of the Agent container
GetAgentNetworkMode retrieves from Docker the network mode of the Agent container