Compare commits

...

2 Commits

Author SHA1 Message Date
Niccolò Fei
bb7845dd62
fix(scheme): register meta types for CNPG scheme group version (#943)
Some checks failed
release-please / release-please (push) Failing after 5s
After the controller-runtime v0.24.0 upgrade (58f4fed), the instance
sidecar logged "v1.GetOptions is not suitable for converting to
postgresql.cnpg.io/v1" on every WAL archive, which broke retention
policy enforcement.

Register the standard meta types with metav1.AddToGroupVersion after the
AddKnownTypes call in internal/cnpgi/common/scheme.go and
internal/scheme/cnpg.go.

Closes #942

Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
2026-06-08 11:08:15 +02:00
Marco Nenciarini
3efe655ed5
ci: stop Dagger from shallow-cloning the working tree (#947)
In GitHub Actions pull request builds, Dagger's telemetry git-label
collection runs `git fetch --depth 1` against the working tree whenever
GITHUB_REF is a refs/pull/ ref, which turns the checkout into a shallow
clone. Once shallow, `git merge-base origin/main HEAD` finds no common
ancestor and the commitlint task (--from=origin/main) fails on every
pull request.

Most dagger invocations already prefix GITHUB_REF= to suppress this; a
few were missing it. Prefix the remaining calls so Dagger never
shallow-fetches the host repository.

Upstream Dagger bug: dagger/dagger#13351

Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
2026-06-08 09:17:21 +02:00
3 changed files with 10 additions and 6 deletions

View File

@ -122,7 +122,7 @@ tasks:
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 .)
- $(GITHUB_REF= dagger -s call -m dagger/check-doc-version has-version-documentation --src .)
src:
- .release-please-manifest.json
- ./web/versions.json
@ -366,12 +366,12 @@ tasks:
DAGGER_DOCKER_SHA: ee12c1a4a2630e194ec20c5a9959183e3a78c192
cmds:
- >
dagger call -m github.com/purpleclay/daggerverse/docker@${DAGGER_DOCKER_SHA}
GITHUB_REF= 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}
GITHUB_REF= 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}}
@ -456,13 +456,13 @@ tasks:
DAGGER_KUSTOMIZE_SHA: ff27cd50f6b4eed2e3753c520632cd6099e1ce52
cmds:
- >
dagger -s call -m https://github.com/sagikazarmark/daggerverse/kustomize@${DAGGER_KUSTOMIZE_SHA}
GITHUB_REF= 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}
GITHUB_REF= dagger -s call -m github.com/sagikazarmark/daggerverse/kustomize@${DAGGER_KUSTOMIZE_SHA}
build --source . --dir manifest-build export --path manifest.yaml
sources:
- ./config/**/*.yaml
@ -489,7 +489,7 @@ tasks:
msg: not a tag, failing
cmds:
- >
dagger -s call -m github.com/sagikazarmark/daggerverse/gh@${DAGGER_GH_SHA}
GITHUB_REF= 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"

View File

@ -25,6 +25,7 @@ import (
cnpgv1 "github.com/cloudnative-pg/cloudnative-pg/api/v1"
"github.com/cloudnative-pg/machinery/pkg/log"
"github.com/spf13/viper"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
@ -58,6 +59,7 @@ func GenerateScheme(ctx context.Context) *runtime.Scheme {
&cnpgv1.Backup{}, &cnpgv1.BackupList{},
&cnpgv1.ScheduledBackup{}, &cnpgv1.ScheduledBackupList{},
)
metav1.AddToGroupVersion(result, schemeGroupVersion)
schemeLog := log.FromContext(ctx)
schemeLog.Info("CNPG types registration", "schemeGroupVersion", schemeGroupVersion)

View File

@ -25,6 +25,7 @@ import (
cnpgv1 "github.com/cloudnative-pg/cloudnative-pg/api/v1"
"github.com/cloudnative-pg/machinery/pkg/log"
"github.com/spf13/viper"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)
@ -49,6 +50,7 @@ func AddCNPGToScheme(ctx context.Context, s *runtime.Scheme) {
&cnpgv1.Backup{}, &cnpgv1.BackupList{},
&cnpgv1.ScheduledBackup{}, &cnpgv1.ScheduledBackupList{},
)
metav1.AddToGroupVersion(s, schemeGroupVersion)
log.FromContext(ctx).Info("CNPG types registration", "schemeGroupVersion", schemeGroupVersion)
}