Skip to content

Commit

Permalink
fix: konnectExtension with bg enabled
Browse files Browse the repository at this point in the history
This commit fixes a bug related to KonnectExtensions for DataPlane
configured with BlueGreen. In such configurations, the preview
deployment was not customized with the Konnect-related field.
Both the live and preview deployments are now properly customized with
konnect fields.

Signed-off-by: Mattia Lavacca <[email protected]>
  • Loading branch information
mlavacca committed Dec 20, 2024
1 parent f786d6b commit 33aa618
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
16 changes: 16 additions & 0 deletions controller/dataplane/bluegreen_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ type BlueGreenReconciler struct {
ContextInjector ctxinjector.CtxInjector

DefaultImage string

KonnectEnabled bool
}

// SetupWithManager sets up the controller with the Manager.
Expand Down Expand Up @@ -135,6 +137,20 @@ func (r *BlueGreenReconciler) Reconcile(ctx context.Context, req ctrl.Request) (

// DataPlane is ready and we can proceed with deploying preview resources.

// customize the dataplane with the extensions field
log.Trace(logger, "applying extensions")
patched, requeue, err := applyExtensions(ctx, r.Client, logger, &dataplane, r.KonnectEnabled)
if err != nil {
if !requeue {
log.Debug(logger, "failed to apply extensions", "err", err)
return ctrl.Result{}, nil
}
return ctrl.Result{}, err
}
if patched {
return ctrl.Result{}, nil
}

// Ensure "preview" Admin API service.
res, dataplaneAdminService, err := r.ensurePreviewAdminAPIService(ctx, logger, &dataplane)
if err != nil {
Expand Down
3 changes: 2 additions & 1 deletion modules/manager/controller_setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,8 @@ func SetupControllers(mgr manager.Manager, c *Config) (map[string]ControllerDef,
BeforeDeployment: dataplane.CreateCallbackManager(),
AfterDeployment: dataplane.CreateCallbackManager(),
},
DefaultImage: consts.DefaultDataPlaneImage,
DefaultImage: consts.DefaultDataPlaneImage,
KonnectEnabled: c.KonnectControllersEnabled,
},
},
DataPlaneOwnedServiceFinalizerControllerName: {
Expand Down

0 comments on commit 33aa618

Please sign in to comment.