conlink 2.5.5 → 2.5.6

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.
@@ -35,3 +35,74 @@ jobs:
35
35
  [ "${summary}" = "s1.s2.s3 h1.h2.h3.r0" ]
36
36
  dot=$(echo "${cfg}" | ./net2dot)
37
37
  [ $(echo "${dot}" | grep "r0.*eth" | wc -l) -ge 10 ]
38
+
39
+ # Decide if a release is necessary, do any release linting/checks
40
+ check-release:
41
+ needs: [ tests ]
42
+ name: Check Release
43
+ runs-on: ubuntu-latest
44
+ if: startsWith(github.ref, 'refs/tags/v') && contains(github.ref, '.')
45
+ outputs:
46
+ RELEASE_VERSION: ${{ steps.get-version.outputs.RELEASE_VERSION }}
47
+ steps:
48
+ - name: Checkout Repository
49
+ uses: actions/checkout@v4
50
+ with: { submodules: 'recursive', fetch-depth: 0 }
51
+
52
+ - id: get-version
53
+ name: Get release version
54
+ run: |
55
+ echo "RELEASE_VERSION=$(jq -r .version package.json)" | tee "$GITHUB_ENV" | tee "$GITHUB_OUTPUT"
56
+
57
+ - name: Check git tag matches release version
58
+ run: |
59
+ [ "refs/tags/v${RELEASE_VERSION}" == "${{ github.ref }}" ]
60
+
61
+ release-npm:
62
+ needs: [ check-release ]
63
+ name: Release NPM
64
+ runs-on: ubuntu-latest
65
+ steps:
66
+ - name: Checkout Repository
67
+ uses: actions/checkout@v4
68
+ with: { submodules: 'recursive', fetch-depth: 0 }
69
+
70
+ # Setup .npmrc file to publish to npm
71
+ - uses: actions/setup-node@v4
72
+ with:
73
+ node-version: '20.x'
74
+ registry-url: 'https://registry.npmjs.org'
75
+ scope: ''
76
+
77
+ - run: npm publish
78
+ env:
79
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
80
+
81
+ release-docker-hub:
82
+ needs: [ check-release ]
83
+ name: Release Docker Hub
84
+ runs-on: ubuntu-latest
85
+ env:
86
+ RELEASE_VERSION: ${{ needs.check-release.outputs.RELEASE_VERSION }}
87
+ steps:
88
+ - name: Checkout Repository
89
+ uses: actions/checkout@v4
90
+ with: { submodules: 'recursive', fetch-depth: 0 }
91
+
92
+ - name: Login to Docker Hub
93
+ uses: docker/login-action@v3
94
+ with:
95
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
96
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
97
+
98
+ - name: Build and push
99
+ uses: docker/build-push-action@v6
100
+ with:
101
+ push: true
102
+ tags: lonocloud/conlink:${{ env.RELEASE_VERSION }}
103
+
104
+ - name: Build and push
105
+ uses: docker/build-push-action@v6
106
+ with:
107
+ push: true
108
+ tags: lonocloud/conlink:latest
package/Dockerfile CHANGED
@@ -1,7 +1,7 @@
1
1
  ###
2
2
  ### conlink build (ClojureScript)
3
3
  ###
4
- FROM node:16 AS cljs-build
4
+ FROM node:20 AS cljs-build
5
5
 
6
6
  RUN apt-get -y update && \
7
7
  apt-get -y install libpcap-dev default-jdk-headless
@@ -51,12 +51,12 @@ RUN cd /app/target/x86_64-unknown-linux-musl/release/ && cp -v wait copy echo /a
51
51
  ###
52
52
  ### conlink runtime stage
53
53
  ###
54
- FROM node:16-slim AS run
54
+ FROM node:20-slim AS run
55
55
 
56
56
  RUN apt-get -y update
57
57
  # Runtime deps and utilities
58
58
  RUN apt-get -y install libpcap-dev tcpdump iproute2 iputils-ping curl \
59
- iptables bridge-utils ethtool jq netcat socat \
59
+ iptables bridge-utils ethtool jq netcat-openbsd socat \
60
60
  openvswitch-switch openvswitch-testcontroller
61
61
 
62
62
  RUN mkdir -p /app /utils
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conlink",
3
- "version": "2.5.5",
3
+ "version": "2.5.6",
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",
package/rust/src/copy.rs CHANGED
@@ -9,6 +9,7 @@ use std::{
9
9
  io::{Read, Write},
10
10
  path::PathBuf,
11
11
  process::Command,
12
+ os::unix::process::CommandExt,
12
13
  };
13
14
  use clap::Parser;
14
15
 
@@ -93,12 +94,15 @@ fn main() -> Result<()> {
93
94
 
94
95
  // Execute command if provided
95
96
  if !opt.command.is_empty() {
97
+ if !which::which(&opt.command[0]).is_ok() {
98
+ eprintln!("Error: '{}' not found", opt.command[0]);
99
+ std::process::exit(1);
100
+ }
101
+ // Exec the command, replacing the current process
96
102
  println!("Running: {:?}", opt.command);
97
- let status = Command::new(&opt.command[0])
103
+ Command::new(&opt.command[0])
98
104
  .args(&opt.command[1..])
99
- .status()
100
- .context("Failed to execute command")?;
101
- std::process::exit(status.code().unwrap_or(1));
105
+ .exec();
102
106
  }
103
107
 
104
108
  Ok(())
package/rust/src/wait.rs CHANGED
@@ -39,9 +39,10 @@ fn main() {
39
39
  std::process::exit(1);
40
40
  }
41
41
  // Exec the command, replacing the current process
42
+ println!("Running: {:?}", command);
42
43
  Command::new(&command[0])
43
44
  .args(&command[1..])
44
- .exec(); // This replaces the current process and doesn't return
45
+ .exec();
45
46
  }
46
47
  return; // If no command is provided after '--', exit
47
48
  }