From 592642167d289489f49617f044a4894536194af5 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Tue, 26 Mar 2024 13:13:27 +0100 Subject: [PATCH] feat: add metallb crds (#75) Reviewed-on: https://gitea.rknet.org/infra/crds-catalog/pulls/75 Co-authored-by: Robert Kaussow Co-committed-by: Robert Kaussow --- .woodpecker/build-package.yml | 2 +- Makefile | 2 ++ generate.sh | 28 +++++++++++++++++++++++++++- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/.woodpecker/build-package.yml b/.woodpecker/build-package.yml index 7a9093e..33551d9 100644 --- a/.woodpecker/build-package.yml +++ b/.woodpecker/build-package.yml @@ -7,7 +7,7 @@ when: steps: - name: build - image: quay.io/thegeeklab/alpine-tools + image: quay.io/thegeeklab/kube-tools commands: - make diff --git a/Makefile b/Makefile index 5bab26e..2fbdb65 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,8 @@ CNPG_VERSION := v1.22.2 MINIO_VERSION := v5.0.14 # renovate: datasource=helm depName=k8up registryUrl=https://k8up-io.github.io/k8up K8UP_VERSION := 4.5.0 +# renovate: datasource=github-releases depName=metallb/metallb +METALLB_VERSION := v0.14.2 .PHONY: all all: clean generate diff --git a/generate.sh b/generate.sh index e2c28a4..1bf0933 100755 --- a/generate.sh +++ b/generate.sh @@ -82,6 +82,32 @@ for FILE in "${WORKDIR}"/*.json; do generate_all "$TARGET_DIR" done +## Metallb +API=metallb.io +NAME=metallb +WORKDIR="${TMP_CRD_DIR}/$NAME" +SOURCE="https://raw.githubusercontent.com/metallb/metallb/${METALLB_VERSION}/charts/metallb/charts/crds/templates/crds.yaml" + +printf "Processing %s ...\n" $API +mkdir -p "${WORKDIR}" +curl -SsfL -o "${WORKDIR}/${NAME}.crds.yaml" "${SOURCE}" +( + cd "$WORKDIR" + yq --inplace 'del(.spec.conversion)' "${NAME}.crds.yaml" + openapi2jsonschema "${NAME}.crds.yaml" >/dev/null +) + +TARGET_DIR="$DIST/$API" +mkdir -p "$TARGET_DIR" + +for FILE in "${WORKDIR}"/*.json; do + FILENAME=$(basename "$FILE") + + mv "$FILE" "$TARGET_DIR/$FILENAME" +done + +generate_all "$TARGET_DIR" + ## Cloudnative-PG API=postgresql.cnpg.io NAME=cnpg @@ -103,7 +129,7 @@ WORKDIR="${TMP_CRD_DIR}/$NAME" SOURCE="https://raw.githubusercontent.com/minio/operator/${MINIO_VERSION}/resources/base/crds/minio.min.io_tenants.yaml" default_openapi_handler -# K8up +## K8up API=k8up.io NAME=k8up WORKDIR="${TMP_CRD_DIR}/$NAME"