feat: add cni-plugins
All checks were successful
Build / build-8 (pull_request) Successful in 31s
Build / build-9 (pull_request) Successful in 34s

- add 1.6.1 cni-plugins
- ignore the scripts folder in make list
This commit is contained in:
Ben Vincent 2024-12-27 22:55:38 +11:00
parent 3cbe7f9a83
commit f84bd17e1b
5 changed files with 166 additions and 1 deletions

View File

@ -4,7 +4,7 @@ RPMS_DIR := $(ROOT_DIR)/rpms
REPO_OPTIONS := --disablerepo=* --enablerepo=unkin REPO_OPTIONS := --disablerepo=* --enablerepo=unkin
# Automatically find all package/version directories # Automatically find all package/version directories
PACKAGES := $(shell find $(RPMS_DIR) -mindepth 2 -maxdepth 2 -type d | sed "s|$(RPMS_DIR)/||") PACKAGES := $(shell find $(RPMS_DIR) -mindepth 2 -maxdepth 2 -type d | sed "s|$(RPMS_DIR)/||" | grep -v "/scripts")
# Default target to build all packages and versions # Default target to build all packages and versions
.PHONY: all list cache build clean .PHONY: all list cache build clean

View File

@ -0,0 +1 @@
1

View File

@ -0,0 +1,25 @@
# Start with the AlmaLinux 8.10 base image
FROM git.query.consul/unkin/almalinux8-buildagent:latest
# Create output directory for RPMs
RUN mkdir -p /app/dist
# Set working directory
WORKDIR /app
ARG PACKAGE_RELEASE
ENV PACKAGE_RELEASE=${PACKAGE_RELEASE}
ARG PACKAGE_VERSION
ENV PACKAGE_VERSION=${PACKAGE_VERSION}
# Copy nfpm.yaml from the context into the container
COPY nfpm.yaml /app/nfpm.yaml
COPY scripts /app/scripts
# Download the required files
RUN dnf install -y unzip && \
wget -O /app/cni-plugins-linux-amd64.tgz https://github.com/containernetworking/plugins/releases/download/v${PACKAGE_VERSION}/cni-plugins-linux-amd64-v${PACKAGE_VERSION}.tgz && \
tar xf cni-plugins-linux-amd64.tgz
# Default command to build RPMs
CMD nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm

137
rpms/cni-plugins/nfpm.yaml Normal file
View File

@ -0,0 +1,137 @@
# nfpm.yaml
name: cni-plugins
version: ${PACKAGE_VERSION}
release: ${PACKAGE_RELEASE}
arch: amd64
platform: linux
section: default
priority: extra
description: "Some reference and example networking plugins, maintained by the CNI team."
maintainer: ContainerNetworking
homepage: https://github.com/containernetworking/plugins
license: Apache-2.0
disable_globbing: false
replaces:
- cni-plugins
# Files to include in the package
contents:
- src: /app/bandwidth
dst: /opt/cni/bin/bandwidth
file_info:
mode: 0755
owner: root
group: root
- src: /app/bridge
dst: /opt/cni/bin/bridge
file_info:
mode: 0755
owner: root
group: root
- src: /app/dhcp
dst: /opt/cni/bin/dhcp
file_info:
mode: 0755
owner: root
group: root
- src: /app/dummy
dst: /opt/cni/bin/dummy
file_info:
mode: 0755
owner: root
group: root
- src: /app/firewall
dst: /opt/cni/bin/firewall
file_info:
mode: 0755
owner: root
group: root
- src: /app/host-device
dst: /opt/cni/bin/host-device
file_info:
mode: 0755
owner: root
group: root
- src: /app/host-local
dst: /opt/cni/bin/host-local
file_info:
mode: 0755
owner: root
group: root
- src: /app/ipvlan
dst: /opt/cni/bin/ipvlan
file_info:
mode: 0755
owner: root
group: root
- src: /app/loopback
dst: /opt/cni/bin/loopback
file_info:
mode: 0755
owner: root
group: root
- src: /app/macvlan
dst: /opt/cni/bin/macvlan
file_info:
mode: 0755
owner: root
group: root
- src: /app/portmap
dst: /opt/cni/bin/portmap
file_info:
mode: 0755
owner: root
group: root
- src: /app/ptp
dst: /opt/cni/bin/ptp
file_info:
mode: 0755
owner: root
group: root
- src: /app/sbr
dst: /opt/cni/bin/sbr
file_info:
mode: 0755
owner: root
group: root
- src: /app/static
dst: /opt/cni/bin/static
file_info:
mode: 0755
owner: root
group: root
- src: /app/tap
dst: /opt/cni/bin/tap
file_info:
mode: 0755
owner: root
group: root
- src: /app/tuning
dst: /opt/cni/bin/tuning
file_info:
mode: 0755
owner: root
group: root
- src: /app/vlan
dst: /opt/cni/bin/vlan
file_info:
mode: 0755
owner: root
group: root
- src: /app/vrf
dst: /opt/cni/bin/vrf
file_info:
mode: 0755
owner: root
group: root
# Scripts to run during installation/removal (optional)
scripts:
preinstall: ./scripts/preinstall.sh
# postinstall: ./scripts/postinstall.sh
# preremove: ./scripts/preremove.sh
# postremove: ./scripts/postremove.sh

View File

@ -0,0 +1,2 @@
#!/usr/bin/env bash
mkdir -p /opt/cni/bin