Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions build-scripts/components/containerd/build.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
#!/bin/bash

# Store the current Go snap revision
INITIAL_GO_REVISION=$(snap list go | grep -E '^go\s' | awk '{print $3}')
echo "Current Go snap revision: ${INITIAL_GO_REVISION}"

# Refresh to go 1.23-fips/stable channel
echo "Refreshing to go 1.23-fips/stable channel..."
snap refresh go --channel=1.23-fips/stable
# Check if Go is installed via snap
if snap list go >/dev/null 2>&1; then
# Store the current Go snap revision
INITIAL_GO_REVISION=$(snap list go | grep -E '^go\s' | awk '{print $3}')
echo "Current Go snap revision: ${INITIAL_GO_REVISION}"

# Refresh to go 1.23-fips/stable channel
echo "Refreshing to go 1.23-fips/stable channel..."
snap refresh go --channel=1.23-fips/stable
fi

INSTALL="${1}/bin"
mkdir -p "${INSTALL}"
Expand Down Expand Up @@ -39,6 +42,9 @@ for bin in ctr containerd-shim containerd-shim-runc-v1 containerd-shim-runc-v2;
cp "bin/${bin}" "${INSTALL}/${bin}"
done

# Restore the initial Go snap revision
echo "Restoring Go snap to initial revision: ${INITIAL_GO_REVISION}"
snap revert go --revision="${INITIAL_GO_REVISION}"
# Restore Go state
if snap list go >/dev/null 2>&1; then
# Restore the initial Go snap revision
echo "Restoring Go snap to initial revision: ${INITIAL_GO_REVISION}"
snap revert go --revision="${INITIAL_GO_REVISION}"
fi
26 changes: 16 additions & 10 deletions build-scripts/components/runc/build.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
#!/bin/bash

# Store the current Go snap revision
INITIAL_GO_REVISION=$(snap list go | grep -E '^go\s' | awk '{print $3}')
echo "Current Go snap revision: ${INITIAL_GO_REVISION}"

# Refresh to go 1.23-fips/stable channel
echo "Refreshing to go 1.23-fips/stable channel..."
snap refresh go --channel=1.23-fips/stable
# Check if Go is installed via snap
if snap list go >/dev/null 2>&1; then
# Store the current Go snap revision
INITIAL_GO_REVISION=$(snap list go | grep -E '^go\s' | awk '{print $3}')
echo "Current Go snap revision: ${INITIAL_GO_REVISION}"

# Refresh to go 1.23-fips/stable channel
echo "Refreshing to go 1.23-fips/stable channel..."
snap refresh go --channel=1.23-fips/stable
fi

VERSION="${2}"

Expand All @@ -19,6 +22,9 @@ export COMMIT="$(git describe --long --always "${VERSION}")"
make BUILDTAGS="seccomp apparmor" EXTRA_LDFLAGS="-s -w" static
cp runc "${INSTALL}/runc"

# Restore the initial Go snap revision
echo "Restoring Go snap to initial revision: ${INITIAL_GO_REVISION}"
snap revert go --revision="${INITIAL_GO_REVISION}"
# Restore Go state
if snap list go >/dev/null 2>&1; then
# Restore the initial Go snap revision
echo "Restoring Go snap to initial revision: ${INITIAL_GO_REVISION}"
snap revert go --revision="${INITIAL_GO_REVISION}"
fi
Loading