conlink 2.5.2 → 2.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,7 +7,7 @@ on:
7
7
  workflow_dispatch: {}
8
8
 
9
9
  jobs:
10
- compose-tests:
10
+ tests:
11
11
  runs-on: ubuntu-latest
12
12
  steps:
13
13
  - name: Checkout
@@ -22,3 +22,11 @@ jobs:
22
22
  - name: "dctest test/test*.yaml"
23
23
  timeout-minutes: 5
24
24
  run: time node_modules/.bin/dctest --verbose-commands conlink-test $(ls -v test/test*.yaml)
25
+
26
+ - name: Check --show-config and net2dot
27
+ run: |
28
+ cfg=$(./conlink --show-config --compose-file examples/test1-compose.yaml)
29
+ summary=$(echo "${cfg}" | jq -r '.|"\(.bridges|keys|sort|join(".")) \(.services|keys|sort|join("."))"')
30
+ [ "${summary}" = "s1.s2.s3 h1.h2.h3.r0" ]
31
+ dot=$(echo "${cfg}" | ./net2dot)
32
+ [ $(echo "${dot}" | grep "r0.*eth" | wc -l) -ge 10 ]
package/mdc CHANGED
@@ -30,7 +30,7 @@ RESOLVED_MODES="$(${RESOLVE_DEPS} --path "${MODES_DIR}" --format=paths ${MODE_SP
30
30
 
31
31
  COMPOSE_FILE=./.compose-empty.yaml
32
32
  cat /dev/null > ${ENV_FILE}-mdc-tmp
33
- echo -e "version: '2.4'\nservices: {}" > ./.compose-empty.yaml
33
+ echo -e "services: {}" > ./.compose-empty.yaml
34
34
 
35
35
  vecho "Removing ${MDC_FILES_DIR}"
36
36
  case "$(basename ${MDC_FILES_DIR})" in
package/net2dot.cljs CHANGED
@@ -57,11 +57,12 @@
57
57
  (let [graph (digraph {:splines true :compound true})
58
58
  host (subgraph graph "cluster_host" "host system" HOST-PROPS)
59
59
  conlink (subgraph host "cluster_conlink" "conlink/network" CONLINK-PROPS)
60
+ links (->> network-config :services vals (map :links) (apply concat))
60
61
  bridges (reduce
61
62
  #(->> (subgraph conlink (str "cluster_bridge_" %2)
62
63
  %2 BRIDGE-PROPS)
63
64
  (assoc %1 %2))
64
- {} (map :bridge (keep :bridge (:links network-config))))
65
+ {} (keys (:bridges network-config)))
65
66
  services (reduce
66
67
  #(->> (subgraph host (str "cluster_service_" (dot-id %2))
67
68
  (str "service '" (name %2) "'") SVC-PROPS)
@@ -73,7 +74,7 @@
73
74
  (assoc %1 %2))
74
75
  {} (keys (:containers network-config)))]
75
76
 
76
- (doseq [link (:links network-config)]
77
+ (doseq [link links]
77
78
  (let [{:keys [service container dev outer-dev bridge base]} link
78
79
  cname (or service container)
79
80
  cnode (get (if service services containers) (keyword cname))
@@ -85,7 +86,7 @@
85
86
  "-" (name dev)))
86
87
  out-id (str "out-" outer-dev)
87
88
  out-parent (condp = (keyword base)
88
- :conlink (get bridges (:bridge bridge))
89
+ :conlink (get bridges (keyword (:bridge bridge)))
89
90
  :host host)
90
91
  {:keys [type vlanid]} link
91
92
  [elabel iprops] (if (= "host" base)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conlink",
3
- "version": "2.5.2",
3
+ "version": "2.5.3",
4
4
  "description": "conlink - Declarative Low-Level Networking for Containers",
5
5
  "repository": "https://github.com/LonoCloud/conlink",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -906,7 +906,7 @@ General Options:
906
906
  docker-eth0-addresses (when docker-eth0? (intf-ipv4-addresses "eth0"))
907
907
  _ (swap! ctx merge {:kmod-ovs? kmod-ovs?
908
908
  :kmod-mirred? kmod-mirred?
909
- :docker-eth0? docker-eth0?
909
+ :docker-eth0? (or docker-eth0? show-config)
910
910
  :docker-eth0-address (first docker-eth0-addresses)})
911
911
  network-config (P/-> (load-configs compose-file network-file)
912
912
  (interpolate-walk env)
@@ -979,7 +979,9 @@ General Options:
979
979
  (P/let
980
980
  [event-filter {"event" ["start" "die"]}
981
981
  ;; Listen for docker and/or podman events
982
- _ (docker-listen client event-filter handle-event)
982
+ ;; NOTE: sometimes (podman on macos) this blocks
983
+ ;; until the first event. Wrap it to skip await.
984
+ _ [(docker-listen client event-filter handle-event)]
983
985
  containers ^obj (list-containers client)]
984
986
  ;; Generate fake events for existing containers
985
987
  (P/all (for [container containers