Embed CRD to be submitted by the operator

Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
This commit is contained in:
Mikkel Oscar Lyderik Larsen 2026-01-09 16:12:12 +01:00
parent 8480a80d62
commit 7cb8170d1c
4 changed files with 27 additions and 1067 deletions

3
.gitignore vendored
View File

@ -106,3 +106,6 @@ mocks
ui/.npm/
.DS_Store
# temp build files
pkg/apis/acid.zalan.do/v1/postgresql.crd.yaml

View File

@ -55,6 +55,7 @@ default: local
clean:
rm -rf build
rm $(GENERATED)
rm pkg/apis/acid.zalan.do/v1/postgresql.crd.yaml
verify:
hack/verify-codegen.sh
@ -72,6 +73,7 @@ $(GENERATED_CRDS): $(GENERATED)
@sed -i -e 's/listKind: PostgresqlList/listKind: postgresqlList/' manifests/postgresql.crd.yaml
@hack/adjust_postgresql_crd.sh
@mv manifests/acid.zalan.do_postgresteams.yaml manifests/postgresteam.crd.yaml
@cp manifests/postgresql.crd.yaml pkg/apis/acid.zalan.do/v1/postgresql.crd.yaml
local: ${SOURCES} $(GENERATED_CRDS)
CGO_ENABLED=${CGO_ENABLED} go build -o build/${BINARY} $(LOCAL_BUILD_FLAGS) -ldflags "$(LDFLAGS)" $(SOURCES)
@ -103,7 +105,7 @@ vet:
@go vet $(PKG)
@staticcheck $(PKG)
test: mocks $(GENERATED)
test: mocks $(GENERATED) $(GENERATED_CRDS)
GO111MODULE=on go test ./...
codegen: $(GENERATED)

File diff suppressed because it is too large Load Diff

View File

@ -103,7 +103,11 @@ func (c *Controller) createOperatorCRD(desiredCrd *apiextv1.CustomResourceDefini
}
func (c *Controller) createPostgresCRD() error {
return c.createOperatorCRD(acidv1.PostgresCRD(c.opConfig.CRDCategories))
crd, err := acidv1.PostgresCRD(c.opConfig.CRDCategories)
if err != nil {
return fmt.Errorf("could not create Postgres CRD object: %v", err)
}
return c.createOperatorCRD(crd)
}
func (c *Controller) createConfigurationCRD() error {