Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ jobs:
hack/create-kubeconfig.sh postgres-operator pgo
docker run --detach --network host --read-only \
--volume "$(pwd):/mnt" --workdir '/mnt' \
--env 'CHECK_FOR_UPGRADES=false' \
--env 'QUERIES_CONFIG_DIR=/mnt/hack/tools/queries' \
--env 'KUBECONFIG=hack/.kube/postgres-operator/pgo' \
--env 'RELATED_IMAGE_PGBACKREST=registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:ubi9-2.56.0-2534' \
Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ deploy-dev: createnamespaces
QUERIES_CONFIG_DIR='$(QUERIES_CONFIG_DIR)' \
CRUNCHY_DEBUG="$${CRUNCHY_DEBUG:-true}" \
PGO_FEATURE_GATES="$${PGO_FEATURE_GATES:-AllAlpha=true,AppendCustomQueries=false}" \
CHECK_FOR_UPGRADES="$${CHECK_FOR_UPGRADES:-false}" \
KUBECONFIG=hack/.kube/postgres-operator/pgo \
PGO_NAMESPACE='postgres-operator' \
PGO_INSTALLER='deploy-dev' \
Expand Down
20 changes: 2 additions & 18 deletions cmd/postgres-operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ import (
"github.com/crunchydata/postgres-operator/internal/initialize"
"github.com/crunchydata/postgres-operator/internal/kubernetes"
"github.com/crunchydata/postgres-operator/internal/logging"
"github.com/crunchydata/postgres-operator/internal/registration"
"github.com/crunchydata/postgres-operator/internal/tracing"
"github.com/crunchydata/postgres-operator/internal/upgradecheck"
"github.com/crunchydata/postgres-operator/pkg/apis/postgres-operator.crunchydata.com/v1beta1"
)

Expand Down Expand Up @@ -243,10 +241,6 @@ func main() {
manager := need(runtime.NewManager(config, options))
must(manager.Add(k8s))

registrar := need(registration.NewRunner(os.Getenv("RSA_KEY"), os.Getenv("TOKEN_PATH"), stopRunning))
must(manager.Add(registrar))
token, _ := registrar.CheckToken()

bridgeURL := os.Getenv("PGO_BRIDGE_URL")
bridgeClient := func() *bridge.Client {
client := bridge.NewClient(bridgeURL, versionString)
Expand All @@ -255,8 +249,8 @@ func main() {
}

// add all PostgreSQL Operator controllers to the runtime manager
must(pgupgrade.ManagedReconciler(manager, registrar))
must(postgrescluster.ManagedReconciler(manager, registrar))
must(pgupgrade.ManagedReconciler(manager))
must(postgrescluster.ManagedReconciler(manager))
must(standalone_pgadmin.ManagedReconciler(manager))
must(crunchybridgecluster.ManagedReconciler(manager, func() bridge.ClientInterface {
return bridgeClient()
Expand All @@ -266,16 +260,6 @@ func main() {
must(bridge.ManagedInstallationReconciler(manager, bridgeClient))
}

// Enable upgrade checking
upgradeCheckingDisabled := strings.EqualFold(os.Getenv("CHECK_FOR_UPGRADES"), "false")
if !upgradeCheckingDisabled {
log.Info("upgrade checking enabled")
url := os.Getenv("CHECK_FOR_UPGRADES_URL")
must(upgradecheck.ManagedScheduler(manager, url, versionString, token))
} else {
log.Info("upgrade checking disabled")
}

// Enable health probes
must(manager.AddHealthzCheck("health", healthz.Ping))
must(manager.AddReadyzCheck("check", healthz.Ping))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19085,11 +19085,6 @@ spec:
type: integer
type: object
type: object
registrationRequired:
properties:
pgoVersion:
type: string
type: object
startupInstance:
description: |-
The instance that should be started first when bootstrapping and/or starting a
Expand All @@ -19098,8 +19093,6 @@ spec:
startupInstanceSet:
description: The instance set associated with the startupInstance
type: string
tokenRequired:
type: string
userInterface:
description: Current state of the PostgreSQL user interface.
properties:
Expand Down Expand Up @@ -38138,11 +38131,6 @@ spec:
type: integer
type: object
type: object
registrationRequired:
properties:
pgoVersion:
type: string
type: object
startupInstance:
description: |-
The instance that should be started first when bootstrapping and/or starting a
Expand All @@ -38151,8 +38139,6 @@ spec:
startupInstanceSet:
description: The instance set associated with the startupInstance
type: string
tokenRequired:
type: string
userInterface:
description: Current state of the PostgreSQL user interface.
properties:
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ go 1.24.0

require (
github.com/go-logr/logr v1.4.3
github.com/golang-jwt/jwt/v5 v5.3.0
github.com/google/go-cmp v0.7.0
github.com/google/uuid v1.6.0
github.com/itchyny/gojq v0.12.17
github.com/kubernetes-csi/external-snapshotter/client/v8 v8.2.0
github.com/onsi/ginkgo/v2 v2.25.3
Expand Down Expand Up @@ -62,6 +60,7 @@ require (
github.com/google/cel-go v0.23.2 // indirect
github.com/google/gnostic-models v0.6.9 // indirect
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect
github.com/grafana/regexp v0.0.0-20240518133315-a468a5bfb3bc // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.2 // indirect
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ github.com/gobuffalo/flect v1.0.3 h1:xeWBM2nui+qnVvNM4S3foBhCAL2XgPU+a7FdpelbTq4
github.com/gobuffalo/flect v1.0.3/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo=
github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
Expand Down
11 changes: 2 additions & 9 deletions internal/controller/pgupgrade/pgupgrade_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"github.com/crunchydata/postgres-operator/internal/controller/runtime"
"github.com/crunchydata/postgres-operator/internal/logging"
"github.com/crunchydata/postgres-operator/internal/naming"
"github.com/crunchydata/postgres-operator/internal/registration"
"github.com/crunchydata/postgres-operator/internal/tracing"
"github.com/crunchydata/postgres-operator/pkg/apis/postgres-operator.crunchydata.com/v1beta1"
)
Expand All @@ -34,8 +33,7 @@ const (

// PGUpgradeReconciler reconciles a PGUpgrade object
type PGUpgradeReconciler struct {
Recorder record.EventRecorder
Registration registration.Registration
Recorder record.EventRecorder

Reader interface {
Get(context.Context, client.ObjectKey, client.Object, ...client.GetOption) error
Expand All @@ -55,14 +53,13 @@ type PGUpgradeReconciler struct {
//+kubebuilder:rbac:groups="postgres-operator.crunchydata.com",resources="postgresclusters",verbs={get,list,watch}

// ManagedReconciler creates a [PGUpgradeReconciler] and adds it to m.
func ManagedReconciler(m ctrl.Manager, r registration.Registration) error {
func ManagedReconciler(m ctrl.Manager) error {
kubernetes := client.WithFieldOwner(m.GetClient(), naming.ControllerPGUpgrade)
recorder := m.GetEventRecorderFor(naming.ControllerPGUpgrade)

reconciler := &PGUpgradeReconciler{
Reader: kubernetes,
Recorder: recorder,
Registration: r,
StatusWriter: kubernetes.Status(),
Writer: kubernetes,
}
Expand Down Expand Up @@ -150,10 +147,6 @@ func (r *PGUpgradeReconciler) Reconcile(ctx context.Context, upgrade *v1beta1.PG
return
}

if !r.UpgradeAuthorized(upgrade) {
return ctrl.Result{}, nil
}

// Set progressing condition to true if it doesn't exist already
setStatusToProgressingIfReasonWas("", upgrade)

Expand Down
27 changes: 0 additions & 27 deletions internal/controller/pgupgrade/registration.go

This file was deleted.

95 changes: 0 additions & 95 deletions internal/controller/pgupgrade/registration_test.go

This file was deleted.

13 changes: 2 additions & 11 deletions internal/controller/postgrescluster/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import (
"github.com/crunchydata/postgres-operator/internal/naming"
"github.com/crunchydata/postgres-operator/internal/pki"
"github.com/crunchydata/postgres-operator/internal/postgres"
"github.com/crunchydata/postgres-operator/internal/registration"
"github.com/crunchydata/postgres-operator/internal/tracing"
"github.com/crunchydata/postgres-operator/pkg/apis/postgres-operator.crunchydata.com/v1beta1"
)
Expand Down Expand Up @@ -64,8 +63,7 @@ type Reconciler struct {
Patch(context.Context, client.Object, client.Patch, ...client.SubResourcePatchOption) error
}

Recorder record.EventRecorder
Registration registration.Registration
Recorder record.EventRecorder
}

// +kubebuilder:rbac:groups="",resources="events",verbs={create,patch}
Expand Down Expand Up @@ -183,12 +181,6 @@ func (r *Reconciler) Reconcile(
return nil
}

if r.Registration != nil && r.Registration.Required(r.Recorder, cluster, &cluster.Status.Conditions) {
registration.SetAdvanceWarning(r.Recorder, cluster, &cluster.Status.Conditions)
}
cluster.Status.RegistrationRequired = nil
cluster.Status.TokenRequired = ""

// if the cluster is paused, set a condition and return
if cluster.Spec.Paused != nil && *cluster.Spec.Paused {
meta.SetStatusCondition(&cluster.Status.Conditions, metav1.Condition{
Expand Down Expand Up @@ -444,7 +436,7 @@ func (r *Reconciler) setOwnerReference(
// +kubebuilder:rbac:groups="postgres-operator.crunchydata.com",resources="postgresclusters",verbs={get,list,watch}

// ManagedReconciler creates a [Reconciler] and adds it to m.
func ManagedReconciler(m manager.Manager, r registration.Registration) error {
func ManagedReconciler(m manager.Manager) error {
exec, err := runtime.NewPodExecutor(m.GetConfig())
kubernetes := client.WithFieldOwner(m.GetClient(), naming.ControllerPostgresCluster)
recorder := m.GetEventRecorderFor(naming.ControllerPostgresCluster)
Expand All @@ -453,7 +445,6 @@ func ManagedReconciler(m manager.Manager, r registration.Registration) error {
PodExec: exec,
Reader: kubernetes,
Recorder: recorder,
Registration: r,
StatusWriter: kubernetes.Status(),
Writer: kubernetes,
}
Expand Down
Loading
Loading