From 7952ee183014dc039ef1ba0e095769e908f819f3 Mon Sep 17 00:00:00 2001 From: Chris Bandy Date: Wed, 16 Oct 2024 17:00:34 -0500 Subject: [PATCH 1/2] Enable all feature gates during development Issue: PGO-1046 --- Makefile | 2 +- internal/feature/features.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index fb74c740c2..b49d64704f 100644 --- a/Makefile +++ b/Makefile @@ -119,7 +119,7 @@ undeploy: ## Undeploy the PostgreSQL Operator .PHONY: deploy-dev deploy-dev: ## Deploy the PostgreSQL Operator locally -deploy-dev: PGO_FEATURE_GATES ?= "TablespaceVolumes=true,VolumeSnapshots=true" +deploy-dev: PGO_FEATURE_GATES ?= "AllAlpha=true" deploy-dev: get-pgmonitor deploy-dev: build-postgres-operator deploy-dev: createnamespaces diff --git a/internal/feature/features.go b/internal/feature/features.go index ae0d4ac15b..b34117b748 100644 --- a/internal/feature/features.go +++ b/internal/feature/features.go @@ -75,6 +75,7 @@ const ( // Support automatically growing volumes AutoGrowVolumes = "AutoGrowVolumes" + // Deprecated BridgeIdentifiers = "BridgeIdentifiers" // Support custom sidecars for PostgreSQL instance Pods @@ -101,7 +102,7 @@ func NewGate() MutableGate { AppendCustomQueries: {Default: false, PreRelease: featuregate.Alpha}, AutoCreateUserSchema: {Default: true, PreRelease: featuregate.Beta}, AutoGrowVolumes: {Default: false, PreRelease: featuregate.Alpha}, - BridgeIdentifiers: {Default: false, PreRelease: featuregate.Alpha}, + BridgeIdentifiers: {Default: false, PreRelease: featuregate.Deprecated}, InstanceSidecars: {Default: false, PreRelease: featuregate.Alpha}, PGBouncerSidecars: {Default: false, PreRelease: featuregate.Alpha}, PGUpgradeCPUConcurrency: {Default: false, PreRelease: featuregate.Alpha}, From c7b9ba4f45623cb214375070fe4bf35dc6e1d3c7 Mon Sep 17 00:00:00 2001 From: Chris Bandy Date: Mon, 28 Oct 2024 12:21:34 -0500 Subject: [PATCH 2/2] Move CGO requirement to the effected code Forcing `CGO_ENABLED=1` in the Makefile is too far away from the reason we do it. Use a build constraint instead with a comment and link. See: 67fe735519a5cbc6cbd5f7ef3470340f5a560656 --- Makefile | 2 +- internal/postgres/users.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b49d64704f..345761f525 100644 --- a/Makefile +++ b/Makefile @@ -145,7 +145,7 @@ deploy-dev: createnamespaces ##@ Build - Binary .PHONY: build-postgres-operator build-postgres-operator: ## Build the postgres-operator binary - CGO_ENABLED=1 $(GO_BUILD) $(\ + $(GO_BUILD) $(\ ) --ldflags '-X "main.versionString=$(PGO_VERSION)"' $(\ ) --trimpath -o bin/postgres-operator ./cmd/postgres-operator diff --git a/internal/postgres/users.go b/internal/postgres/users.go index be8785a4e5..b7e351cd5e 100644 --- a/internal/postgres/users.go +++ b/internal/postgres/users.go @@ -2,6 +2,9 @@ // // SPDX-License-Identifier: Apache-2.0 +// [pg_query.Parse] requires CGO to compile and call https://github.com/pganalyze/libpg_query +//go:build cgo + package postgres import (