Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 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
2 changes: 1 addition & 1 deletion LICENSES-AND-NOTICES/SPECS/LICENSES-MAP.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion LICENSES-AND-NOTICES/SPECS/data/licenses.json
Original file line number Diff line number Diff line change
Expand Up @@ -3200,7 +3200,9 @@
"Source project": {
"license": "Same as the source project.",
"specs": [
"python-nocaselist"
"k3s",
"python-nocaselist",
"yq"
]
},
"Sysbench source": {
Expand Down
66 changes: 66 additions & 0 deletions SPECS/k3s/flannel.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# This patch is for the k3s build system to use the flannel package.
--- build/src/github.com/containernetworking/plugins/plugins/meta/flannel/flannel.go
+++ build/src/github.com/containernetworking/plugins/plugins/meta/flannel/flannel.go
@@ -16,7 +16,7 @@
// the data from flannel generated subnet file and then invokes a plugin
// like bridge or ipvlan to do the real work.

-package main
+package flannel

import (
"bufio"
@@ -325,7 +325,7 @@
return doCmdDel(args, nc)
}

-func main() {
+func Main() {
fullVer := fmt.Sprintf("CNI Plugin %s version %s (%s/%s) commit %s built on %s", Program, Version, runtime.GOOS, runtime.GOARCH, Commit, buildDate)
skel.PluginMain(cmdAdd, cmdCheck, cmdDel, cni.All, fullVer)
}
--- build/src/github.com/containernetworking/plugins/plugins/meta/flannel/flannel_linux.go
+++ build/src/github.com/containernetworking/plugins/plugins/meta/flannel/flannel_linux.go
@@ -16,7 +16,7 @@
// the data from flannel generated subnet file and then invokes a plugin
// like bridge or ipvlan to do the real work.

-package main
+package flannel

import (
"context"
--- build/src/github.com/containernetworking/plugins/plugins/meta/flannel/flannel_linux_test.go
+++ build/src/github.com/containernetworking/plugins/plugins/meta/flannel/flannel_linux_test.go
@@ -11,7 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
-package main
+package flannel

import (
"encoding/json"
--- build/src/github.com/containernetworking/plugins/plugins/meta/flannel/flannel_suite_test.go
+++ build/src/github.com/containernetworking/plugins/plugins/meta/flannel/flannel_suite_test.go
@@ -11,7 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
-package main
+package flannel

import (
. "github.com/onsi/ginkgo/v2"
--- build/src/github.com/containernetworking/plugins/plugins/meta/flannel/flannel_windows.go
+++ build/src/github.com/containernetworking/plugins/plugins/meta/flannel/flannel_windows.go
@@ -16,7 +16,7 @@
// the data from flannel generated subnet file and then invokes a plugin
// like bridge or ipvlan to do the real work.

-package main
+package flannel

import (
"context"

31 changes: 31 additions & 0 deletions SPECS/k3s/k3s-build.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This patch removes git repo cloning for rancher plugins and flannel cni, they are included as build sources.
--- scripts/build
+++ scripts/build
@@ -57,7 +57,7 @@
if [ -n "${DEBUG}" ]; then
GCFLAGS="-N -l"
else
- LDFLAGS="-w -s"
+ LDFLAGS=""
fi

STATIC=""
@@ -159,15 +159,10 @@
if [ ! -x ${INSTALLBIN}/cni${BINARY_POSTFIX} ]; then
(
echo Building cni
- TMPDIR=$(mktemp -d)
trap cleanup EXIT
- WORKDIR=$TMPDIR/src/github.com/containernetworking/plugins
- git clone --single-branch --depth=1 --branch=$VERSION_CNIPLUGINS https://github.com/rancher/plugins.git $WORKDIR
- cd $WORKDIR
- rm -rf plugins/meta/flannel
- git clone --single-branch --depth=1 --branch=$VERSION_FLANNEL_PLUGIN https://github.com/flannel-io/cni-plugin.git plugins/meta/flannel
- sed -i 's/package main/package flannel/; s/func main/func Main/' plugins/meta/flannel/*.go
- GO111MODULE=off GOPATH=$TMPDIR CGO_ENABLED=0 "${GO}" build -tags "$TAGS" -gcflags="all=${GCFLAGS}" -ldflags "$VERSIONFLAGS $LDFLAGS $STATIC" -o $INSTALLBIN/cni${BINARY_POSTFIX}
+ BUILD_PATH=$(realpath build)
+ cd build/src/github.com/containernetworking/plugins
+ GO111MODULE=off GOPATH=$BUILD_PATH CGO_ENABLED=0 "${GO}" build -tags "$TAGS" -gcflags="all=${GCFLAGS}" -ldflags "$VERSIONFLAGS $LDFLAGS $STATIC" -o $INSTALLBIN/cni${BINARY_POSTFIX}
)
fi

11 changes: 11 additions & 0 deletions SPECS/k3s/k3s-package-cli.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This patch removes the -w -s flags from the LDFLAGS in package-cli, as they are not needed for the k3s build.
--- scripts/package-cli
+++ scripts/package-cli
@@ -75,7 +75,6 @@
LDFLAGS="
-X github.com/k3s-io/k3s/pkg/version.Version=$VERSION
-X github.com/k3s-io/k3s/pkg/version.GitCommit=${COMMIT:0:8}
- -w -s
"
TAGS="urfave_cli_no_docs"
STATIC="-extldflags '-static'"
14 changes: 14 additions & 0 deletions SPECS/k3s/k3s.signatures.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"Signatures": {
"k3s-v1.32.4.tar.gz": "69ae56c0edb0390f9e98b7b93955f4e066165bf9800b9ce41ed489e8410f9ce6",
"k3s-airgap-images-v1.32.4.tar.zst": "2c27bf09b90459947dff497ca5028adefa8f8f3d2ae96a3164c11b8a5ed3bb86",
"k3s-vendor-v1.32.4.tar.gz": "23957cf399b52515d3bd06b2974a016d9fbfb587c737d2dc9a7f194834083c7e",
"k3s-root-amd64.tar": "70d40a9a2ccdbf084b70b7421bedb23aad48b122fffbeecdeb589a8696ac1b64",
"runc-v1.2.5.tar.gz": "1ae11980477b789732915dfd7ba4246f5babe5ff76a31021d36365007d9713b0",
"containerd-v2.0.4-k3s2.tar.gz": "c0975e2271a9f10a9d49b8a889206ef464df158f9a3b3809dbdf4f2d1b6c48ac",
"traefik-crd-34.2.1+up34.2.0.tgz": "3f5d2bc3de48539d81c48bb208e4f612417147b403df6ddb634cbbbec29ddb2e",
"traefik-34.2.1+up34.2.0.tgz": "dcff72625d4e9d453a15715c367444536ec2dd147ca43af2246c0acbacf0929a",
"rancher-plugins-v1.6.0-k3s1.tar.gz": "4a1316e5146700d96b574252e6e343f13a55aea73bc009e4da56e24c2bf02f8c",
"flannel-v1.6.0-flannel1.tar.gz": "0e10509115074af3b05d02c01987523bd95aecc3939fc24d86ad7c910eabf3ee"
}
}
87 changes: 87 additions & 0 deletions SPECS/k3s/k3s.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
Name: k3s
Summary: K3s - Lightweight Kubernetes
Version: 1.32.4
Release: 1%{?dist}
License: ASL 2.0
Vendor: Intel Corporation
Distribution: Edge Microvisor Toolkit
Group: System Environment/Base
URL: https://k3s.io/
Source0: https://github.com/k3s-io/k3s/archive/refs/tags/v%{version}+k3s1.tar.gz#/%{name}-v%{version}.tar.gz
Source1: https://github.com/k3s-io/k3s/releases/download/v%{version}+k3s1/k3s-airgap-images-amd64.tar.zst#/%{name}-airgap-images-v%{version}.tar.zst
Source2: %{name}-vendor-v%{version}.tar.gz
Source3: https://github.com/k3s-io/k3s-root/releases/download/v0.14.1/k3s-root-amd64.tar
Source4: https://github.com/opencontainers/runc/archive/refs/tags/v1.2.5.tar.gz#/runc-v1.2.5.tar.gz
Source5: https://github.com/k3s-io/containerd/archive/refs/tags/v2.0.4-k3s2.tar.gz#/containerd-v2.0.4-k3s2.tar.gz
Source6: https://k3s.io/k3s-charts/assets/traefik-crd/traefik-crd-34.2.1+up34.2.0.tgz
Source7: https://k3s.io/k3s-charts/assets/traefik/traefik-34.2.1+up34.2.0.tgz
Source8: https://github.com/rancher/plugins/archive/refs/tags/v1.6.0-k3s1.tar.gz#/rancher-plugins-v1.6.0-k3s1.tar.gz
Source9: https://github.com/flannel-io/cni-plugin/archive/refs/tags/v1.6.0-flannel1.tar.gz#/flannel-v1.6.0-flannel1.tar.gz
Patch0: k3s-build.patch
Patch1: k3s-package-cli.patch
Patch2: flannel.patch
BuildRequires: yq
BuildRequires: golang
BuildRequires: libseccomp-devel

%description
K3s - Lightweight Kubernetes %{version}

%prep
%setup -n %{name}-%{version}-k3s1
mkdir -p build/src/github.com/opencontainers/runc build/src/github.com/containerd/containerd build/static/charts build/src/github.com/containernetworking/plugins bin dist
tar -xf %{SOURCE2} --no-same-owner
tar -xf %{SOURCE3} --no-same-owner
tar -xf %{SOURCE4} --no-same-owner --strip-components 1 -C build/src/github.com/opencontainers/runc
tar -xf %{SOURCE5} --no-same-owner --strip-components 1 -C build/src/github.com/containerd/containerd
mv %{SOURCE6} build/static/charts/
mv %{SOURCE7} build/static/charts/
tar -xf %{SOURCE8} --no-same-owner --strip-components 1 -C build/src/github.com/containernetworking/plugins
rm -rf build/src/github.com/containernetworking/plugins/plugins/meta/flannel/*
tar -xf %{SOURCE9} --no-same-owner --strip-components 1 -C build/src/github.com/containernetworking/plugins/plugins/meta/flannel
%autopatch -v -p0

%build
./scripts/build
./scripts/package-cli

%install
mkdir -p %{buildroot}%{_bindir}
install -m 0755 dist/artifacts/k3s %{buildroot}%{_bindir}

mkdir %{buildroot}/opt
install -m 0755 install.sh %{buildroot}/opt/install.sh

mkdir -p %{buildroot}/var/lib/rancher/k3s/agent/images
install -m 0644 %{SOURCE2} %{buildroot}/var/lib/rancher/k3s/agent/images/k3s-airgap-images-amd64.tar.zst

%files
%{_bindir}/k3s
/opt/install.sh
/var/lib/rancher/k3s/agent/images/k3s-airgap-images-amd64.tar.zst

%changelog
* Tue Jun 17 2025 Eoghan Lawless <eoghan.lawless@intel.com> - 1.32.4-1
- Initial Edge Microvisor Toolkit import from the source project. License verified.

* Wed Apr 23 2025 Rafael <32229014+rafaelbreno@users.noreply.github.com> - v1.32.4+k3s1
- Update to v1.32.4 (#12209)

* Fri Mar 21 2025 Derek Nola <derek.nola@suse.com> - v1.32.3+k3s1
- [Release-1.32] Fix upgrade test container version (#12000)
- Fix upgrade test container version
- Force docker test cleanup in CI
- Bump skew test deployment times
- Bump skew test timeout

* Fri Feb 21 2025 Brad Davidson <brad.davidson@rancher.com> - v1.32.2+k3s1
- Bump containerd for go-cni deadlock fix

* Thu Jan 23 2025 Brad Davidson <brad.davidson@rancher.com> - v1.32.1+k3s1
- Update tests
- Also add an ordinal to subtests so its easier to figure out which one is failing

* Tue Jan 7 2025 Hussein Galal <hussein.galal.ahmed.11@gmail.com> - v1.32.0+k3s1
- Load kernel modules for nft in agent setup (#11527)
- Initial Azure Linux import from the source project (license: same as "License" tag)
- License verified
6 changes: 6 additions & 0 deletions SPECS/yq/yq.signatures.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"Signatures": {
"yq-v4.45.4.tar.gz": "e06b9b219ad885b08cf983a7ce5ff6d946587ab4ffc62de4538655bb50e39111",
"yq-vendor-v4.45.4.tar.gz": "2993042362b513ced2143c6b7842ec6fe421a84f2cd373424f5b5173cd4b0936"
}
}
Loading
Loading