mirror of
https://github.com/cloudnative-pg/plugin-barman-cloud.git
synced 2026-07-07 02:02:21 +02:00
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [controller-runtime](https://redirect.github.com/kubernetes-sigs/controller-runtime) | minor | `0.23.3` → `0.24.0` | --- ### Release Notes <details> <summary>kubernetes-sigs/controller-runtime (controller-runtime)</summary> ### [`v0.24.0`](https://redirect.github.com/kubernetes-sigs/controller-runtime/releases/tag/v0.24.0) [Compare Source](https://redirect.github.com/kubernetes-sigs/controller-runtime/compare/v0.23.3...v0.24.0) #### ⚠️ Breaking Changes - Dependencies: Update to k8s.io/\* v1.36 ([#​3506](https://redirect.github.com/kubernetes-sigs/controller-runtime/issues/3506) [#​3462](https://redirect.github.com/kubernetes-sigs/controller-runtime/issues/3462) [#​3486](https://redirect.github.com/kubernetes-sigs/controller-runtime/issues/3486) [#​3450](https://redirect.github.com/kubernetes-sigs/controller-runtime/issues/3450)) #### 🐛 Bug Fixes - Cache: Fix IndexField blocking until informer is synced ([#​3445](https://redirect.github.com/kubernetes-sigs/controller-runtime/issues/3445)) - Cache: Wait for cache sync when ReaderFailOnMissingInformer is true ([#​3425](https://redirect.github.com/kubernetes-sigs/controller-runtime/issues/3425)) - Client: Update typed ApplyConfigurations with server response ([#​3475](https://redirect.github.com/kubernetes-sigs/controller-runtime/issues/3475)) - Fakeclient: Fix SSA status patch resource version check ([#​3443](https://redirect.github.com/kubernetes-sigs/controller-runtime/issues/3443)) - Fakeclient: Fix panic when using CRs with embedded pointer structs ([#​3431](https://redirect.github.com/kubernetes-sigs/controller-runtime/issues/3431)) - Fakeclient: Fix status apply if existing object has managedFields set ([#​3430](https://redirect.github.com/kubernetes-sigs/controller-runtime/issues/3430)) - Fakeclient: Retry GenerateName on AlreadyExists collisions ([#​3498](https://redirect.github.com/kubernetes-sigs/controller-runtime/issues/3498)) - HTTP servers: Wire up base context into http servers ([#​3452](https://redirect.github.com/kubernetes-sigs/controller-runtime/issues/3452)) #### 🌱 Others - Builder/Webhooks: Remove deprecated custom path function ([#​3465](https://redirect.github.com/kubernetes-sigs/controller-runtime/issues/3465)) - Cache: Test cache reader waits for cache sync ([#​3434](https://redirect.github.com/kubernetes-sigs/controller-runtime/issues/3434)) - Certwatcher: Deflake certwatcher tests ([#​3457](https://redirect.github.com/kubernetes-sigs/controller-runtime/issues/3457)) - Dependencies: Use forked version of btree ([#​3449](https://redirect.github.com/kubernetes-sigs/controller-runtime/issues/3449)) - Envtest: Ensure envtest stops the whole process group ([#​3447](https://redirect.github.com/kubernetes-sigs/controller-runtime/issues/3447)) - Logging: Add missing space in zap-log-level flag description ([#​3492](https://redirect.github.com/kubernetes-sigs/controller-runtime/issues/3492)) - Misc: Adopt new(x) over ptr.To(x) and re-enable newexpr lint ([#​3489](https://redirect.github.com/kubernetes-sigs/controller-runtime/issues/3489)) - Owners: Cleanup ([#​3453](https://redirect.github.com/kubernetes-sigs/controller-runtime/issues/3453)) - Recorder: Add logger into context for structured logging ([#​3454](https://redirect.github.com/kubernetes-sigs/controller-runtime/issues/3454)) - Recorder: Switch to `StartLogging` for event debug logs ([#​3451](https://redirect.github.com/kubernetes-sigs/controller-runtime/issues/3451)) - Scheme: Deprecate the scheme builder ([#​3461](https://redirect.github.com/kubernetes-sigs/controller-runtime/issues/3461)) - Source/Kind: Improve logging for dynamic type kind source ([#​3494](https://redirect.github.com/kubernetes-sigs/controller-runtime/issues/3494)) - Webhooks: Reduce memory usage of default webhooks ([#​3463](https://redirect.github.com/kubernetes-sigs/controller-runtime/issues/3463) [#​3468](https://redirect.github.com/kubernetes-sigs/controller-runtime/issues/3468)) #### 🌱 CI & linters - Chore: Update golangci-lint version to v2.8.0 ([#​3448](https://redirect.github.com/kubernetes-sigs/controller-runtime/issues/3448)) - Chore: Update golangci-lint version to v2.10.1 ([#​3470](https://redirect.github.com/kubernetes-sigs/controller-runtime/issues/3470)) - Chore: Update golangci-lint version to v2.11.3 ([#​3482](https://redirect.github.com/kubernetes-sigs/controller-runtime/issues/3482)) - Migrate away from custom GitHub action approval workflow ([#​3491](https://redirect.github.com/kubernetes-sigs/controller-runtime/issues/3491)) - Release: Auto-create git tags for the `tools/setup-envtest` submodule ([#​3476](https://redirect.github.com/kubernetes-sigs/controller-runtime/issues/3476)) 📖 Additionally, there has been 1 contribution to our documentation. ([#​3477](https://redirect.github.com/kubernetes-sigs/controller-runtime/issues/3477)) #### Dependencies ##### Added - github.com/cenkalti/backoff/v5: [v5.0.3](https://redirect.github.com/cenkalti/backoff/tree/v5.0.3) - gonum.org/v1/gonum: v0.16.0 - k8s.io/streaming: v0.36.0 ##### Changed - cel.dev/expr: v0.24.0 → v0.25.1 - cloud.google.com/go/compute/metadata: v0.6.0 → v0.9.0 - github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp: [v1.26.0 → v1.30.0](https://redirect.github.com/GoogleCloudPlatform/opentelemetry-operations-go/compare/detectors/gcp/v1.26.0...detectors/gcp/v1.30.0) - github.com/alecthomas/units: [b94a6e3 → 0f3dac3](b94a6e3...0f3dac3) - github.com/cncf/xds/go: [2f00578 → ee656c7](2f00578...ee656c7) - github.com/coreos/go-oidc: [v2.3.0+incompatible → v2.5.0+incompatible](https://redirect.github.com/coreos/go-oidc/compare/v2.3.0...v2.5.0) - github.com/coreos/go-systemd/v22: [v22.5.0 → v22.7.0](https://redirect.github.com/coreos/go-systemd/compare/v22.5.0...v22.7.0) - github.com/davecgh/go-spew: [v1.1.1 → d8f796a](https://redirect.github.com/davecgh/go-spew/compare/v1.1.1...d8f796a) - github.com/emicklei/go-restful/v3: [v3.12.2 → v3.13.0](https://redirect.github.com/emicklei/go-restful/compare/v3.12.2...v3.13.0) - github.com/envoyproxy/go-control-plane/envoy: [v1.32.4 → v1.36.0](https://redirect.github.com/envoyproxy/go-control-plane/compare/envoy/v1.32.4...envoy/v1.36.0) - github.com/envoyproxy/go-control-plane: [v0.13.4 → v0.14.0](https://redirect.github.com/envoyproxy/go-control-plane/compare/v0.13.4...v0.14.0) - github.com/envoyproxy/protoc-gen-validate: [v1.2.1 → v1.3.0](https://redirect.github.com/envoyproxy/protoc-gen-validate/compare/v1.2.1...v1.3.0) - github.com/go-jose/go-jose/v4: [v4.0.4 → v4.1.3](https://redirect.github.com/go-jose/go-jose/compare/v4.0.4...v4.1.3) - github.com/golang-jwt/jwt/v5: [v5.2.2 → v5.3.0](https://redirect.github.com/golang-jwt/jwt/compare/v5.2.2...v5.3.0) - github.com/golang/glog: [v1.2.4 → v1.2.5](https://redirect.github.com/golang/glog/compare/v1.2.4...v1.2.5) - github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus: [v1.0.1 → v1.1.0](https://redirect.github.com/grpc-ecosystem/go-grpc-middleware/compare/providers/prometheus/v1.0.1...providers/prometheus/v1.1.0) - github.com/grpc-ecosystem/go-grpc-middleware/v2: [v2.3.0 → v2.3.3](https://redirect.github.com/grpc-ecosystem/go-grpc-middleware/compare/v2.3.0...v2.3.3) - github.com/grpc-ecosystem/grpc-gateway/v2: [v2.26.3 → v2.27.7](https://redirect.github.com/grpc-ecosystem/grpc-gateway/compare/v2.26.3...v2.27.7) - github.com/moby/spdystream: [v0.5.0 → v0.5.1](https://redirect.github.com/moby/spdystream/compare/v0.5.0...v0.5.1) - github.com/onsi/ginkgo/v2: [v2.27.2 → v2.27.4](https://redirect.github.com/onsi/ginkgo/compare/v2.27.2...v2.27.4) - github.com/onsi/gomega: [v1.38.2 → v1.39.0](https://redirect.github.com/onsi/gomega/compare/v1.38.2...v1.39.0) - github.com/pmezard/go-difflib: [v1.0.0 → 5d4384e](https://redirect.github.com/pmezard/go-difflib/compare/v1.0.0...5d4384e) - github.com/prometheus/common: [v0.66.1 → v0.67.5](https://redirect.github.com/prometheus/common/compare/v0.66.1...v0.67.5) - github.com/prometheus/procfs: [v0.16.1 → v0.19.2](https://redirect.github.com/prometheus/procfs/compare/v0.16.1...v0.19.2) - github.com/spf13/cobra: [v1.10.0 → v1.10.2](https://redirect.github.com/spf13/cobra/compare/v1.10.0...v1.10.2) - github.com/spiffe/go-spiffe/v2: [v2.5.0 → v2.6.0](https://redirect.github.com/spiffe/go-spiffe/compare/v2.5.0...v2.6.0) - go.etcd.io/etcd/api/v3: v3.6.5 → v3.6.8 - go.etcd.io/etcd/client/pkg/v3: v3.6.5 → v3.6.8 - go.etcd.io/etcd/client/v3: v3.6.5 → v3.6.8 - go.etcd.io/etcd/pkg/v3: v3.6.5 → v3.6.8 - go.etcd.io/etcd/server/v3: v3.6.5 → v3.6.8 - go.opentelemetry.io/auto/sdk: v1.1.0 → v1.2.1 - go.opentelemetry.io/contrib/detectors/gcp: v1.34.0 → v1.39.0 - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc: v0.60.0 → v0.65.0 - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp: v0.61.0 → v0.65.0 - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc: v1.34.0 → v1.40.0 - go.opentelemetry.io/otel/exporters/otlp/otlptrace: v1.34.0 → v1.40.0 - go.opentelemetry.io/otel/metric: v1.36.0 → v1.41.0 - go.opentelemetry.io/otel/sdk/metric: v1.36.0 → v1.40.0 - go.opentelemetry.io/otel/sdk: v1.36.0 → v1.40.0 - go.opentelemetry.io/otel/trace: v1.36.0 → v1.41.0 - go.opentelemetry.io/otel: v1.36.0 → v1.41.0 - go.opentelemetry.io/proto/otlp: v1.5.0 → v1.9.0 - go.uber.org/zap: v1.27.0 → v1.27.1 - golang.org/x/crypto: v0.45.0 → v0.47.0 - golang.org/x/exp: [`8a7402a`](https://redirect.github.com/kubernetes-sigs/controller-runtime/commit/8a7402a) → [`944ab1f`](https://redirect.github.com/kubernetes-sigs/controller-runtime/commit/944ab1f) - golang.org/x/mod: v0.29.0 → v0.32.0 - golang.org/x/net: v0.47.0 → v0.49.0 - golang.org/x/oauth2: v0.30.0 → v0.34.0 - golang.org/x/sync: v0.18.0 → v0.19.0 - golang.org/x/sys: v0.38.0 → v0.40.0 - golang.org/x/telemetry: [`078029d`](https://redirect.github.com/kubernetes-sigs/controller-runtime/commit/078029d) → [`bd525da`](https://redirect.github.com/kubernetes-sigs/controller-runtime/commit/bd525da) - golang.org/x/term: v0.37.0 → v0.39.0 - golang.org/x/text: v0.31.0 → v0.33.0 - golang.org/x/time: v0.9.0 → v0.14.0 - golang.org/x/tools/go/expect: v0.1.0-deprecated → v0.1.1-deprecated - golang.org/x/tools: v0.38.0 → v0.41.0 - google.golang.org/genproto/googleapis/api: [`a0af3ef`](https://redirect.github.com/kubernetes-sigs/controller-runtime/commit/a0af3ef) → [`8636f87`](https://redirect.github.com/kubernetes-sigs/controller-runtime/commit/8636f87) - google.golang.org/genproto/googleapis/rpc: [`200df99`](https://redirect.github.com/kubernetes-sigs/controller-runtime/commit/200df99) → [`8636f87`](https://redirect.github.com/kubernetes-sigs/controller-runtime/commit/8636f87) - google.golang.org/grpc: v1.72.2 → v1.79.3 - google.golang.org/protobuf: v1.36.8 → [`f2248ac`](https://redirect.github.com/kubernetes-sigs/controller-runtime/commit/f2248ac) - k8s.io/api: v0.35.0 → v0.36.0 - k8s.io/apiextensions-apiserver: v0.35.0 → v0.36.0 - k8s.io/apimachinery: v0.35.0 → v0.36.0 - k8s.io/apiserver: v0.35.0 → v0.36.0 - k8s.io/client-go: v0.35.0 → v0.36.0 - k8s.io/code-generator: v0.35.0 → v0.36.0 - k8s.io/component-base: v0.35.0 → v0.36.0 - k8s.io/klog/v2: v2.130.1 → v2.140.0 - k8s.io/kms: v0.35.0 → v0.36.0 - k8s.io/kube-openapi: [`589584f`](https://redirect.github.com/kubernetes-sigs/controller-runtime/commit/589584f) → [`43fb72c`](https://redirect.github.com/kubernetes-sigs/controller-runtime/commit/43fb72c) - k8s.io/utils: [`bc988d5`](https://redirect.github.com/kubernetes-sigs/controller-runtime/commit/bc988d5) → [`b8788ab`](https://redirect.github.com/kubernetes-sigs/controller-runtime/commit/b8788ab) - sigs.k8s.io/apiserver-network-proxy/konnectivity-client: v0.31.2 → v0.34.0 - sigs.k8s.io/structured-merge-diff/v6: v6.3.0 → v6.3.2 ##### Removed - github.com/cenkalti/backoff/v4: [v4.3.0](https://redirect.github.com/cenkalti/backoff/tree/v4.3.0) - github.com/gregjones/httpcache: [901d907](https://redirect.github.com/gregjones/httpcache/tree/901d907) - github.com/grpc-ecosystem/go-grpc-prometheus: [v1.2.0](https://redirect.github.com/grpc-ecosystem/go-grpc-prometheus/tree/v1.2.0) - github.com/zeebo/errs: [v1.4.0](https://redirect.github.com/zeebo/errs/tree/v1.4.0) - golang.org/x/xerrors: [`9bdfabe`](https://redirect.github.com/kubernetes-sigs/controller-runtime/commit/9bdfabe) *Thanks to all our contributors!* 😊 </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Never, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/cloudnative-pg/plugin-barman-cloud). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xNTkuMiIsInVwZGF0ZWRJblZlciI6IjQzLjE1OS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWF0ZWQiLCJuby1pc3N1ZSJdfQ==--> Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
501 lines
20 KiB
YAML
501 lines
20 KiB
YAML
version: 3
|
|
|
|
# We have multiple parallel tasks that run for a long time. Prefix their output with the task name so we can understand
|
|
# what task is writing.
|
|
output: prefixed
|
|
|
|
# Variables that are shared across tasks.
|
|
vars:
|
|
GO_VERSION:
|
|
sh: sed -n 's/^toolchain go//p' go.mod
|
|
# renovate: datasource=docker depName=kindest/node versioning=semver
|
|
E2E_KUBERNETES_VERSION: v1.35.1
|
|
E2E_CLUSTER_NAME: barman-cloud-plugin-e2e-{{.E2E_KUBERNETES_VERSION}}
|
|
REGISTRY_NETWORK: barman-cloud-plugin
|
|
REGISTRY_NAME: registry.barman-cloud-plugin
|
|
REGISTRY_PORT: 5000
|
|
DAGGER_ENGINE_CONTAINER_NAME: e2e-dagger-engine
|
|
|
|
tasks:
|
|
lint:
|
|
desc: Run golangci-lint
|
|
env:
|
|
# renovate: datasource=git-refs depName=golangci-lint lookupName=https://github.com/sagikazarmark/daggerverse currentValue=main
|
|
DAGGER_GOLANGCI_LINT_SHA: 5dcc7e4c4cd5ed230046955f42e27f2166545155
|
|
# renovate: datasource=docker depName=golangci/golangci-lint versioning=semver
|
|
GOLANGCI_LINT_VERSION: v2.11.4
|
|
cmds:
|
|
- >
|
|
GITHUB_REF= dagger -sc "github.com/sagikazarmark/daggerverse/golangci-lint@${DAGGER_GOLANGCI_LINT_SHA}
|
|
--version ${GOLANGCI_LINT_VERSION} |
|
|
run . --config .golangci.yml | stdout"
|
|
sources:
|
|
- ./**/*.go
|
|
|
|
wordlist-ordered:
|
|
desc: Order the word list file
|
|
cmds:
|
|
- LANG=C LC_ALL=C sort .wordlist.txt > .wordlist.txt.new
|
|
- mv -f .wordlist.txt.new .wordlist.txt
|
|
sources:
|
|
- .wordlist.txt
|
|
|
|
spellcheck:
|
|
desc: Run spellcheck
|
|
deps:
|
|
- wordlist-ordered
|
|
env:
|
|
# renovate: datasource=git-refs depName=spellcheck lookupName=https://github.com/cloudnative-pg/daggerverse currentValue=main
|
|
DAGGER_SPELLCHECK_SHA: f84ac0c681fcfff4d6f138bf53d44d023f615b48
|
|
cmds:
|
|
- >
|
|
GITHUB_REF= dagger -s call -m github.com/cloudnative-pg/daggerverse/spellcheck@${DAGGER_SPELLCHECK_SHA}
|
|
spellcheck --source . with-exec --use-entrypoint --args="" stdout
|
|
sources:
|
|
- ./**/*.md
|
|
- .spellcheck.yaml
|
|
- .wordlist.txt
|
|
|
|
commitlint:
|
|
desc: Check for conventional commits
|
|
env:
|
|
# renovate: datasource=git-refs depName=commitlint lookupName=https://github.com/cloudnative-pg/daggerverse currentValue=main
|
|
DAGGER_COMMITLINT_SHA: f84ac0c681fcfff4d6f138bf53d44d023f615b48
|
|
cmds:
|
|
- >
|
|
GITHUB_REF= dagger -s call -m github.com/cloudnative-pg/daggerverse/commitlint@${DAGGER_COMMITLINT_SHA}
|
|
lint --source . --args "--from=origin/main" stdout
|
|
|
|
uncommitted:
|
|
desc: Check for uncommitted changes
|
|
deps:
|
|
- manifest-main
|
|
- apidoc
|
|
- wordlist-ordered
|
|
env:
|
|
# renovate: datasource=git-refs depName=uncommitted lookupName=https://github.com/cloudnative-pg/daggerverse currentValue=main
|
|
DAGGER_UNCOMMITTED_SHA: f84ac0c681fcfff4d6f138bf53d44d023f615b48
|
|
cmds:
|
|
- GITHUB_REF= dagger -s call -m github.com/cloudnative-pg/daggerverse/uncommitted@${DAGGER_UNCOMMITTED_SHA} check-uncommitted --source . stdout
|
|
sources:
|
|
- ./**
|
|
|
|
apidoc:
|
|
desc: Update the API Reference section of the documentation
|
|
deps:
|
|
- controller-gen
|
|
env:
|
|
# renovate: datasource=git-refs depName=crd-gen-refs lookupName=https://github.com/cloudnative-pg/daggerverse currentValue=main
|
|
DAGGER_CRDGENREF_SHA: f84ac0c681fcfff4d6f138bf53d44d023f615b48
|
|
# renovate: datasource=go depName=github.com/elastic/crd-ref-docs
|
|
CRDREFDOCS_VERSION: v0.3.0
|
|
cmds:
|
|
- >
|
|
GITHUB_REF= dagger -s call -m github.com/cloudnative-pg/daggerverse/crd-ref-docs@${DAGGER_CRDGENREF_SHA}
|
|
--version ${CRDREFDOCS_VERSION}
|
|
generate
|
|
--src .
|
|
--source-path api/v1
|
|
--config-file hack/crd-gen-refs/config.yaml
|
|
--renderer markdown
|
|
--templates-dir hack/crd-gen-refs/markdown
|
|
file --path out.md
|
|
export --path web/docs/plugin-barman-cloud.v1.md
|
|
sources:
|
|
- ./api/**/*.go
|
|
- ./hack/docs/crd-gen-refs/**/*
|
|
- ./Taskfile.yml
|
|
|
|
docusaurus-build-test:
|
|
desc: Check that the documentation builds
|
|
deps:
|
|
- apidoc
|
|
env:
|
|
# renovate: datasource=git-refs depName=docusaurus lookupName=https://github.com/levlaz/daggerverse currentValue=main
|
|
DAGGER_DOCUSAURUS_SHA: 93f57fccbd5afd22fa917107ab7697f3e7db0e5a
|
|
cmds:
|
|
- GITHUB_REF= dagger -s call -m github.com/levlaz/daggerverse/docusaurus@${DAGGER_DOCUSAURUS_SHA}
|
|
--src web --yarn build
|
|
src:
|
|
- ./web/**/*
|
|
|
|
docusaurus-version-is-aligned:
|
|
desc: Verify that a documentation version exists for the current version of the plugin
|
|
cmds:
|
|
- $(dagger -s call -m dagger/check-doc-version has-version-documentation --src .)
|
|
src:
|
|
- .release-please-manifest.json
|
|
- ./web/versions.json
|
|
|
|
go-test:
|
|
desc: Run go test
|
|
env:
|
|
# renovate: datasource=git-refs depname=kubernetes packageName=https://github.com/kubernetes/kubernetes versioning=semver
|
|
K8S_VERSION: 1.31.0
|
|
# renovate: datasource=git-refs depName=controller-runtime packageName=https://github.com/kubernetes-sigs/controller-runtime versioning=semver
|
|
SETUP_ENVTEST_VERSION: 0.24.0
|
|
cmds:
|
|
- >
|
|
GITHUB_REF= dagger -s call -m ./dagger/gotest
|
|
--go-version {{.GO_VERSION}}
|
|
--kube-version ${K8S_VERSION}
|
|
--setup-envtest-version ${SETUP_ENVTEST_VERSION}
|
|
unit-test --src .
|
|
stdout
|
|
sources:
|
|
- ./**/*.go
|
|
|
|
generate-certs:
|
|
desc: Generate certificates for the local registry
|
|
run: once
|
|
cmds:
|
|
- >
|
|
mkdir -p certs &&
|
|
docker volume create certs &&
|
|
docker run -v certs:/certs -w /certs --name certs --entrypoint=/bin/sh alpine/openssl -c '
|
|
openssl genrsa -out ca-key.pem 4096 &&
|
|
openssl req -new -x509 -days 365 -key ca-key.pem -sha256 -out ca.pem \
|
|
-subj "/O=CloudNativePG/OU=Barman Cloud Plugin Testing" &&
|
|
openssl genrsa -out server-key.pem 4096 &&
|
|
openssl req -subj "/CN={{ .REGISTRY_NAME }}" -sha256 -new -key server-key.pem -out server.csr &&
|
|
echo subjectAltName = DNS:{{ .REGISTRY_NAME }},IP:127.0.0.1 >> extfile.cnf &&
|
|
echo extendedKeyUsage = serverAuth >> extfile.cnf &&
|
|
openssl x509 -req -days 365 -sha256 -in server.csr -CA ca.pem -CAkey ca-key.pem \
|
|
-CAcreateserial -out server-cert.pem -extfile extfile.cnf'
|
|
docker cp certs:/certs/ca.pem certs/ca.pem &&
|
|
docker rm certs
|
|
status:
|
|
- docker volume inspect certs
|
|
- test -f certs/ca.pem
|
|
|
|
start-build-network:
|
|
desc: Create a docker network for image building used by the dagger engine and the registry
|
|
run: once
|
|
cmds:
|
|
- docker network create {{ .REGISTRY_NETWORK}}
|
|
status:
|
|
- docker network inspect {{ .REGISTRY_NETWORK }}
|
|
|
|
start-registry:
|
|
desc: Start a container registry
|
|
run: once
|
|
deps:
|
|
- generate-certs
|
|
- start-build-network
|
|
env:
|
|
# renovate: datasource=docker depName=registry versioning=semver
|
|
REGISTRY_VERSION: 2
|
|
cmds:
|
|
- >
|
|
docker run -d --name {{ .REGISTRY_NAME }}
|
|
-p {{ .REGISTRY_PORT }}:5000
|
|
--network {{ .REGISTRY_NETWORK }}
|
|
-v certs:/certs
|
|
-e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/server-cert.pem -e REGISTRY_HTTP_TLS_KEY=/certs/server-key.pem
|
|
registry:${REGISTRY_VERSION}
|
|
status:
|
|
- \[ "$(docker inspect -f {{`'{{.State.Running}}'`}} "{{ .REGISTRY_NAME }}" 2> /dev/null )" == 'true' \]
|
|
|
|
|
|
# Start a dagger engine that mounts the CA certificate for the local registry.
|
|
start-dagger-engine-for-local-builds:
|
|
desc: Start a dagger engine mounting the CA
|
|
run: once
|
|
deps:
|
|
- generate-certs
|
|
- start-build-network
|
|
vars:
|
|
# renovate: datasource=github-tags depName=dagger/dagger versioning=semver
|
|
DAGGER_VERSION: 0.20.6
|
|
DAGGER_ENGINE_IMAGE: registry.dagger.io/engine:v{{ .DAGGER_VERSION }}
|
|
cmds:
|
|
- >
|
|
docker run -d -v /var/lib/dagger --name "{{ .DAGGER_ENGINE_CONTAINER_NAME }}"
|
|
--network={{ .REGISTRY_NETWORK }}
|
|
-v certs:/usr/local/share/ca-certificates/
|
|
--privileged {{ .DAGGER_ENGINE_IMAGE }}
|
|
status:
|
|
- \[ "$(docker inspect -f {{`'{{.State.Running}}'`}} "{{ .DAGGER_ENGINE_CONTAINER_NAME }}" 2> /dev/null )" == 'true' \]
|
|
|
|
# We build an image and push it to a local registry.
|
|
# The name is always `plugin-barman-cloud:testing`.
|
|
build-plugin-image:
|
|
desc: Build the operator container image for the plugin
|
|
deps:
|
|
- start-registry
|
|
- start-dagger-engine-for-local-builds
|
|
env:
|
|
# renovate: datasource=git-refs depName=docker lookupName=https://github.com/purpleclay/daggerverse currentValue=main
|
|
DAGGER_DOCKER_SHA: ee12c1a4a2630e194ec20c5a9959183e3a78c192
|
|
_EXPERIMENTAL_DAGGER_RUNNER_HOST: docker-container://{{ .DAGGER_ENGINE_CONTAINER_NAME }}
|
|
cmds:
|
|
- >
|
|
GITHUB_REF= dagger -s call -m github.com/purpleclay/daggerverse/docker@${DAGGER_DOCKER_SHA}
|
|
build --dir . --file containers/Dockerfile.plugin --args GO_VERSION={{.GO_VERSION}} --platform linux/amd64
|
|
publish --ref {{ .REGISTRY_NAME }}:{{ .REGISTRY_PORT }}/plugin-barman-cloud --tags testing
|
|
|
|
# We build an image and push it to a local registry.
|
|
# The name is always `sidecar-barman-cloud:testing`.
|
|
build-sidecar-image:
|
|
desc: Build the sidecar container image for the plugin
|
|
deps:
|
|
- start-registry
|
|
- start-dagger-engine-for-local-builds
|
|
env:
|
|
# renovate: datasource=git-refs depName=docker lookupName=https://github.com/purpleclay/daggerverse currentValue=main
|
|
DAGGER_DOCKER_SHA: ee12c1a4a2630e194ec20c5a9959183e3a78c192
|
|
_EXPERIMENTAL_DAGGER_RUNNER_HOST: docker-container://{{ .DAGGER_ENGINE_CONTAINER_NAME }}
|
|
cmds:
|
|
- >
|
|
GITHUB_REF= dagger -s call -m github.com/purpleclay/daggerverse/docker@${DAGGER_DOCKER_SHA}
|
|
build --dir . --file containers/Dockerfile.sidecar --args GO_VERSION={{.GO_VERSION}} --platform linux/amd64
|
|
publish --ref {{ .REGISTRY_NAME }}:{{ .REGISTRY_PORT }}/sidecar-barman-cloud --tags testing
|
|
|
|
build-images:
|
|
desc: Build the container images for the plugin
|
|
deps:
|
|
- build-plugin-image
|
|
- build-sidecar-image
|
|
|
|
# Install kind if not at the expected version.
|
|
install-kind:
|
|
desc: Install kind
|
|
run: once
|
|
vars:
|
|
# renovate: datasource=git-refs depName=kind lookupName=https://github.com/kubernetes-sigs/kind versioning=semver
|
|
KIND_VERSION: v0.31.0
|
|
cmds:
|
|
- go install sigs.k8s.io/kind@{{.KIND_VERSION}}
|
|
- kind version | grep -q {{.KIND_VERSION}}
|
|
status:
|
|
- kind version | grep -q {{.KIND_VERSION}}
|
|
|
|
start-kind-cluster:
|
|
desc: Start a kind cluster
|
|
deps:
|
|
- install-kind
|
|
- start-build-network
|
|
- generate-certs
|
|
run: once
|
|
cmds:
|
|
- >
|
|
kind create cluster --name {{ .E2E_CLUSTER_NAME }}
|
|
--image kindest/node:{{ .E2E_KUBERNETES_VERSION }}
|
|
--config hack/kind-config.yaml
|
|
--wait 5m
|
|
- >
|
|
for node in $(kind get nodes --name {{ .E2E_CLUSTER_NAME }} ); do
|
|
docker network connect {{ .REGISTRY_NETWORK }} $node;
|
|
docker exec $node sh -c "update-ca-certificates";
|
|
done
|
|
status:
|
|
- kind get clusters | grep -q {{ .E2E_CLUSTER_NAME }}
|
|
|
|
# TODO: see if it is possible to daggerize this. It will have to manage docker to make kind work.
|
|
# TODO: add a task to clean up the kind cluster for new test runs.
|
|
# Run the e2e tests. This task will start a kind cluster, deploy the plugin, and run the tests.
|
|
# Running the e2e tests requires:
|
|
# * The registry to have a valid TLS certificate.
|
|
# * The registry to be in the same network of the dagger-engine.
|
|
# * The dagger-engine to mount the CA.
|
|
# * The kind cluster to mount the CA.
|
|
e2e-external-kind:
|
|
desc: Run e2e tests in a local kind cluster
|
|
deps:
|
|
- build-images
|
|
- start-kind-cluster
|
|
vars:
|
|
KUBECONFIG_PATH:
|
|
sh: mktemp -t kubeconfig-XXXXX
|
|
env:
|
|
_EXPERIMENTAL_DAGGER_RUNNER_HOST: docker-container://{{ .DAGGER_ENGINE_CONTAINER_NAME }}
|
|
cmds:
|
|
- kind get kubeconfig --internal --name {{ .E2E_CLUSTER_NAME }} > {{ .KUBECONFIG_PATH }}
|
|
- >
|
|
GITHUB_REF= dagger call -m dagger/e2e/ run
|
|
--source .
|
|
--kubeconfig {{.KUBECONFIG_PATH}}
|
|
--go-version {{.GO_VERSION}}
|
|
|
|
e2e-ephemeral:
|
|
desc: Run e2e tests in an ephemeral k3s cluster
|
|
deps:
|
|
- build-images
|
|
env:
|
|
_EXPERIMENTAL_DAGGER_RUNNER_HOST: docker-container://{{ .DAGGER_ENGINE_CONTAINER_NAME }}
|
|
cmds:
|
|
- >
|
|
GITHUB_REF= dagger call -m dagger/e2e/ run-ephemeral
|
|
--source .
|
|
--ca certs/ca.pem
|
|
--registry {{.REGISTRY_NAME}}:{{.REGISTRY_PORT}}
|
|
--go-version {{.GO_VERSION}}
|
|
|
|
ci:
|
|
desc: Run the CI pipeline
|
|
deps:
|
|
- spellcheck
|
|
- commitlint
|
|
- uncommitted
|
|
- lint
|
|
- go-test
|
|
- e2e-ephemeral
|
|
- docusaurus-build-test
|
|
- docusaurus-version-is-aligned
|
|
|
|
publish:
|
|
desc: Build and publish a container image for the plugin
|
|
requires:
|
|
# We expect this to run in a GitHub workflow, so we put a few GitHub-specific vars here
|
|
# to prevent running this task locally by accident.
|
|
vars:
|
|
- CI
|
|
- GITHUB_REPOSITORY
|
|
- GITHUB_REF
|
|
- GITHUB_REF_NAME
|
|
- REGISTRY_USER
|
|
- REGISTRY_PASSWORD
|
|
vars:
|
|
PLUGIN_IMAGE_NAME: ghcr.io/{{.GITHUB_REPOSITORY}}{{if not (hasPrefix "refs/tags/v" .GITHUB_REF)}}-testing{{end}}
|
|
SIDECAR_IMAGE_NAME: ghcr.io/{{.GITHUB_REPOSITORY}}-sidecar{{if not (hasPrefix "refs/tags/v" .GITHUB_REF)}}-testing{{end}}
|
|
# remove /merge suffix from the branch name. This is a workaround for the GitHub workflow on PRs,
|
|
# where the branch name is suffixed with /merge. Prepend pr- to the branch name on PRs.
|
|
IMAGE_VERSION: '{{regexReplaceAll "(\\d+)/merge" .GITHUB_REF_NAME "pr-${1}"}}'
|
|
env:
|
|
# renovate: datasource=git-refs depName=docker lookupName=https://github.com/purpleclay/daggerverse currentValue=main
|
|
DAGGER_DOCKER_SHA: ee12c1a4a2630e194ec20c5a9959183e3a78c192
|
|
cmds:
|
|
- >
|
|
dagger call -m github.com/purpleclay/daggerverse/docker@${DAGGER_DOCKER_SHA}
|
|
--registry ghcr.io --username $REGISTRY_USER --password env:REGISTRY_PASSWORD
|
|
build --dir . --file containers/Dockerfile.plugin --args GO_VERSION={{.GO_VERSION}} --platform linux/amd64 --platform linux/arm64
|
|
publish --ref {{.PLUGIN_IMAGE_NAME}} --tags {{.IMAGE_VERSION}}
|
|
- >
|
|
dagger call -m github.com/purpleclay/daggerverse/docker@${DAGGER_DOCKER_SHA}
|
|
--registry ghcr.io --username $REGISTRY_USER --password env:REGISTRY_PASSWORD
|
|
build --dir . --file containers/Dockerfile.sidecar --args GO_VERSION={{.GO_VERSION}} --platform linux/amd64 --platform linux/arm64
|
|
publish --ref {{.SIDECAR_IMAGE_NAME}} --tags {{.IMAGE_VERSION}}
|
|
|
|
controller-gen:
|
|
desc: Run controller-gen
|
|
run: once
|
|
env:
|
|
# renovate: datasource=git-refs depName=controller-gen lookupName=https://github.com/cloudnative-pg/daggerverse currentValue=main
|
|
DAGGER_CONTROLLER_GEN_SHA: f84ac0c681fcfff4d6f138bf53d44d023f615b48
|
|
cmds:
|
|
- >
|
|
GITHUB_REF= dagger -s call -m github.com/cloudnative-pg/daggerverse/controller-gen@${DAGGER_CONTROLLER_GEN_SHA}
|
|
controller-gen --source . --args object:headerFile=hack/boilerplate.go.txt --args paths=./api/...
|
|
file --path api/v1/zz_generated.deepcopy.go export --path api/v1/zz_generated.deepcopy.go
|
|
- >
|
|
GITHUB_REF= dagger -s call -m github.com/cloudnative-pg/daggerverse/controller-gen@${DAGGER_CONTROLLER_GEN_SHA}
|
|
controller-gen --source . --args rbac:roleName=plugin-barman-cloud --args crd --args webhook
|
|
--args paths=./api/... --args paths=./internal/... --args output:crd:artifacts:config=config/crd/bases
|
|
directory --path config/
|
|
filter --include crd/bases/,rbac/
|
|
export --path config/
|
|
sources:
|
|
- ./api/**/*.go
|
|
- ./internal/**/*.go
|
|
generates:
|
|
- ./api/v1/zz_generated.deepcopy.go
|
|
- ./config/rbac/role.yaml
|
|
- ./config/crd/bases/*.yaml
|
|
|
|
manifest-main:
|
|
deps:
|
|
- controller-gen
|
|
desc: Generate the manifest for the main branch
|
|
vars:
|
|
GITHUB_REPOSITORY: cloudnative-pg/plugin-barman-cloud
|
|
GITHUB_REF: main
|
|
GITHUB_REF_NAME: main
|
|
cmds:
|
|
- task: manifest-internal
|
|
vars:
|
|
GITHUB_REPOSITORY: '{{.GITHUB_REPOSITORY}}'
|
|
GITHUB_REF: '{{.GITHUB_REF}}'
|
|
GITHUB_REF_NAME: '{{.GITHUB_REF_NAME}}'
|
|
|
|
manifest:
|
|
desc: Generate the manifest to be uploaded to the release or as a workflow artifact
|
|
deps:
|
|
- controller-gen
|
|
requires:
|
|
# We expect this to run in a GitHub workflow, so we put a few GitHub-specific vars here
|
|
# to prevent running this task locally by accident.
|
|
vars:
|
|
- CI
|
|
- GITHUB_REPOSITORY
|
|
- GITHUB_REF
|
|
- GITHUB_REF_NAME
|
|
cmds:
|
|
- task: manifest-internal
|
|
vars:
|
|
GITHUB_REPOSITORY: '{{.GITHUB_REPOSITORY}}'
|
|
GITHUB_REF: '{{.GITHUB_REF}}'
|
|
GITHUB_REF_NAME: '{{.GITHUB_REF_NAME}}'
|
|
|
|
manifest-internal:
|
|
desc: Update the image in the Kustomization
|
|
label: manifest-internal-{{.GITHUB_REF_NAME}}
|
|
internal: true
|
|
requires:
|
|
vars:
|
|
- GITHUB_REPOSITORY
|
|
- GITHUB_REF
|
|
- GITHUB_REF_NAME
|
|
vars:
|
|
PLUGIN_IMAGE_NAME: ghcr.io/{{.GITHUB_REPOSITORY}}{{if not (hasPrefix "refs/tags/v" .GITHUB_REF)}}-testing{{end}}
|
|
SIDECAR_IMAGE_NAME: ghcr.io/{{.GITHUB_REPOSITORY}}-sidecar{{if not (hasPrefix "refs/tags/v" .GITHUB_REF)}}-testing{{end}}
|
|
# remove /merge suffix from the branch name. This is a workaround for the GitHub workflow on PRs,
|
|
# where the branch name is suffixed with /merge. Prepend pr- to the branch name on PRs.
|
|
IMAGE_VERSION: '{{regexReplaceAll "(\\d+)/merge" .GITHUB_REF_NAME "pr-${1}"}}'
|
|
env:
|
|
# renovate: datasource=git-refs depName=kustomize lookupName=https://github.com/sagikazarmark/daggerverse currentValue=main
|
|
DAGGER_KUSTOMIZE_SHA: 5dcc7e4c4cd5ed230046955f42e27f2166545155
|
|
cmds:
|
|
- >
|
|
dagger -s call -m https://github.com/sagikazarmark/daggerverse/kustomize@${DAGGER_KUSTOMIZE_SHA}
|
|
edit --source . --dir kubernetes
|
|
set image --image plugin-barman-cloud={{.PLUGIN_IMAGE_NAME}}:{{.IMAGE_VERSION}}
|
|
set secret --secret plugin-barman-cloud --from-literal SIDECAR_IMAGE={{.SIDECAR_IMAGE_NAME}}:{{.IMAGE_VERSION}}
|
|
directory directory --path kubernetes export --path manifest-build
|
|
- >
|
|
dagger -s call -m github.com/sagikazarmark/daggerverse/kustomize@${DAGGER_KUSTOMIZE_SHA}
|
|
build --source . --dir manifest-build export --path manifest.yaml
|
|
sources:
|
|
- ./config/**/*.yaml
|
|
- ./kubernetes/**/*.yaml
|
|
generates:
|
|
- ./manifest.yaml
|
|
|
|
upload-manifest-to-release:
|
|
desc: Upload the manifest to the release
|
|
requires:
|
|
# We expect this to run in a GitHub workflow, so we put a few GitHub-specific vars here
|
|
# to prevent running this task locally by accident.
|
|
vars:
|
|
- CI
|
|
- GITHUB_REPOSITORY
|
|
- GITHUB_REF
|
|
- GITHUB_REF_NAME
|
|
- GITHUB_TOKEN
|
|
env:
|
|
# renovate: datasource=git-refs depName=gh lookupName=https://github.com/sagikazarmark/daggerverse
|
|
DAGGER_GH_SHA: 5dcc7e4c4cd5ed230046955f42e27f2166545155
|
|
preconditions:
|
|
- sh: "[[ {{.GITHUB_REF}} =~ 'refs/tags/v.*' ]]"
|
|
msg: not a tag, failing
|
|
cmds:
|
|
- >
|
|
dagger -s call -m github.com/sagikazarmark/daggerverse/gh@${DAGGER_GH_SHA}
|
|
with-source --source .
|
|
run --repo {{.GITHUB_REPOSITORY}} --token env:GITHUB_TOKEN
|
|
--cmd "release upload {{.GITHUB_REF_NAME}} manifest.yaml"
|
|
|
|
clean:
|
|
desc: Remove autogenerated artifacts
|
|
cmds:
|
|
- rm -rf .task/
|