Skip to content

Commit 9b0345d

Browse files
sfc-gh-jmckulkajmckulk
authored andcommitted
Remove CHECK_FOR_UPGRADES and registration
1 parent 3262d87 commit 9b0345d

File tree

26 files changed

+8
-2475
lines changed

26 files changed

+8
-2475
lines changed

.github/workflows/test.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ jobs:
124124
hack/create-kubeconfig.sh postgres-operator pgo
125125
docker run --detach --network host --read-only \
126126
--volume "$(pwd):/mnt" --workdir '/mnt' \
127-
--env 'CHECK_FOR_UPGRADES=false' \
128127
--env 'QUERIES_CONFIG_DIR=/mnt/hack/tools/queries' \
129128
--env 'KUBECONFIG=hack/.kube/postgres-operator/pgo' \
130129
--env 'RELATED_IMAGE_PGBACKREST=registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:ubi9-2.56.0-2534' \

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ deploy-dev: createnamespaces
116116
QUERIES_CONFIG_DIR='$(QUERIES_CONFIG_DIR)' \
117117
CRUNCHY_DEBUG="$${CRUNCHY_DEBUG:-true}" \
118118
PGO_FEATURE_GATES="$${PGO_FEATURE_GATES:-AllAlpha=true,AppendCustomQueries=false}" \
119-
CHECK_FOR_UPGRADES="$${CHECK_FOR_UPGRADES:-false}" \
120119
KUBECONFIG=hack/.kube/postgres-operator/pgo \
121120
PGO_NAMESPACE='postgres-operator' \
122121
PGO_INSTALLER='deploy-dev' \

cmd/postgres-operator/main.go

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ import (
3434
"github.com/crunchydata/postgres-operator/internal/initialize"
3535
"github.com/crunchydata/postgres-operator/internal/kubernetes"
3636
"github.com/crunchydata/postgres-operator/internal/logging"
37-
"github.com/crunchydata/postgres-operator/internal/registration"
3837
"github.com/crunchydata/postgres-operator/internal/tracing"
39-
"github.com/crunchydata/postgres-operator/internal/upgradecheck"
4038
"github.com/crunchydata/postgres-operator/pkg/apis/postgres-operator.crunchydata.com/v1beta1"
4139
)
4240

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

246-
registrar := need(registration.NewRunner(os.Getenv("RSA_KEY"), os.Getenv("TOKEN_PATH"), stopRunning))
247-
must(manager.Add(registrar))
248-
token, _ := registrar.CheckToken()
249-
250244
bridgeURL := os.Getenv("PGO_BRIDGE_URL")
251245
bridgeClient := func() *bridge.Client {
252246
client := bridge.NewClient(bridgeURL, versionString)
@@ -255,8 +249,8 @@ func main() {
255249
}
256250

257251
// add all PostgreSQL Operator controllers to the runtime manager
258-
must(pgupgrade.ManagedReconciler(manager, registrar))
259-
must(postgrescluster.ManagedReconciler(manager, registrar))
252+
must(pgupgrade.ManagedReconciler(manager))
253+
must(postgrescluster.ManagedReconciler(manager))
260254
must(standalone_pgadmin.ManagedReconciler(manager))
261255
must(crunchybridgecluster.ManagedReconciler(manager, func() bridge.ClientInterface {
262256
return bridgeClient()
@@ -266,16 +260,6 @@ func main() {
266260
must(bridge.ManagedInstallationReconciler(manager, bridgeClient))
267261
}
268262

269-
// Enable upgrade checking
270-
upgradeCheckingDisabled := strings.EqualFold(os.Getenv("CHECK_FOR_UPGRADES"), "false")
271-
if !upgradeCheckingDisabled {
272-
log.Info("upgrade checking enabled")
273-
url := os.Getenv("CHECK_FOR_UPGRADES_URL")
274-
must(upgradecheck.ManagedScheduler(manager, url, versionString, token))
275-
} else {
276-
log.Info("upgrade checking disabled")
277-
}
278-
279263
// Enable health probes
280264
must(manager.AddHealthzCheck("health", healthz.Ping))
281265
must(manager.AddReadyzCheck("check", healthz.Ping))

config/crd/bases/postgres-operator.crunchydata.com_postgresclusters.yaml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19085,11 +19085,6 @@ spec:
1908519085
type: integer
1908619086
type: object
1908719087
type: object
19088-
registrationRequired:
19089-
properties:
19090-
pgoVersion:
19091-
type: string
19092-
type: object
1909319088
startupInstance:
1909419089
description: |-
1909519090
The instance that should be started first when bootstrapping and/or starting a
@@ -19098,8 +19093,6 @@ spec:
1909819093
startupInstanceSet:
1909919094
description: The instance set associated with the startupInstance
1910019095
type: string
19101-
tokenRequired:
19102-
type: string
1910319096
userInterface:
1910419097
description: Current state of the PostgreSQL user interface.
1910519098
properties:
@@ -38138,11 +38131,6 @@ spec:
3813838131
type: integer
3813938132
type: object
3814038133
type: object
38141-
registrationRequired:
38142-
properties:
38143-
pgoVersion:
38144-
type: string
38145-
type: object
3814638134
startupInstance:
3814738135
description: |-
3814838136
The instance that should be started first when bootstrapping and/or starting a
@@ -38151,8 +38139,6 @@ spec:
3815138139
startupInstanceSet:
3815238140
description: The instance set associated with the startupInstance
3815338141
type: string
38154-
tokenRequired:
38155-
type: string
3815638142
userInterface:
3815738143
description: Current state of the PostgreSQL user interface.
3815838144
properties:

go.mod

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ go 1.24.0
55

66
require (
77
github.com/go-logr/logr v1.4.3
8-
github.com/golang-jwt/jwt/v5 v5.3.0
98
github.com/google/go-cmp v0.7.0
10-
github.com/google/uuid v1.6.0
119
github.com/itchyny/gojq v0.12.17
1210
github.com/kubernetes-csi/external-snapshotter/client/v8 v8.2.0
1311
github.com/onsi/ginkgo/v2 v2.25.3
@@ -62,6 +60,7 @@ require (
6260
github.com/google/cel-go v0.23.2 // indirect
6361
github.com/google/gnostic-models v0.6.9 // indirect
6462
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 // indirect
63+
github.com/google/uuid v1.6.0 // indirect
6564
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect
6665
github.com/grafana/regexp v0.0.0-20240518133315-a468a5bfb3bc // indirect
6766
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.2 // indirect

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ github.com/gobuffalo/flect v1.0.3 h1:xeWBM2nui+qnVvNM4S3foBhCAL2XgPU+a7FdpelbTq4
5252
github.com/gobuffalo/flect v1.0.3/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs=
5353
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
5454
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
55-
github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo=
56-
github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE=
5755
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
5856
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
5957
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=

internal/controller/pgupgrade/pgupgrade_controller.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import (
2323
"github.com/crunchydata/postgres-operator/internal/controller/runtime"
2424
"github.com/crunchydata/postgres-operator/internal/logging"
2525
"github.com/crunchydata/postgres-operator/internal/naming"
26-
"github.com/crunchydata/postgres-operator/internal/registration"
2726
"github.com/crunchydata/postgres-operator/internal/tracing"
2827
"github.com/crunchydata/postgres-operator/pkg/apis/postgres-operator.crunchydata.com/v1beta1"
2928
)
@@ -34,8 +33,7 @@ const (
3433

3534
// PGUpgradeReconciler reconciles a PGUpgrade object
3635
type PGUpgradeReconciler struct {
37-
Recorder record.EventRecorder
38-
Registration registration.Registration
36+
Recorder record.EventRecorder
3937

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

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

6260
reconciler := &PGUpgradeReconciler{
6361
Reader: kubernetes,
6462
Recorder: recorder,
65-
Registration: r,
6663
StatusWriter: kubernetes.Status(),
6764
Writer: kubernetes,
6865
}
@@ -150,10 +147,6 @@ func (r *PGUpgradeReconciler) Reconcile(ctx context.Context, upgrade *v1beta1.PG
150147
return
151148
}
152149

153-
if !r.UpgradeAuthorized(upgrade) {
154-
return ctrl.Result{}, nil
155-
}
156-
157150
// Set progressing condition to true if it doesn't exist already
158151
setStatusToProgressingIfReasonWas("", upgrade)
159152

internal/controller/pgupgrade/registration.go

Lines changed: 0 additions & 27 deletions
This file was deleted.

internal/controller/pgupgrade/registration_test.go

Lines changed: 0 additions & 95 deletions
This file was deleted.

internal/controller/postgrescluster/controller.go

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import (
3636
"github.com/crunchydata/postgres-operator/internal/naming"
3737
"github.com/crunchydata/postgres-operator/internal/pki"
3838
"github.com/crunchydata/postgres-operator/internal/postgres"
39-
"github.com/crunchydata/postgres-operator/internal/registration"
4039
"github.com/crunchydata/postgres-operator/internal/tracing"
4140
"github.com/crunchydata/postgres-operator/pkg/apis/postgres-operator.crunchydata.com/v1beta1"
4241
)
@@ -64,8 +63,7 @@ type Reconciler struct {
6463
Patch(context.Context, client.Object, client.Patch, ...client.SubResourcePatchOption) error
6564
}
6665

67-
Recorder record.EventRecorder
68-
Registration registration.Registration
66+
Recorder record.EventRecorder
6967
}
7068

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

186-
if r.Registration != nil && r.Registration.Required(r.Recorder, cluster, &cluster.Status.Conditions) {
187-
registration.SetAdvanceWarning(r.Recorder, cluster, &cluster.Status.Conditions)
188-
}
189-
cluster.Status.RegistrationRequired = nil
190-
cluster.Status.TokenRequired = ""
191-
192184
// if the cluster is paused, set a condition and return
193185
if cluster.Spec.Paused != nil && *cluster.Spec.Paused {
194186
meta.SetStatusCondition(&cluster.Status.Conditions, metav1.Condition{
@@ -444,7 +436,7 @@ func (r *Reconciler) setOwnerReference(
444436
// +kubebuilder:rbac:groups="postgres-operator.crunchydata.com",resources="postgresclusters",verbs={get,list,watch}
445437

446438
// ManagedReconciler creates a [Reconciler] and adds it to m.
447-
func ManagedReconciler(m manager.Manager, r registration.Registration) error {
439+
func ManagedReconciler(m manager.Manager) error {
448440
exec, err := runtime.NewPodExecutor(m.GetConfig())
449441
kubernetes := client.WithFieldOwner(m.GetClient(), naming.ControllerPostgresCluster)
450442
recorder := m.GetEventRecorderFor(naming.ControllerPostgresCluster)
@@ -453,7 +445,6 @@ func ManagedReconciler(m manager.Manager, r registration.Registration) error {
453445
PodExec: exec,
454446
Reader: kubernetes,
455447
Recorder: recorder,
456-
Registration: r,
457448
StatusWriter: kubernetes.Status(),
458449
Writer: kubernetes,
459450
}

0 commit comments

Comments
 (0)