Skip to content

Commit fc31149

Browse files
Remove CHECK_FOR_UPGRADES and registration
1 parent f1d0add commit fc31149

File tree

22 files changed

+11
-2451
lines changed

22 files changed

+11
-2451
lines changed

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ deploy-dev: createnamespaces
128128
QUERIES_CONFIG_DIR='$(QUERIES_CONFIG_DIR)' \
129129
CRUNCHY_DEBUG="$${CRUNCHY_DEBUG:-true}" \
130130
PGO_FEATURE_GATES="$${PGO_FEATURE_GATES:-AllAlpha=true,AppendCustomQueries=false}" \
131-
CHECK_FOR_UPGRADES="$${CHECK_FOR_UPGRADES:-false}" \
132131
KUBECONFIG=hack/.kube/postgres-operator/pgo \
133132
PGO_NAMESPACE='postgres-operator' \
134133
PGO_INSTALLER='deploy-dev' \

cmd/postgres-operator/main.go

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ import (
3434
"github.com/crunchydata/postgres-operator/internal/kubernetes"
3535
"github.com/crunchydata/postgres-operator/internal/logging"
3636
"github.com/crunchydata/postgres-operator/internal/naming"
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

@@ -223,13 +221,8 @@ func main() {
223221
assertNoError(err)
224222
assertNoError(mgr.Add(k8s))
225223

226-
registrar, err := registration.NewRunner(os.Getenv("RSA_KEY"), os.Getenv("TOKEN_PATH"), stopRunning)
227-
assertNoError(err)
228-
assertNoError(mgr.Add(registrar))
229-
token, _ := registrar.CheckToken()
230-
231224
// add all PostgreSQL Operator controllers to the runtime manager
232-
addControllersToManager(mgr, log, registrar)
225+
addControllersToManager(mgr, log)
233226

234227
if features.Enabled(feature.BridgeIdentifiers) {
235228
constructor := func() *bridge.Client {
@@ -241,22 +234,6 @@ func main() {
241234
assertNoError(bridge.ManagedInstallationReconciler(mgr, constructor))
242235
}
243236

244-
// Enable upgrade checking
245-
upgradeCheckingDisabled := strings.EqualFold(os.Getenv("CHECK_FOR_UPGRADES"), "false")
246-
if !upgradeCheckingDisabled {
247-
log.Info("upgrade checking enabled")
248-
// get the URL for the check for upgrades endpoint if set in the env
249-
assertNoError(
250-
upgradecheck.ManagedScheduler(
251-
mgr,
252-
os.Getenv("CHECK_FOR_UPGRADES_URL"),
253-
versionString,
254-
token,
255-
))
256-
} else {
257-
log.Info("upgrade checking disabled")
258-
}
259-
260237
// Enable health probes
261238
assertNoError(mgr.AddHealthzCheck("health", healthz.Ping))
262239
assertNoError(mgr.AddReadyzCheck("check", healthz.Ping))
@@ -288,12 +265,11 @@ func main() {
288265

289266
// addControllersToManager adds all PostgreSQL Operator controllers to the provided controller
290267
// runtime manager.
291-
func addControllersToManager(mgr runtime.Manager, log logging.Logger, reg registration.Registration) {
268+
func addControllersToManager(mgr runtime.Manager, log logging.Logger) {
292269
pgReconciler := &postgrescluster.Reconciler{
293-
Client: mgr.GetClient(),
294-
Owner: postgrescluster.ControllerName,
295-
Recorder: mgr.GetEventRecorderFor(postgrescluster.ControllerName),
296-
Registration: reg,
270+
Client: mgr.GetClient(),
271+
Owner: postgrescluster.ControllerName,
272+
Recorder: mgr.GetEventRecorderFor(postgrescluster.ControllerName),
297273
}
298274

299275
if err := pgReconciler.SetupWithManager(mgr); err != nil {
@@ -302,10 +278,9 @@ func addControllersToManager(mgr runtime.Manager, log logging.Logger, reg regist
302278
}
303279

304280
upgradeReconciler := &pgupgrade.PGUpgradeReconciler{
305-
Client: mgr.GetClient(),
306-
Owner: "pgupgrade-controller",
307-
Recorder: mgr.GetEventRecorderFor("pgupgrade-controller"),
308-
Registration: reg,
281+
Client: mgr.GetClient(),
282+
Owner: "pgupgrade-controller",
283+
Recorder: mgr.GetEventRecorderFor("pgupgrade-controller"),
309284
}
310285

311286
if err := upgradeReconciler.SetupWithManager(mgr); err != nil {

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18601,11 +18601,6 @@ spec:
1860118601
type: integer
1860218602
type: object
1860318603
type: object
18604-
registrationRequired:
18605-
properties:
18606-
pgoVersion:
18607-
type: string
18608-
type: object
1860918604
startupInstance:
1861018605
description: |-
1861118606
The instance that should be started first when bootstrapping and/or starting a
@@ -18614,8 +18609,6 @@ spec:
1861418609
startupInstanceSet:
1861518610
description: The instance set associated with the startupInstance
1861618611
type: string
18617-
tokenRequired:
18618-
type: string
1861918612
userInterface:
1862018613
description: Current state of the PostgreSQL user interface.
1862118614
properties:

go.mod

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

66
require (
77
github.com/go-logr/logr v1.4.2
8-
github.com/golang-jwt/jwt/v5 v5.2.2
98
github.com/google/go-cmp v0.6.0
10-
github.com/google/uuid v1.6.0
119
github.com/kubernetes-csi/external-snapshotter/client/v8 v8.0.0
1210
github.com/onsi/ginkgo/v2 v2.22.0
1311
github.com/onsi/gomega v1.36.1
@@ -59,6 +57,7 @@ require (
5957
github.com/google/gnostic-models v0.6.8 // indirect
6058
github.com/google/gofuzz v1.2.0 // indirect
6159
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad // indirect
60+
github.com/google/uuid v1.6.0 // indirect
6261
github.com/gorilla/websocket v1.5.0 // indirect
6362
github.com/grpc-ecosystem/grpc-gateway/v2 v2.23.0 // indirect
6463
github.com/imdario/mergo v0.3.16 // indirect

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1v
4646
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
4747
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
4848
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
49-
github.com/golang-jwt/jwt/v5 v5.2.2 h1:Rl4B7itRWVtYIHFrSNd7vhTiz9UpLdi6gZhZ3wEeDy8=
50-
github.com/golang-jwt/jwt/v5 v5.2.2/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
5149
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
5250
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
5351
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=

internal/controller/pgupgrade/pgupgrade_controller.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"github.com/crunchydata/postgres-operator/internal/config"
2222
"github.com/crunchydata/postgres-operator/internal/controller/runtime"
2323
"github.com/crunchydata/postgres-operator/internal/logging"
24-
"github.com/crunchydata/postgres-operator/internal/registration"
2524
"github.com/crunchydata/postgres-operator/internal/tracing"
2625
"github.com/crunchydata/postgres-operator/pkg/apis/postgres-operator.crunchydata.com/v1beta1"
2726
)
@@ -35,8 +34,7 @@ type PGUpgradeReconciler struct {
3534
Client client.Client
3635
Owner client.FieldOwner
3736

38-
Recorder record.EventRecorder
39-
Registration registration.Registration
37+
Recorder record.EventRecorder
4038
}
4139

4240
//+kubebuilder:rbac:groups="batch",resources="jobs",verbs={list,watch}
@@ -145,10 +143,6 @@ func (r *PGUpgradeReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
145143
return
146144
}
147145

148-
if !r.UpgradeAuthorized(upgrade) {
149-
return ctrl.Result{}, nil
150-
}
151-
152146
// Set progressing condition to true if it doesn't exist already
153147
setStatusToProgressingIfReasonWas("", upgrade)
154148

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: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import (
3535
"github.com/crunchydata/postgres-operator/internal/logging"
3636
"github.com/crunchydata/postgres-operator/internal/pki"
3737
"github.com/crunchydata/postgres-operator/internal/postgres"
38-
"github.com/crunchydata/postgres-operator/internal/registration"
3938
"github.com/crunchydata/postgres-operator/internal/tracing"
4039
"github.com/crunchydata/postgres-operator/pkg/apis/postgres-operator.crunchydata.com/v1beta1"
4140
)
@@ -53,8 +52,7 @@ type Reconciler struct {
5352
ctx context.Context, namespace, pod, container string,
5453
stdin io.Reader, stdout, stderr io.Writer, command ...string,
5554
) error
56-
Recorder record.EventRecorder
57-
Registration registration.Registration
55+
Recorder record.EventRecorder
5856
}
5957

6058
// +kubebuilder:rbac:groups="",resources="events",verbs={create,patch}
@@ -187,12 +185,6 @@ func (r *Reconciler) Reconcile(
187185
return nil
188186
}
189187

190-
if r.Registration != nil && r.Registration.Required(r.Recorder, cluster, &cluster.Status.Conditions) {
191-
registration.SetAdvanceWarning(r.Recorder, cluster, &cluster.Status.Conditions)
192-
}
193-
cluster.Status.RegistrationRequired = nil
194-
cluster.Status.TokenRequired = ""
195-
196188
// if the cluster is paused, set a condition and return
197189
if cluster.Spec.Paused != nil && *cluster.Spec.Paused {
198190
meta.SetStatusCondition(&cluster.Status.Conditions, metav1.Condition{

0 commit comments

Comments
 (0)