Skip to content

Commit 4e8055e

Browse files
authored
Merge pull request #5199 from canonical/KU-3989/update-base-to-core22
chore: update base to core22
2 parents c9ee853 + 0cf7d86 commit 4e8055e

File tree

19 files changed

+79
-65
lines changed

19 files changed

+79
-65
lines changed

microk8s-resources/actions/common/utils.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,7 +1194,7 @@ fetch_as() {
11941194
ARCH="$($SNAP/bin/uname -m)"
11951195
LD_LIBRARY_PATH="$SNAP/lib:$SNAP/usr/lib:$SNAP/lib/$ARCH-linux-gnu:$SNAP/usr/lib/$ARCH-linux-gnu" "${SNAP}/usr/bin/curl" -L $1 -o $2
11961196
else
1197-
CA_CERT=/snap/core20/current/etc/ssl/certs/ca-certificates.crt
1197+
CA_CERT=/snap/core22/current/etc/ssl/certs/ca-certificates.crt
11981198
run_with_sudo "${SNAP}/usr/bin/curl" --cacert $CA_CERT -L $1 -o $2
11991199
fi
12001200
}
@@ -1371,7 +1371,7 @@ use_snap_env() {
13711371
# Configure PATH, LD_LIBRARY_PATH and PYTHONPATH
13721372
export PATH="$SNAP/usr/bin:$SNAP/bin:$SNAP/usr/sbin:$SNAP/sbin:$REAL_PATH"
13731373
export LD_LIBRARY_PATH="$SNAP_LIBRARY_PATH:$SNAP/lib:$SNAP/usr/lib:$SNAP/lib/$SNAPCRAFT_ARCH_TRIPLET:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/ceph:${REAL_LD_LIBRARY_PATH:-}"
1374-
export PYTHONPATH="$SNAP/usr/lib/python3.8:$SNAP/lib/python3.8/site-packages:$SNAP/usr/lib/python3/dist-packages"
1374+
export PYTHONPATH="$SNAP/usr/lib/python3.10:$SNAP/lib/python3.10/site-packages:$SNAP/usr/lib/python3/dist-packages"
13751375

13761376
# Python configuration
13771377
export PYTHONNOUSERSITE=false

scripts/inspect.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ function suggest_fixes {
220220
printf -- 'The change can be made persistent with: sudo apt-get install iptables-persistent\n'
221221
fi
222222

223-
if ! is_strict && [ /snap/core20/current/usr/bin/which ufw &> /dev/null ]
223+
if ! is_strict && [ /snap/core22/current/usr/bin/which ufw &> /dev/null ]
224224
then
225225
if ufw status | grep -q "Status: active"
226226
then

snap/snapcraft.yaml

Lines changed: 57 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,22 @@ description: |-
1010
license: Apache-2.0
1111
grade: stable
1212
confinement: classic
13-
base: core20
13+
base: core22
1414
assumes: [snapd2.52]
1515
environment:
1616
REAL_PATH: $PATH
1717
REAL_LD_LIBRARY_PATH: $LD_LIBRARY_PATH
1818
REAL_PYTHONPATH: $PYTHONPATH
19-
SNAPCRAFT_ARCH_TRIPLET: $SNAPCRAFT_ARCH_TRIPLET
19+
SNAPCRAFT_ARCH_TRIPLET: $CRAFT_ARCH_TRIPLET
2020

2121
parts:
2222
build-deps:
2323
plugin: nil
2424
build-snaps:
2525
- go/1.24/stable
26+
build-attributes: [enable-patchelf]
2627
build-packages:
28+
- sudo
2729
- autoconf
2830
- automake
2931
- autopoint
@@ -50,38 +52,44 @@ parts:
5052
k8s-dqlite:
5153
after: [build-deps]
5254
source: build-scripts/components/k8s-dqlite
55+
build-attributes: [enable-patchelf]
5356
plugin: nil
54-
override-build: $SNAPCRAFT_PROJECT_DIR/build-scripts/build-component.sh k8s-dqlite
57+
override-build: $CRAFT_PROJECT_DIR/build-scripts/build-component.sh k8s-dqlite
5558

5659
etcd:
5760
after: [build-deps]
5861
plugin: nil
5962
source: build-scripts/components/etcd
60-
override-build: $SNAPCRAFT_PROJECT_DIR/build-scripts/build-component.sh etcd
63+
build-attributes: [enable-patchelf]
64+
override-build: $CRAFT_PROJECT_DIR/build-scripts/build-component.sh etcd
6165

6266
cni:
6367
after: [build-deps]
6468
plugin: nil
6569
source: build-scripts/components/cni
66-
override-build: $SNAPCRAFT_PROJECT_DIR/build-scripts/build-component.sh cni
70+
build-attributes: [enable-patchelf]
71+
override-build: $CRAFT_PROJECT_DIR/build-scripts/build-component.sh cni
6772

6873
flannel-cni-plugin:
6974
after: [build-deps]
7075
plugin: nil
7176
source: build-scripts/components/flannel-cni-plugin
72-
override-build: $SNAPCRAFT_PROJECT_DIR/build-scripts/build-component.sh flannel-cni-plugin
77+
build-attributes: [enable-patchelf]
78+
override-build: $CRAFT_PROJECT_DIR/build-scripts/build-component.sh flannel-cni-plugin
7379

7480
flanneld:
7581
after: [build-deps]
7682
plugin: nil
7783
source: build-scripts/components/flanneld
78-
override-build: $SNAPCRAFT_PROJECT_DIR/build-scripts/build-component.sh flanneld
84+
build-attributes: [enable-patchelf]
85+
override-build: $CRAFT_PROJECT_DIR/build-scripts/build-component.sh flanneld
7986

8087
kubernetes:
8188
after: [build-deps]
8289
plugin: nil
8390
source: build-scripts/components/kubernetes
84-
override-build: $SNAPCRAFT_PROJECT_DIR/build-scripts/build-component.sh kubernetes
91+
build-attributes: [enable-patchelf]
92+
override-build: $CRAFT_PROJECT_DIR/build-scripts/build-component.sh kubernetes
8593

8694
kubernetes-version:
8795
plugin: nil
@@ -92,31 +100,34 @@ parts:
92100
after: [build-deps]
93101
plugin: nil
94102
source: build-scripts/components/helm
95-
override-build: $SNAPCRAFT_PROJECT_DIR/build-scripts/build-component.sh helm
103+
override-build: $CRAFT_PROJECT_DIR/build-scripts/build-component.sh helm
96104

97105
libmnl:
98106
after: [build-deps]
99107
plugin: autotools
100108
source: https://www.netfilter.org/pub/libmnl/libmnl-1.0.5.tar.bz2
109+
build-attributes: [enable-patchelf]
101110
prime:
102111
- -usr/local/include
103112

104113
libnftnl:
105114
after: [libmnl]
106115
plugin: autotools
107116
source: https://www.netfilter.org/projects/libnftnl/files/libnftnl-1.1.8.tar.bz2
117+
build-attributes: [enable-patchelf]
108118
build-environment:
109-
- LIBMNL_LIBS: $SNAPCRAFT_STAGE/usr/lib
119+
- LIBMNL_LIBS: $CRAFT_STAGE/usr/lib
110120
prime:
111121
- -usr/local/include
112122

113123
iptables:
114124
after: [libnftnl]
115125
source: https://www.netfilter.org/projects/iptables/files/iptables-1.8.6.tar.bz2
126+
build-attributes: [enable-patchelf]
116127
plugin: autotools
117128
build-environment:
118-
- LIBMNL_LIBS: $SNAPCRAFT_STAGE/usr/lib
119-
- LIBNFTNL_LIBS: $SNAPCRAFT_STAGE/usr/lib
129+
- LIBMNL_LIBS: $CRAFT_STAGE/usr/lib
130+
- LIBNFTNL_LIBS: $CRAFT_STAGE/usr/lib
120131
autotools-configure-parameters:
121132
- "--prefix=/usr"
122133
- "--exec-prefix=/"
@@ -131,18 +142,19 @@ parts:
131142
after: [runc]
132143
plugin: nil
133144
source: build-scripts/components/containerd
134-
override-build: $SNAPCRAFT_PROJECT_DIR/build-scripts/build-component.sh containerd
145+
override-build: $CRAFT_PROJECT_DIR/build-scripts/build-component.sh containerd
135146
build-attributes: [no-patchelf]
136147

137148
runc:
138149
after: [iptables, build-deps]
139150
source: build-scripts/components/runc
140151
build-attributes: [no-patchelf]
141152
plugin: nil
142-
override-build: $SNAPCRAFT_PROJECT_DIR/build-scripts/build-component.sh runc
153+
override-build: $CRAFT_PROJECT_DIR/build-scripts/build-component.sh runc
143154

144155
bash-utils:
145156
plugin: nil
157+
build-attributes: [enable-patchelf]
146158
stage-packages:
147159
- conntrack
148160
- coreutils
@@ -202,92 +214,94 @@ parts:
202214
after: [build-deps]
203215
plugin: nil
204216
source: build-scripts/components/cluster-agent
205-
override-build: $SNAPCRAFT_PROJECT_DIR/build-scripts/build-component.sh cluster-agent
217+
build-attributes: [enable-patchelf]
218+
override-build: $CRAFT_PROJECT_DIR/build-scripts/build-component.sh cluster-agent
206219

207220
microk8s-addons:
208221
plugin: nil
209222
source: build-scripts/addons
210-
override-build: ./repositories.sh "${SNAPCRAFT_PART_INSTALL}"
223+
override-build: ./repositories.sh "${CRAFT_PART_INSTALL}"
211224

212225
microk8s-scripts:
213226
plugin: nil
214227
source: scripts/
215228
override-build: |
216-
if [ -d "${SNAPCRAFT_PART_INSTALL}" ]; then
217-
rm -rf "${SNAPCRAFT_PART_INSTALL}/*"
229+
if [ -d "${CRAFT_PART_INSTALL}" ]; then
230+
rm -rf "${CRAFT_PART_INSTALL}/*"
218231
fi
219232
220-
cp -r . "${SNAPCRAFT_PART_INSTALL}/scripts"
221-
cp inspect.sh "${SNAPCRAFT_PART_INSTALL}/inspect.sh"
233+
cp -r . "${CRAFT_PART_INSTALL}/scripts"
234+
cp inspect.sh "${CRAFT_PART_INSTALL}/inspect.sh"
222235
223236
microk8s-upgrade-scripts:
224237
plugin: nil
225238
source: upgrade-scripts/
226239
override-build: |
227-
if [ -d "${SNAPCRAFT_PART_INSTALL}" ]; then
228-
rm -rf "${SNAPCRAFT_PART_INSTALL}/*"
240+
if [ -d "${CRAFT_PART_INSTALL}" ]; then
241+
rm -rf "${CRAFT_PART_INSTALL}/*"
229242
fi
230243
231-
cp -r . "${SNAPCRAFT_PART_INSTALL}/upgrade-scripts"
244+
cp -r . "${CRAFT_PART_INSTALL}/upgrade-scripts"
232245
233246
microk8s:
234247
plugin: nil
235248
source: microk8s-resources/
236249
override-build: |
237-
if [ -d "${SNAPCRAFT_PART_INSTALL}" ]; then
238-
rm -rf "${SNAPCRAFT_PART_INSTALL}/*"
250+
if [ -d "${CRAFT_PART_INSTALL}" ]; then
251+
rm -rf "${CRAFT_PART_INSTALL}/*"
239252
fi
240253
241-
cp microk8s.default.yaml "${SNAPCRAFT_PART_INSTALL}/microk8s.default.yaml"
254+
cp microk8s.default.yaml "${CRAFT_PART_INSTALL}/microk8s.default.yaml"
242255
243-
cp -r default-args "${SNAPCRAFT_PART_INSTALL}/default-args"
244-
cp -r default-hooks "${SNAPCRAFT_PART_INSTALL}/default-hooks"
245-
cp -r certs "${SNAPCRAFT_PART_INSTALL}/certs"
256+
cp -r default-args "${CRAFT_PART_INSTALL}/default-args"
257+
cp -r default-hooks "${CRAFT_PART_INSTALL}/default-hooks"
258+
cp -r certs "${CRAFT_PART_INSTALL}/certs"
246259
247-
cp containerd-profile "${SNAPCRAFT_PART_INSTALL}/containerd-profile"
260+
cp containerd-profile "${CRAFT_PART_INSTALL}/containerd-profile"
248261
249-
cp client.config "${SNAPCRAFT_PART_INSTALL}/client.config"
250-
cp client.config.template "${SNAPCRAFT_PART_INSTALL}/client.config.template"
251-
cp kubelet.config.template "${SNAPCRAFT_PART_INSTALL}/kubelet.config.template"
252-
cp client-x509.config.template "${SNAPCRAFT_PART_INSTALL}/client-x509.config.template"
262+
cp client.config "${CRAFT_PART_INSTALL}/client.config"
263+
cp client.config.template "${CRAFT_PART_INSTALL}/client.config.template"
264+
cp kubelet.config.template "${CRAFT_PART_INSTALL}/kubelet.config.template"
265+
cp client-x509.config.template "${CRAFT_PART_INSTALL}/client-x509.config.template"
253266
254-
cp -r wrappers/* "${SNAPCRAFT_PART_INSTALL}/"
255-
cp -r actions/ "${SNAPCRAFT_PART_INSTALL}/actions"
267+
cp -r wrappers/* "${CRAFT_PART_INSTALL}/"
268+
cp -r actions/ "${CRAFT_PART_INSTALL}/actions"
256269
257270
microk8s-completion:
258271
after: [build-deps]
259272
plugin: nil
260273
source: build-scripts/components/microk8s-completion
261-
override-build: $SNAPCRAFT_PROJECT_DIR/build-scripts/build-component.sh microk8s-completion
274+
override-build: $CRAFT_PROJECT_DIR/build-scripts/build-component.sh microk8s-completion
262275

263276
python-runtime:
264277
after: [build-deps]
278+
build-attributes: [enable-patchelf]
265279
plugin: nil
266280
source: build-scripts/components/python
267281
override-build: |
268282
pip3 install -r requirements.txt
269283
build-packages:
270284
- python3-dev
271285
build-environment:
272-
- C_INCLUDE_PATH: /usr/include/python3.8
286+
- C_INCLUDE_PATH: /usr/include/python3.10
273287
stage-packages:
274288
- libpython3-stdlib
275-
- libpython3.8-stdlib
276-
- libpython3.8-minimal
289+
- libpython3.10-stdlib
290+
- libpython3.10-minimal
277291
- python3-pip
278292
- python3-setuptools
279293
- python3-wheel
280294
- python3-venv
281295
- python3-minimal
282296
- python3-distutils
283297
- python3-pkg-resources
284-
- python3.8-minimal
298+
- python3.10-minimal
285299
- python3-openssl
286300
- python3-requests
287301
- python3-click
288302
- python3-dateutil
289303
stage:
290-
- -usr/lib/python3.9
304+
- -usr/lib/python3.11
291305
- -usr/share/doc
292306
- -usr/share/lintian
293307
- -usr/share/man
@@ -312,7 +326,7 @@ parts:
312326
build-packages:
313327
- python3-yaml
314328
override-build: |
315-
./build-scripts/generate-bom.py > "${SNAPCRAFT_PART_INSTALL}/bom.json"
329+
./build-scripts/generate-bom.py > "${CRAFT_PART_INSTALL}/bom.json"
316330
317331
apps:
318332
microk8s:

tests/libs/airgap.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ addons:
5454
echo retry install snapd
5555
sleep 1
5656
done
57-
while ! lxc exec "$NAME" -- bash -c "snap install core20"; do
58-
echo retry install core20
57+
while ! lxc exec "$NAME" -- bash -c "snap install core22"; do
58+
echo retry install core22
5959
sleep 1
6060
done
6161
while ! lxc exec "$NAME" -- bash -c "snap install /var/tmp/microk8s_latest_amd64.snap --dangerous --classic"; do
@@ -106,8 +106,8 @@ function setup_airgapped_microk8s() {
106106
echo retry install snapd
107107
sleep 1
108108
done
109-
while ! lxc exec "$NAME" -- bash -c "snap install core20"; do
110-
echo retry install core20
109+
while ! lxc exec "$NAME" -- bash -c "snap install core22"; do
110+
echo retry install core22
111111
sleep 1
112112
done
113113

tests/lxc/install-deps/images_almalinux-8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pip3 install pytest==8.3.4 requests pyyaml sh psutil
1515
n=0
1616
until [ $n -ge 7 ]
1717
do
18-
sudo snap install core20 && break # substitute your command here
18+
sudo snap install core22 && break # substitute your command here
1919
n=$[$n+1]
2020
sleep 10
2121
done

tests/lxc/install-deps/images_archlinux

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pip3 install pytest==8.3.4 requests pyyaml
2626
n=0
2727
until [ $n -ge 7 ]
2828
do
29-
sudo snap install core20 && break # substitute your command here
29+
sudo snap install core22 && break # substitute your command here
3030
n=$[$n+1]
3131
sleep 10
3232
done

tests/lxc/install-deps/images_centos-7

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pip3 install pytest==8.3.4 requests pyyaml sh psutil
1313
n=0
1414
until [ $n -ge 7 ]
1515
do
16-
sudo snap install core20 && break # substitute your command here
16+
sudo snap install core22 && break # substitute your command here
1717
n=$[$n+1]
1818
sleep 10
1919
done

tests/lxc/install-deps/images_centos-8-Stream

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pip3 install pytest==8.3.4 requests pyyaml sh psutil
1515
n=0
1616
until [ $n -ge 7 ]
1717
do
18-
sudo snap install core20 && break # substitute your command here
18+
sudo snap install core22 && break # substitute your command here
1919
n=$[$n+1]
2020
sleep 10
2121
done

tests/lxc/install-deps/images_debian-10

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ done
2121
n=0
2222
until [ $n -ge 7 ]
2323
do
24-
sudo snap install core20 && break # substitute your command here
24+
sudo snap install core22 && break # substitute your command here
2525
n=$[$n+1]
2626
sleep 10
2727
done

tests/lxc/install-deps/images_debian-11

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ done
2222
n=0
2323
until [ $n -ge 7 ]
2424
do
25-
sudo snap install core20 && break # substitute your command here
25+
sudo snap install core22 && break # substitute your command here
2626
n=$[$n+1]
2727
sleep 10
2828
done

0 commit comments

Comments
 (0)