Skip to content

Commit fcfe74f

Browse files
committed
UNF: use new merge function to get external DWOC
1 parent 786cd46 commit fcfe74f

File tree

4 files changed

+120
-149
lines changed

4 files changed

+120
-149
lines changed

apis/controller/v1alpha1/devworkspaceoperatorconfig_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ type StorageSizes struct {
7979
PerWorkspace *resource.Quantity `json:"perWorkspace,omitempty"`
8080
}
8181

82-
//TODO: Should this be here or in another file?
82+
//TODO: Remove this
8383
// Allows specifying an external DevWorkspace-Operator configuration
8484
// which will merged with the workspace's DevWorkspace-Operator configuration.
8585
type ExternalConfig struct {

controllers/workspace/devworkspace_controller.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ func (r *DevWorkspaceReconciler) Reconcile(ctx context.Context, req ctrl.Request
110110

111111
// Fetch the Workspace instance
112112
workspaceWithConfig := &common.DevWorkspaceWithConfig{}
113-
workspaceWithConfig.Config = *config.InternalConfig
114113
err = r.Get(ctx, req.NamespacedName, &workspaceWithConfig.DevWorkspace)
115114
if err != nil {
116115
if k8sErrors.IsNotFound(err) {
@@ -122,6 +121,10 @@ func (r *DevWorkspaceReconciler) Reconcile(ctx context.Context, req ctrl.Request
122121
// Error reading the object - requeue the request.
123122
return reconcile.Result{}, err
124123
}
124+
125+
// Get the config for the workspace
126+
workspaceWithConfig.Config = *config.InternalConfig
127+
125128
reqLogger = reqLogger.WithValues(constants.DevWorkspaceIDLoggerKey, workspaceWithConfig.Status.DevWorkspaceId)
126129
reqLogger.Info("Reconciling Workspace")
127130

0 commit comments

Comments
 (0)