-
Notifications
You must be signed in to change notification settings - Fork 312
/
Copy pathflannel.yaml
105 lines (94 loc) · 3.23 KB
/
flannel.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
package:
name: flannel
version: "0.26.5"
epoch: 4
description: flannel is a network fabric for containers, designed for Kubernetes
copyright:
- license: Apache-2.0
environment:
contents:
packages:
- build-base
- busybox
- ca-certificates-bundle
- go
pipeline:
- uses: git-checkout
with:
repository: https://github.com/flannel-io/flannel
tag: v${{package.version}}
expected-commit: 0d1f8e28f5a6697629c7b39627b342ac48f09862
- uses: go/bump
with:
deps: |-
golang.org/x/oauth2@v0.27.0
golang.org/x/crypto@v0.35.0
golang.org/x/net@v0.36.0
# Build with CGO_ENABLED=1 to include the UDP backend
- runs: |
CGO_ENABLED=0
if [ "$(go env GOARCH)" = "amd64" ]; then
CGO_ENABLED=1
fi
CGO_ENABLED=$CGO_ENABLED go build -o "${{targets.destdir}}"/usr/bin/flanneld \
-ldflags "-extldflags \"-static\" -X github.com/flannel-io/flannel/pkg/version.Version=${{package.version}}"
update:
enabled: true
github:
identifier: flannel-io/flannel
strip-prefix: v
test:
environment:
contents:
packages:
- ${{package.name}}
- etcd
pipeline:
- name: "Test flanneld daemon output"
uses: test/daemon-check-output
with:
setup: |
#!/bin/sh -ex
# Start etcd in background with proper networking configuration
mkdir -p /tmp/etcd-data
etcd --data-dir=/tmp/etcd-data \
--listen-client-urls=http://127.0.0.1:2379 \
--advertise-client-urls=http://127.0.0.1:2379 > /tmp/etcd.log 2>&1 &
ETCD_PID=$!
# Ensure etcd is ready before proceeding
for i in 1 2 3 4 5; do
if etcdctl --endpoints=http://127.0.0.1:2379 endpoint status --write-out=table; then
break
fi
sleep 1
done
# Store flannel network config in etcd
printf "{\"Network\": \"10.244.0.0/16\", \"Backend\": {\"Type\": \"host-gw\"}}" > /tmp/flannel-config.json
etcdctl --endpoints=http://127.0.0.1:2379 put /coreos.com/network/config "$(cat /tmp/flannel-config.json)"
# Save PID for cleanup
echo "export ETCD_PID=$ETCD_PID" > /tmp/etcd_pid.sh
# Disable iptables to avoid permission issues in unprivileged test environments and focus testing on core networking capabilities
start: flanneld --etcd-endpoints=http://127.0.0.1:2379 --iface=eth0 --iptables-forward-rules=false
timeout: 10
expected_output: |
Created subnet manager
error_strings: |
"msg":"error connecting to etcd"
"level":"error" .* "could not create subnet manager"
"panic"
"fatal"
"Failed"
"Error: could not access etcd"
"error: could not allocate lease"
post: |
#!/bin/sh -ex
# Load etcd PID from setup phase
. /tmp/etcd_pid.sh
# Verify flannel created the proper subnet configuration
if [ ! -f /run/flannel/subnet.env ]; then
echo "Subnet file not found"
exit 1
fi
grep -q "FLANNEL_SUBNET=" /run/flannel/subnet.env
# Cleanup etcd process
kill $ETCD_PID || true